diff --git a/homeassistant/components/devolo_home_control/binary_sensor.py b/homeassistant/components/devolo_home_control/binary_sensor.py index 645850ee9d7..a6b18c2b312 100644 --- a/homeassistant/components/devolo_home_control/binary_sensor.py +++ b/homeassistant/components/devolo_home_control/binary_sensor.py @@ -66,9 +66,9 @@ class DevoloBinaryDeviceEntity(DevoloDeviceEntity, BinarySensorEntity): self, homecontrol: HomeControl, device_instance: Zwave, element_uid: str ) -> None: """Initialize a devolo binary sensor.""" - self._binary_sensor_property = device_instance.binary_sensor_property.get( + self._binary_sensor_property = device_instance.binary_sensor_property[ element_uid - ) + ] super().__init__( homecontrol=homecontrol, @@ -82,10 +82,12 @@ class DevoloBinaryDeviceEntity(DevoloDeviceEntity, BinarySensorEntity): ) if self._attr_device_class is None: - if device_instance.binary_sensor_property.get(element_uid).sub_type != "": - self._attr_name += f" {device_instance.binary_sensor_property.get(element_uid).sub_type}" + if device_instance.binary_sensor_property[element_uid].sub_type != "": + self._attr_name += ( + f" {device_instance.binary_sensor_property[element_uid].sub_type}" + ) else: - self._attr_name += f" {device_instance.binary_sensor_property.get(element_uid).sensor_type}" + self._attr_name += f" {device_instance.binary_sensor_property[element_uid].sensor_type}" self._value = self._binary_sensor_property.state @@ -114,9 +116,9 @@ class DevoloRemoteControl(DevoloDeviceEntity, BinarySensorEntity): key: int, ) -> None: """Initialize a devolo remote control.""" - self._remote_control_property = device_instance.remote_control_property.get( + self._remote_control_property = device_instance.remote_control_property[ element_uid - ) + ] super().__init__( homecontrol=homecontrol, diff --git a/homeassistant/components/devolo_home_control/cover.py b/homeassistant/components/devolo_home_control/cover.py index 363237ec24c..a23c3fde585 100644 --- a/homeassistant/components/devolo_home_control/cover.py +++ b/homeassistant/components/devolo_home_control/cover.py @@ -63,7 +63,7 @@ class DevoloCoverDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, CoverEntity): @property def current_cover_position(self) -> int: """Return the current position. 0 is closed. 100 is open.""" - return self._value + return int(self._value) @property def is_closed(self) -> bool: diff --git a/homeassistant/components/devolo_home_control/devolo_device.py b/homeassistant/components/devolo_home_control/devolo_device.py index f4f2432aa6e..b3cb68098e1 100644 --- a/homeassistant/components/devolo_home_control/devolo_device.py +++ b/homeassistant/components/devolo_home_control/devolo_device.py @@ -46,7 +46,7 @@ class DevoloDeviceEntity(Entity): self.subscriber: Subscriber | None = None self.sync_callback = self._sync - self._value: int + self._value: float async def async_added_to_hass(self) -> None: """Call when entity is added to hass.""" diff --git a/homeassistant/components/devolo_home_control/manifest.json b/homeassistant/components/devolo_home_control/manifest.json index e9076e3d3da..75cca12d99e 100644 --- a/homeassistant/components/devolo_home_control/manifest.json +++ b/homeassistant/components/devolo_home_control/manifest.json @@ -2,7 +2,7 @@ "domain": "devolo_home_control", "name": "devolo Home Control", "documentation": "https://www.home-assistant.io/integrations/devolo_home_control", - "requirements": ["devolo-home-control-api==0.17.4"], + "requirements": ["devolo-home-control-api==0.18.1"], "after_dependencies": ["zeroconf"], "config_flow": true, "codeowners": ["@2Fake", "@Shutgun"], diff --git a/homeassistant/components/devolo_home_control/sensor.py b/homeassistant/components/devolo_home_control/sensor.py index 446f41a646b..2d023d23e2d 100644 --- a/homeassistant/components/devolo_home_control/sensor.py +++ b/homeassistant/components/devolo_home_control/sensor.py @@ -83,7 +83,7 @@ class DevoloMultiLevelDeviceEntity(DevoloDeviceEntity, SensorEntity): """Abstract representation of a multi level sensor within devolo Home Control.""" @property - def native_value(self) -> int: + def native_value(self) -> float: """Return the state of the sensor.""" return self._value diff --git a/homeassistant/components/devolo_home_control/siren.py b/homeassistant/components/devolo_home_control/siren.py index 20318f87a6d..216ab4ab296 100644 --- a/homeassistant/components/devolo_home_control/siren.py +++ b/homeassistant/components/devolo_home_control/siren.py @@ -54,8 +54,8 @@ class DevoloSirenDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, SirenEntity): ) self._attr_available_tones = [ *range( - self._multi_level_switch_property.min, - self._multi_level_switch_property.max + 1, + int(self._multi_level_switch_property.min), + int(self._multi_level_switch_property.max) + 1, ) ] self._default_tone = device_instance.settings_property["tone"].tone diff --git a/homeassistant/components/devolo_home_control/switch.py b/homeassistant/components/devolo_home_control/switch.py index 4896d66b805..24b1d3545de 100644 --- a/homeassistant/components/devolo_home_control/switch.py +++ b/homeassistant/components/devolo_home_control/switch.py @@ -50,9 +50,9 @@ class DevoloSwitch(DevoloDeviceEntity, SwitchEntity): device_instance=device_instance, element_uid=element_uid, ) - self._binary_switch_property = self._device_instance.binary_switch_property.get( - self._attr_unique_id - ) + self._binary_switch_property = self._device_instance.binary_switch_property[ + self._attr_unique_id # type: ignore[index] + ] self._attr_is_on = self._binary_switch_property.state def turn_on(self, **kwargs: Any) -> None: diff --git a/requirements_all.txt b/requirements_all.txt index a795c494a12..0451bee97f9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -530,7 +530,7 @@ deluge-client==1.7.1 denonavr==0.10.10 # homeassistant.components.devolo_home_control -devolo-home-control-api==0.17.4 +devolo-home-control-api==0.18.1 # homeassistant.components.devolo_home_network devolo-plc-api==0.7.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b43f6e3e602..3c9e172f79a 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -385,7 +385,7 @@ deluge-client==1.7.1 denonavr==0.10.10 # homeassistant.components.devolo_home_control -devolo-home-control-api==0.17.4 +devolo-home-control-api==0.18.1 # homeassistant.components.devolo_home_network devolo-plc-api==0.7.1