Fix issues from refactoring

This commit is contained in:
Andre Basche 2023-07-24 21:37:48 +02:00
parent 2acc6225c4
commit 3924c6ed77
7 changed files with 90 additions and 89 deletions

View file

@ -41,7 +41,7 @@ Support has been confirmed for these models, but many more will work. Please add
| | **Haier** | **Hoover** | **Candy** |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| **Washing Machine** | HW80-B14959TU1DE <br/> HW90-B14TEAM5 <br/> HW100-B14959U1 | H-WASH 500 <br/> H7W4 48MBC-S <br/> HLWPS495TAMBE-11 <br/> HW 410AMBCB/1-80 | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO44 1286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S |
| **Tumble Dryer** | HD80-A3959 | 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 |
| **Tumble Dryer** | HD80-A3959 <br/> HD90-A3TEAM5 | 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 |
| **Washer Dryer** | HWD100-B14979 | HDQ 496AMBS/1-S <br/> HWPS4954DAMR-11 | RPW41066BWMR/1-S |
| **Oven** | HWO60SM2F3XH | HSOT3161WG | |
| **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | |

View file

@ -25,7 +25,7 @@ CONFIG_SCHEMA = vol.Schema(
)
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> None:
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
session = aiohttp_client.async_get_clientsession(hass)
if (config_dir := hass.config.config_dir) is None:
raise ValueError("Missing Config Dir")
@ -43,7 +43,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> None
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, platform)
)
return
return True
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:

View file

@ -155,7 +155,7 @@ class HonACClimateEntity(HonEntity, ClimateEntity):
self._handle_coordinator_update(update=False)
def _set_temperature_bound(self) -> None:
temperature = self._device.settings[self.entity_description.key]
temperature = self._device.settings["settings.tempSel"]
if not isinstance(temperature, HonParameterRange):
raise ValueError
self._attr_max_temp = temperature.max

View file

@ -72,7 +72,7 @@ class HonLightEntity(HonEntity, LightEntity):
device: HonAppliance,
description: LightEntityDescription,
) -> None:
light = self._device.settings.get(self.entity_description.key)
light = device.settings.get(description.key)
if not isinstance(light, HonParameterRange):
raise ValueError()
self._light_range = (light.min, light.max)

View file

@ -9,7 +9,7 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/Andre0512/hon/issues",
"requirements": [
"pyhOn==0.14.10"
"pyhOn==0.15.5"
],
"version": "0.9.1-beta.1"
"version": "0.9.1"
}

View file

@ -1,5 +1,6 @@
from typing import Union, TypeVar
from typing import Union, TypeVar, TYPE_CHECKING
if TYPE_CHECKING:
from homeassistant.components.button import ButtonEntityDescription
from homeassistant.components.fan import FanEntityDescription
from homeassistant.components.light import LightEntityDescription
@ -34,61 +35,61 @@ from .switch import (
)
HonButtonType = Union[
HonButtonEntity,
HonDataArchive,
HonDeviceInfo,
"HonButtonEntity",
"HonDataArchive",
"HonDeviceInfo",
]
HonEntityDescription = Union[
HonBinarySensorEntityDescription,
HonControlSwitchEntityDescription,
HonSwitchEntityDescription,
HonConfigSwitchEntityDescription,
HonSensorEntityDescription,
HonConfigSelectEntityDescription,
HonConfigNumberEntityDescription,
HonACClimateEntityDescription,
HonClimateEntityDescription,
HonNumberEntityDescription,
HonSelectEntityDescription,
HonConfigSensorEntityDescription,
FanEntityDescription,
LightEntityDescription,
LockEntityDescription,
ButtonEntityDescription,
SwitchEntityDescription,
SensorEntityDescription,
SelectEntityDescription,
NumberEntityDescription,
"HonBinarySensorEntityDescription",
"HonControlSwitchEntityDescription",
"HonSwitchEntityDescription",
"HonConfigSwitchEntityDescription",
"HonSensorEntityDescription",
"HonConfigSelectEntityDescription",
"HonConfigNumberEntityDescription",
"HonACClimateEntityDescription",
"HonClimateEntityDescription",
"HonNumberEntityDescription",
"HonSelectEntityDescription",
"HonConfigSensorEntityDescription",
"FanEntityDescription",
"LightEntityDescription",
"LockEntityDescription",
"ButtonEntityDescription",
"SwitchEntityDescription",
"SensorEntityDescription",
"SelectEntityDescription",
"NumberEntityDescription",
]
HonOptionEntityDescription = Union[
HonConfigSelectEntityDescription,
HonSelectEntityDescription,
HonConfigSensorEntityDescription,
HonSensorEntityDescription,
"HonConfigSelectEntityDescription",
"HonSelectEntityDescription",
"HonConfigSensorEntityDescription",
"HonSensorEntityDescription",
]
T = TypeVar(
"T",
HonBinarySensorEntityDescription,
HonControlSwitchEntityDescription,
HonSwitchEntityDescription,
HonConfigSwitchEntityDescription,
HonSensorEntityDescription,
HonConfigSelectEntityDescription,
HonConfigNumberEntityDescription,
HonACClimateEntityDescription,
HonClimateEntityDescription,
HonNumberEntityDescription,
HonSelectEntityDescription,
HonConfigSensorEntityDescription,
FanEntityDescription,
LightEntityDescription,
LockEntityDescription,
ButtonEntityDescription,
SwitchEntityDescription,
SensorEntityDescription,
SelectEntityDescription,
NumberEntityDescription,
"HonBinarySensorEntityDescription",
"HonControlSwitchEntityDescription",
"HonSwitchEntityDescription",
"HonConfigSwitchEntityDescription",
"HonSensorEntityDescription",
"HonConfigSelectEntityDescription",
"HonConfigNumberEntityDescription",
"HonACClimateEntityDescription",
"HonClimateEntityDescription",
"HonNumberEntityDescription",
"HonSelectEntityDescription",
"HonConfigSensorEntityDescription",
"FanEntityDescription",
"LightEntityDescription",
"LockEntityDescription",
"ButtonEntityDescription",
"SwitchEntityDescription",
"SensorEntityDescription",
"SelectEntityDescription",
"NumberEntityDescription",
)

View file

@ -30,7 +30,7 @@ Support has been confirmed for these models, but many more will work. Please add
| | **Haier** | **Hoover** | **Candy** |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| **Washing Machine** | HW80-B14959TU1DE <br/> HW90-B14TEAM5 <br/> HW100-B14959U1 | H-WASH 500 <br/> H7W4 48MBC-S <br/> HLWPS495TAMBE-11 <br/> HW 410AMBCB/1-80 | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO44 1286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S |
| **Tumble Dryer** | HD80-A3959 | 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 |
| **Tumble Dryer** | HD80-A3959 <br/> HD90-A3TEAM5 | 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 |
| **Washer Dryer** | HWD100-B14979 | HDQ 496AMBS/1-S <br/> HWPS4954DAMR-11 | RPW41066BWMR/1-S |
| **Oven** | HWO60SM2F3XH | HSOT3161WG | |
| **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | |