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` |
| Program | | `select` | `startProgram.program` |
| 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` |
| Temperature level | `thermometer` | `number` | `startProgram.tempLevel` |
| Tumbling | `refresh-circle` | `switch` | `startProgram.tumblingStatus` |
#### Sensors
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
@ -426,14 +427,17 @@ For every device exists a button under diagnostics which can be used to log all
#### Controls
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
| Auto Dose Detergent | `cup` | `switch` | `autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `autoSoftenerStatus` |
| Pause Washer Dryer | `pause` | `switch` | `pauseProgram` / `resumeProgram` |
| Washer Dryer | `washing-machine` | `switch` | `startProgram` / `stopProgram` |
| Water hard | `water` | `number` | `settings.waterHard` |
#### Configs
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
| Acqua Plus | `water-plus` | `switch` | `startProgram.acquaplus` |
| Anti-Crease | `iron` | `switch` | `startProgram.antiCreaseTime` |
| Anti-Crease | `iron` | `switch` | `startProgram.anticrease` |
| Anti-Crease | `iron` | `switch` | `startProgram.antiCreaseTime` |
| Auto Dose Detergent | `cup` | `switch` | `startProgram.autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `startProgram.autoSoftenerStatus` |
| 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` |
| Main Wash Time | `clock-start` | `number` | `startProgram.mainWashTime` |
| Powder Detergent Dose | `cup` | `sensor` | `startProgram.powderDetergentDose` |
| Prewash | `tshirt-crew` | `switch` | `startProgram.prewash` |
| Program | | `select` | `startProgram.program` |
| Remaining Time | `timer` | `sensor` | `startProgram.remainingTime` |
| 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` |
| Steam Type | `weather-dust` | `sensor` | `steamType` |
| 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.suggestedLoadD` |
| Suggested weight | `weight-kilogram` | `sensor` | `startProgram.weight` |
| Temperature | `thermometer` | `select` | `startProgram.temp` |
| Temperature level | `thermometer` | `number` | `startProgram.tempLevel` |
| Tumbling | `refresh-circle` | `switch` | `startProgram.tumblingStatus` |
| Water hard | `water` | `number` | `startProgram.waterHard` |
| lang | | `number` | `startProgram.lang` |
#### Sensors
@ -502,12 +508,16 @@ For every device exists a button under diagnostics which can be used to log all
#### Controls
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
| Auto Dose Detergent | `cup` | `switch` | `autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `autoSoftenerStatus` |
| Pause Washing Machine | `pause` | `switch` | `pauseProgram` / `resumeProgram` |
| Washing Machine | `washing-machine` | `switch` | `startProgram` / `stopProgram` |
| Water hard | `water` | `number` | `settings.waterHard` |
#### Configs
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
| Acqua Plus | `water-plus` | `switch` | `startProgram.acquaplus` |
| Anti-Crease | `iron` | `switch` | `startProgram.anticrease` |
| Auto Dose Detergent | `cup` | `switch` | `startProgram.autoDetergentStatus` |
| Auto Dose Softener | `teddy-bear` | `switch` | `startProgram.autoSoftenerStatus` |
| 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` |
| Main Wash Time | `clock-start` | `number` | `startProgram.mainWashTime` |
| Powder Detergent Dose | `cup` | `sensor` | `startProgram.powderDetergentDose` |
| Prewash | `tshirt-crew` | `switch` | `startProgram.prewash` |
| Program | | `select` | `startProgram.program` |
| Remaining Time | `timer` | `sensor` | `startProgram.remainingTime` |
| 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:
"""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"):
program.value = preset_mode
zone = self._device.settings.get(f"{command}.zone")
@ -371,9 +377,9 @@ class HonClimateEntity(HonEntity, ClimateEntity):
zone.value = self.entity_description.name.lower()
self._device.sync_command(command, "settings")
self._set_temperature_bound()
self._attr_preset_mode = preset_mode
await self.coordinator.async_refresh()
await self._device.commands[command].send()
self._attr_preset_mode = preset_mode
self.async_write_ha_state()
def _set_temperature_bound(self) -> None:

View File

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

View File

@ -63,6 +63,12 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
icon="mdi:tshirt-crew",
translation_key="prewash",
),
HonConfigSwitchEntityDescription(
key="startProgram.prewash",
name="Prewash",
icon="mdi:tshirt-crew",
translation_key="prewash",
),
HonConfigSwitchEntityDescription(
key="startProgram.permanentPressStatus",
name="Keep Fresh",
@ -81,6 +87,18 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
icon="mdi:cup",
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(
key="startProgram.acquaplus",
name="Acqua Plus",
@ -117,6 +135,12 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
icon="mdi:lotion-plus",
translation_key="hygiene",
),
HonConfigSwitchEntityDescription(
key="startProgram.anticrease",
name="Anti-Crease",
icon="mdi:iron",
translation_key="anti_crease",
),
),
"TD": (
HonControlSwitchEntityDescription(
@ -138,7 +162,13 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
HonConfigSwitchEntityDescription(
key="startProgram.sterilizationStatus",
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(
key="startProgram.antiCreaseTime",
@ -370,10 +400,7 @@ async def async_setup_entry(
continue
entity = HonControlSwitchEntity(hass, entry, device, description)
elif isinstance(description, HonSwitchEntityDescription):
if (
f"settings.{description.key}" not in device.available_settings
or device.get(description.key) is None
):
if f"settings.{description.key}" not in device.available_settings:
continue
entity = HonSwitchEntity(hass, entry, device, description)
else:

View File

@ -29,7 +29,7 @@ Support has been confirmed for these models, but many more will work. Please add
| | **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 |
| **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 |

View File

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