diff --git a/README.md b/README.md index 38821ba..b3f1a11 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ Support has been confirmed for these models, but many more will work. Please add | | **Haier** | **Hoover** | **Candy** | |---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| -| **Washing Machine** | HW80-B14959TU1DE
HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S
HLWPS495TAMBE-11
HW 410AMBCB/1-80 | CO4 107T1/2-07
CBWO49TWME-S
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | -| **Tumble Dryer** | HD80-A3959 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
H5WPB447AMBC/1-S
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | +| **Washing Machine** | HW80-B14959TU1DE
HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S
HLWPS495TAMBE-11
HW 410AMBCB/1-80 | CO4 107T1/2-07
CBWO49TWME-S
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | +| **Tumble Dryer** | HD80-A3959
HD90-A3TEAM5 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
H5WPB447AMBC/1-S
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | | **Washer Dryer** | HWD100-B14979 | HDQ 496AMBS/1-S
HWPS4954DAMR-11 | RPW41066BWMR/1-S | | **Oven** | HWO60SM2F3XH | HSOT3161WG | | | **Dish Washer** | XIB 3B2SFS-80
XIB 6B2D3FB | HFB 6B2S3FX | | diff --git a/custom_components/hon/__init__.py b/custom_components/hon/__init__.py index a684d3c..e95e3b8 100644 --- a/custom_components/hon/__init__.py +++ b/custom_components/hon/__init__.py @@ -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: diff --git a/custom_components/hon/climate.py b/custom_components/hon/climate.py index 095d27d..5731462 100644 --- a/custom_components/hon/climate.py +++ b/custom_components/hon/climate.py @@ -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 diff --git a/custom_components/hon/light.py b/custom_components/hon/light.py index ca0815a..f7aa870 100644 --- a/custom_components/hon/light.py +++ b/custom_components/hon/light.py @@ -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) diff --git a/custom_components/hon/manifest.json b/custom_components/hon/manifest.json index a53ca1e..331c7de 100644 --- a/custom_components/hon/manifest.json +++ b/custom_components/hon/manifest.json @@ -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" } diff --git a/custom_components/hon/typedefs.py b/custom_components/hon/typedefs.py index 4410488..5456396 100644 --- a/custom_components/hon/typedefs.py +++ b/custom_components/hon/typedefs.py @@ -1,94 +1,95 @@ -from typing import Union, TypeVar +from typing import Union, TypeVar, TYPE_CHECKING -from homeassistant.components.button import ButtonEntityDescription -from homeassistant.components.fan import FanEntityDescription -from homeassistant.components.light import LightEntityDescription -from homeassistant.components.lock import LockEntityDescription -from homeassistant.components.number import NumberEntityDescription -from homeassistant.components.select import SelectEntityDescription -from homeassistant.components.sensor import SensorEntityDescription -from homeassistant.components.switch import SwitchEntityDescription +if TYPE_CHECKING: + from homeassistant.components.button import ButtonEntityDescription + from homeassistant.components.fan import FanEntityDescription + from homeassistant.components.light import LightEntityDescription + from homeassistant.components.lock import LockEntityDescription + from homeassistant.components.number import NumberEntityDescription + from homeassistant.components.select import SelectEntityDescription + from homeassistant.components.sensor import SensorEntityDescription + from homeassistant.components.switch import SwitchEntityDescription -from .binary_sensor import HonBinarySensorEntityDescription -from .button import HonButtonEntity, HonDataArchive, HonDeviceInfo -from .climate import ( - HonACClimateEntityDescription, - HonClimateEntityDescription, -) -from .number import ( - HonConfigNumberEntityDescription, - HonNumberEntityDescription, -) -from .select import ( - HonConfigSelectEntityDescription, - HonSelectEntityDescription, -) -from .sensor import ( - HonSensorEntityDescription, - HonConfigSensorEntityDescription, -) -from .switch import ( - HonControlSwitchEntityDescription, - HonSwitchEntityDescription, - HonConfigSwitchEntityDescription, -) + from .binary_sensor import HonBinarySensorEntityDescription + from .button import HonButtonEntity, HonDataArchive, HonDeviceInfo + from .climate import ( + HonACClimateEntityDescription, + HonClimateEntityDescription, + ) + from .number import ( + HonConfigNumberEntityDescription, + HonNumberEntityDescription, + ) + from .select import ( + HonConfigSelectEntityDescription, + HonSelectEntityDescription, + ) + from .sensor import ( + HonSensorEntityDescription, + HonConfigSensorEntityDescription, + ) + from .switch import ( + HonControlSwitchEntityDescription, + HonSwitchEntityDescription, + HonConfigSwitchEntityDescription, + ) 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", ) diff --git a/info.md b/info.md index 76ac925..8882b4c 100644 --- a/info.md +++ b/info.md @@ -29,8 +29,8 @@ Support has been confirmed for these models, but many more will work. Please add | | **Haier** | **Hoover** | **Candy** | |---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| -| **Washing Machine** | HW80-B14959TU1DE
HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S
HLWPS495TAMBE-11
HW 410AMBCB/1-80 | CO4 107T1/2-07
CBWO49TWME-S
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | -| **Tumble Dryer** | HD80-A3959 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
H5WPB447AMBC/1-S
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | +| **Washing Machine** | HW80-B14959TU1DE
HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S
HLWPS495TAMBE-11
HW 410AMBCB/1-80 | CO4 107T1/2-07
CBWO49TWME-S
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | +| **Tumble Dryer** | HD80-A3959
HD90-A3TEAM5 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
H5WPB447AMBC/1-S
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | | **Washer Dryer** | HWD100-B14979 | HDQ 496AMBS/1-S
HWPS4954DAMR-11 | RPW41066BWMR/1-S | | **Oven** | HWO60SM2F3XH | HSOT3161WG | | | **Dish Washer** | XIB 3B2SFS-80
XIB 6B2D3FB | HFB 6B2S3FX | |