Add some sensors

This commit is contained in:
Andre Basche 2023-09-29 17:24:21 +02:00
parent f02ec780a2
commit 6516f87127
6 changed files with 77 additions and 26 deletions

View file

@ -383,9 +383,10 @@ For every device exists a button under diagnostics which can be used to log all
| Energy Label | `lightning-bolt-circle` | `sensor` | `startProgram.energyLabel` | | Energy Label | `lightning-bolt-circle` | `sensor` | `startProgram.energyLabel` |
| Program | | `select` | `startProgram.program` | | Program | | `select` | `startProgram.program` |
| Steam Type | `weather-dust` | `sensor` | `steamType` | | Steam Type | `weather-dust` | `sensor` | `steamType` |
| Sterilization | `clock-start` | `switch` | `startProgram.sterilizationStatus` | | Sterilization | `lotion-plus` | `switch` | `startProgram.sterilizationStatus` |
| Suggested Load | `weight-kilogram` | `sensor` | `startProgram.suggestedLoadD` | | Suggested Load | `weight-kilogram` | `sensor` | `startProgram.suggestedLoadD` |
| Temperature level | `thermometer` | `number` | `startProgram.tempLevel` | | Temperature level | `thermometer` | `number` | `startProgram.tempLevel` |
| Tumbling | `refresh-circle` | `switch` | `startProgram.tumblingStatus` |
#### Sensors #### Sensors
| Name | Icon | Entity | Key | | Name | Icon | Entity | Key |
| --- | --- | --- | --- | | --- | --- | --- | --- |
@ -426,14 +427,17 @@ For every device exists a button under diagnostics which can be used to log all
#### Controls #### Controls
| Name | Icon | Entity | Key | | Name | Icon | Entity | Key |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Auto Dose Detergent | `cup` | `switch` | `autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `autoSoftenerStatus` |
| Pause Washer Dryer | `pause` | `switch` | `pauseProgram` / `resumeProgram` | | Pause Washer Dryer | `pause` | `switch` | `pauseProgram` / `resumeProgram` |
| Washer Dryer | `washing-machine` | `switch` | `startProgram` / `stopProgram` | | Washer Dryer | `washing-machine` | `switch` | `startProgram` / `stopProgram` |
| Water hard | `water` | `number` | `settings.waterHard` |
#### Configs #### Configs
| Name | Icon | Entity | Key | | Name | Icon | Entity | Key |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Acqua Plus | `water-plus` | `switch` | `startProgram.acquaplus` | | Acqua Plus | `water-plus` | `switch` | `startProgram.acquaplus` |
| Anti-Crease | `iron` | `switch` | `startProgram.antiCreaseTime` |
| Anti-Crease | `iron` | `switch` | `startProgram.anticrease` | | Anti-Crease | `iron` | `switch` | `startProgram.anticrease` |
| Anti-Crease | `iron` | `switch` | `startProgram.antiCreaseTime` |
| Auto Dose Detergent | `cup` | `switch` | `startProgram.autoDetergentStatus` | | Auto Dose Detergent | `cup` | `switch` | `startProgram.autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `startProgram.autoSoftenerStatus` | | Auto Dose Softener | `teddy-bear` | `switch` | `startProgram.autoSoftenerStatus` |
| Delay Status | `timer-check` | `switch` | `startProgram.delayStatus` | | Delay Status | `timer-check` | `switch` | `startProgram.delayStatus` |
@ -452,6 +456,7 @@ For every device exists a button under diagnostics which can be used to log all
| Liquid Detergent Dose | `cup-water` | `sensor` | `startProgram.liquidDetergentDose` | | Liquid Detergent Dose | `cup-water` | `sensor` | `startProgram.liquidDetergentDose` |
| Main Wash Time | `clock-start` | `number` | `startProgram.mainWashTime` | | Main Wash Time | `clock-start` | `number` | `startProgram.mainWashTime` |
| Powder Detergent Dose | `cup` | `sensor` | `startProgram.powderDetergentDose` | | Powder Detergent Dose | `cup` | `sensor` | `startProgram.powderDetergentDose` |
| Prewash | `tshirt-crew` | `switch` | `startProgram.prewash` |
| Program | | `select` | `startProgram.program` | | Program | | `select` | `startProgram.program` |
| Remaining Time | `timer` | `sensor` | `startProgram.remainingTime` | | Remaining Time | `timer` | `sensor` | `startProgram.remainingTime` |
| Rinse Iterations | `rotate-right` | `number` | `startProgram.rinseIterations` | | Rinse Iterations | `rotate-right` | `number` | `startProgram.rinseIterations` |
@ -459,12 +464,13 @@ For every device exists a button under diagnostics which can be used to log all
| Spin speed | `numeric` | `select` | `startProgram.spinSpeed` | | Spin speed | `numeric` | `select` | `startProgram.spinSpeed` |
| Steam Type | `weather-dust` | `sensor` | `steamType` | | Steam Type | `weather-dust` | `sensor` | `steamType` |
| Steam level | `weather-dust` | `select` | `startProgram.steamLevel` | | Steam level | `weather-dust` | `select` | `startProgram.steamLevel` |
| Sterilization | `clock-start` | `switch` | `startProgram.sterilizationStatus` | | Sterilization | `lotion-plus` | `switch` | `startProgram.sterilizationStatus` |
| Suggested Load | `weight-kilogram` | `sensor` | `startProgram.suggestedLoadW` | | Suggested Load | `weight-kilogram` | `sensor` | `startProgram.suggestedLoadW` |
| Suggested Load | `weight-kilogram` | `sensor` | `startProgram.suggestedLoadD` | | Suggested Load | `weight-kilogram` | `sensor` | `startProgram.suggestedLoadD` |
| Suggested weight | `weight-kilogram` | `sensor` | `startProgram.weight` | | Suggested weight | `weight-kilogram` | `sensor` | `startProgram.weight` |
| Temperature | `thermometer` | `select` | `startProgram.temp` | | Temperature | `thermometer` | `select` | `startProgram.temp` |
| Temperature level | `thermometer` | `number` | `startProgram.tempLevel` | | Temperature level | `thermometer` | `number` | `startProgram.tempLevel` |
| Tumbling | `refresh-circle` | `switch` | `startProgram.tumblingStatus` |
| Water hard | `water` | `number` | `startProgram.waterHard` | | Water hard | `water` | `number` | `startProgram.waterHard` |
| lang | | `number` | `startProgram.lang` | | lang | | `number` | `startProgram.lang` |
#### Sensors #### Sensors
@ -502,12 +508,16 @@ For every device exists a button under diagnostics which can be used to log all
#### Controls #### Controls
| Name | Icon | Entity | Key | | Name | Icon | Entity | Key |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Auto Dose Detergent | `cup` | `switch` | `autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `autoSoftenerStatus` |
| Pause Washing Machine | `pause` | `switch` | `pauseProgram` / `resumeProgram` | | Pause Washing Machine | `pause` | `switch` | `pauseProgram` / `resumeProgram` |
| Washing Machine | `washing-machine` | `switch` | `startProgram` / `stopProgram` | | Washing Machine | `washing-machine` | `switch` | `startProgram` / `stopProgram` |
| Water hard | `water` | `number` | `settings.waterHard` |
#### Configs #### Configs
| Name | Icon | Entity | Key | | Name | Icon | Entity | Key |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Acqua Plus | `water-plus` | `switch` | `startProgram.acquaplus` | | Acqua Plus | `water-plus` | `switch` | `startProgram.acquaplus` |
| Anti-Crease | `iron` | `switch` | `startProgram.anticrease` |
| Auto Dose Detergent | `cup` | `switch` | `startProgram.autoDetergentStatus` | | Auto Dose Detergent | `cup` | `switch` | `startProgram.autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `startProgram.autoSoftenerStatus` | | Auto Dose Softener | `teddy-bear` | `switch` | `startProgram.autoSoftenerStatus` |
| Delay Status | `timer-check` | `switch` | `startProgram.delayStatus` | | Delay Status | `timer-check` | `switch` | `startProgram.delayStatus` |
@ -523,6 +533,7 @@ For every device exists a button under diagnostics which can be used to log all
| Liquid Detergent Dose | `cup-water` | `sensor` | `startProgram.liquidDetergentDose` | | Liquid Detergent Dose | `cup-water` | `sensor` | `startProgram.liquidDetergentDose` |
| Main Wash Time | `clock-start` | `number` | `startProgram.mainWashTime` | | Main Wash Time | `clock-start` | `number` | `startProgram.mainWashTime` |
| Powder Detergent Dose | `cup` | `sensor` | `startProgram.powderDetergentDose` | | Powder Detergent Dose | `cup` | `sensor` | `startProgram.powderDetergentDose` |
| Prewash | `tshirt-crew` | `switch` | `startProgram.prewash` |
| Program | | `select` | `startProgram.program` | | Program | | `select` | `startProgram.program` |
| Remaining Time | `timer` | `sensor` | `startProgram.remainingTime` | | Remaining Time | `timer` | `sensor` | `startProgram.remainingTime` |
| Rinse Iterations | `rotate-right` | `number` | `startProgram.rinseIterations` | | Rinse Iterations | `rotate-right` | `number` | `startProgram.rinseIterations` |

View file

@ -363,7 +363,13 @@ class HonClimateEntity(HonEntity, ClimateEntity):
async def async_set_preset_mode(self, preset_mode: str) -> None: async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set the new preset mode.""" """Set the new preset mode."""
command = "stopProgram" if preset_mode == "no_mode" else "startProgram" if preset_mode == "no_mode" and HVACMode.OFF in self.hvac_modes:
command = "stopProgram"
elif preset_mode == "no_mode":
command = "settings"
self._device.commands["settings"].reset()
else:
command = "startProgram"
if program := self._device.settings.get(f"{command}.program"): if program := self._device.settings.get(f"{command}.program"):
program.value = preset_mode program.value = preset_mode
zone = self._device.settings.get(f"{command}.zone") zone = self._device.settings.get(f"{command}.zone")
@ -371,9 +377,9 @@ class HonClimateEntity(HonEntity, ClimateEntity):
zone.value = self.entity_description.name.lower() zone.value = self.entity_description.name.lower()
self._device.sync_command(command, "settings") self._device.sync_command(command, "settings")
self._set_temperature_bound() self._set_temperature_bound()
self._attr_preset_mode = preset_mode
await self.coordinator.async_refresh() await self.coordinator.async_refresh()
await self._device.commands[command].send() await self._device.commands[command].send()
self._attr_preset_mode = preset_mode
self.async_write_ha_state() self.async_write_ha_state()
def _set_temperature_bound(self) -> None: def _set_temperature_bound(self) -> None:

View file

@ -57,6 +57,12 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
icon="mdi:water", icon="mdi:water",
translation_key="water_hard", translation_key="water_hard",
), ),
HonNumberEntityDescription(
key="settings.waterHard",
name="Water hard",
icon="mdi:water",
translation_key="water_hard",
),
HonConfigNumberEntityDescription( HonConfigNumberEntityDescription(
key="startProgram.lang", key="startProgram.lang",
name="lang", name="lang",

View file

@ -63,6 +63,12 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
icon="mdi:tshirt-crew", icon="mdi:tshirt-crew",
translation_key="prewash", translation_key="prewash",
), ),
HonConfigSwitchEntityDescription(
key="startProgram.prewash",
name="Prewash",
icon="mdi:tshirt-crew",
translation_key="prewash",
),
HonConfigSwitchEntityDescription( HonConfigSwitchEntityDescription(
key="startProgram.permanentPressStatus", key="startProgram.permanentPressStatus",
name="Keep Fresh", name="Keep Fresh",
@ -81,6 +87,18 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
icon="mdi:cup", icon="mdi:cup",
translation_key="auto_dose_detergent", translation_key="auto_dose_detergent",
), ),
HonSwitchEntityDescription(
key="autoSoftenerStatus",
name="Auto Dose Softener",
icon="mdi:teddy-bear",
translation_key="auto_dose_softener",
),
HonSwitchEntityDescription(
key="autoDetergentStatus",
name="Auto Dose Detergent",
icon="mdi:cup",
translation_key="auto_dose_detergent",
),
HonConfigSwitchEntityDescription( HonConfigSwitchEntityDescription(
key="startProgram.acquaplus", key="startProgram.acquaplus",
name="Acqua Plus", name="Acqua Plus",
@ -117,6 +135,12 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
icon="mdi:lotion-plus", icon="mdi:lotion-plus",
translation_key="hygiene", translation_key="hygiene",
), ),
HonConfigSwitchEntityDescription(
key="startProgram.anticrease",
name="Anti-Crease",
icon="mdi:iron",
translation_key="anti_crease",
),
), ),
"TD": ( "TD": (
HonControlSwitchEntityDescription( HonControlSwitchEntityDescription(
@ -138,7 +162,13 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
HonConfigSwitchEntityDescription( HonConfigSwitchEntityDescription(
key="startProgram.sterilizationStatus", key="startProgram.sterilizationStatus",
name="Sterilization", name="Sterilization",
icon="mdi:clock-start", icon="mdi:lotion-plus",
),
HonConfigSwitchEntityDescription(
key="startProgram.tumblingStatus",
name="Tumbling",
icon="mdi:refresh-circle",
translation_key="keep_fresh",
), ),
HonConfigSwitchEntityDescription( HonConfigSwitchEntityDescription(
key="startProgram.antiCreaseTime", key="startProgram.antiCreaseTime",
@ -370,10 +400,7 @@ async def async_setup_entry(
continue continue
entity = HonControlSwitchEntity(hass, entry, device, description) entity = HonControlSwitchEntity(hass, entry, device, description)
elif isinstance(description, HonSwitchEntityDescription): elif isinstance(description, HonSwitchEntityDescription):
if ( if f"settings.{description.key}" not in device.available_settings:
f"settings.{description.key}" not in device.available_settings
or device.get(description.key) is None
):
continue continue
entity = HonSwitchEntity(hass, entry, device, description) entity = HonSwitchEntity(hass, entry, device, description)
else: else:

24
info.md
View file

@ -28,19 +28,19 @@ _If the integration is not in the list, you need to clear the browser cache._
Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8). Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8).
| | **Haier** | **Hoover** | **Candy** | | | **Haier** | **Hoover** | **Candy** |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| |---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| **Washing Machine** | HW80-B14959TU1DE <br/> HW80-B14959TU1IT <br/> HW80-B14979TU1 <br/> HW90-B14TEAM5 <br/> HW90G-BD14979UD <br/> HW100-B14959U1 <br/> HW110-14979 | H-WASH 500 <br/> H7W4 48MBC-S <br/> HLWPS495TAMBE-11 <br/> HW 410AMBCB/1-80 <br/> HWE 49AMBS/1-S | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO14126DWMST-S <br/> RO441286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S | | **Washing Machine** | HW80-B14959TU1DE <br/> HW80-B14959TU1IT <br/> HW80-B14979TU1 <br/> HW90-B14TEAM5 <br/> HW90G-BD14979UD <br/> HW100-B14959U1 <br/> HW110-14979 | H-WASH 500 <br/> H7W4 48MBC-S <br/> HLWPS495TAMBE-11 <br/> HW 410AMBCB/1-80 <br/> HWE 49AMBS/1-S | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO14126DWMST-S <br/> RO441286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S |
| **Tumble Dryer** | HD80-A3959 <br/> HD90-A3TEAM5 <br/> HD90-A2959 | H-DRY 500 <br/> H9A3TCBEXS-S <br/> HLE C10DCE-80 <br/> H5WPB447AMBC/1-S <br/> NDE H10A2TCE-80 <br/> NDE H9A2TSBEXS-S <br/> NDPHY10A2TCBEXSS | BCTDH7A1TE <br/> CSOE C10DE-80 <br/> ROE H9A3TCEX-S <br/> ROE H10A2TCE-07 | | **Tumble Dryer** | HD80-A3959 <br/> HD90-A3TEAM5 <br/> HD90-A2959 | H-DRY 500 <br/> H9A3TCBEXS-S <br/> HLE C10DCE-80 <br/> H5WPB447AMBC/1-S <br/> NDE H10A2TCE-80 <br/> NDE H9A2TSBEXS-S <br/> NDPHY10A2TCBEXSS | BCTDH7A1TE <br/> CSOE C10DE-80 <br/> ROE H9A3TCEX-S <br/> ROE H10A2TCE-07 |
| **Washer Dryer** | HWD100-B14979 <br/> HWD100-B14978 | HD 485AMBB/1-S <br/> HD 495AMC/1-S <br/> HD 4106AMC/1-80 <br/> HDQ 496AMBS/1-S <br/> HWPS4954DAMR-11 | RPW41066BWMR/1-S | | **Washer Dryer** | HWD100-B14979 <br/> HWD100-B14978 | HD 485AMBB/1-S <br/> HD 495AMC/1-S <br/> HD 4106AMC/1-80 <br/> HDQ 496AMBS/1-S <br/> HWPS4954DAMR-11 | RPW41066BWMR/1-S |
| **Oven** | HWO60SM2F3XH | HSOT3161WG | | | **Oven** | HWO60SM2F3XH | HSOT3161WG | |
| **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | | | **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | |
| **Air Conditioner** | AD105S2SM3FA <br/> AS09TS4HRA-M <br/> AS20HPL1HRA <br/> AS25PBAHRA <br/> AS25S2SF1FA-WH <br/> AS25TADHRA-2 <br/> AS35PBAHRA <br/> AS35S2SF1FA-WH <br/> AS35S2SF2FA-3 <br/> AS35TADHRA-2 <br/> AS35TAMHRA-C <br/> AS35TEDHRA(M1) | | CY-12TAIN | | **Air Conditioner** | AD105S2SM3FA <br/> AS09TS4HRA-M <br/> AS20HPL1HRA <br/> AS25PBAHRA <br/> AS25S2SF1FA-WH <br/> AS25TADHRA-2 <br/> AS35PBAHRA <br/> AS35S2SF1FA-WH <br/> AS35S2SF2FA-3 <br/> AS35TADHRA-2 <br/> AS35TAMHRA-C <br/> AS35TEDHRA(M1) | | CY-12TAIN |
| **Fridge** | HFW7720ENMB <br/> HFW7819EWMP | | CCE4T620EWU | | **Fridge** | HFW7720ENMB <br/> HFW7819EWMP | | CCE4T620EWU |
| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI | | **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI |
| **Hood** | HADG6DS46BWIFI | | | | **Hood** | HADG6DS46BWIFI | | |
| **Wine Cellar** | HWS247FDU1 | | | | **Wine Cellar** | HWS247FDU1 | | |
| **Air Purifier** | | HHP30C011 <br/> HHP50CA001 <br/> HHP50CA011 | | | **Air Purifier** | | HHP30C011 <br/> HHP50CA001 <br/> HHP50CA011 | |
| Please add your appliances data to our [hon-test-data collection](https://github.com/Andre0512/hon-test-data). <br/>This helps us to develop new features and not to break compatibility in newer versions. | | Please add your appliances data to our [hon-test-data collection](https://github.com/Andre0512/hon-test-data). <br/>This helps us to develop new features and not to break compatibility in newer versions. |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

View file

@ -1,4 +1,5 @@
black homeassistant~=2023.10.0b2
flake8 black~=23.7.0
mypy flake8~=6.0.0
pylint mypy~=1.4.1
pylint~=2.17.4