diff --git a/homeassistant/components/insteon/insteon_entity.py b/homeassistant/components/insteon/insteon_entity.py index 719b58a3d9f..d8fd9b2cbc9 100644 --- a/homeassistant/components/insteon/insteon_entity.py +++ b/homeassistant/components/insteon/insteon_entity.py @@ -75,7 +75,10 @@ class InsteonEntity(Entity): @property def extra_state_attributes(self): """Provide attributes for display on device card.""" - return {"insteon_address": self.address, "insteon_group": self.group} + return { + "insteon_address": self.address, + "insteon_group": self.group, + } @property def device_info(self) -> DeviceInfo: @@ -148,6 +151,13 @@ class InsteonEntity(Entity): """Print the device ALDB to the log file.""" print_aldb_to_log(self._insteon_device.aldb) + def get_device_property(self, name: str): + """Get a single Insteon device property value (raw).""" + value = None + if (prop := self._insteon_device.properties.get(name)) is not None: + value = prop.value if prop.new_value is None else prop.new_value + return value + def _get_label(self): """Get the device label for grouped devices.""" label = "" diff --git a/homeassistant/components/insteon/light.py b/homeassistant/components/insteon/light.py index 206aa078dc3..e8b95598fb8 100644 --- a/homeassistant/components/insteon/light.py +++ b/homeassistant/components/insteon/light.py @@ -1,5 +1,7 @@ """Support for Insteon lights via PowerLinc Modem.""" +from pyinsteon.extended_property import ON_LEVEL + from homeassistant.components.light import ( ATTR_BRIGHTNESS, DOMAIN as LIGHT_DOMAIN, @@ -53,6 +55,9 @@ class InsteonDimmerEntity(InsteonEntity, LightEntity): """Turn light on.""" if ATTR_BRIGHTNESS in kwargs: brightness = int(kwargs[ATTR_BRIGHTNESS]) + else: + brightness = self.get_device_property(ON_LEVEL) + if brightness is not None: await self._insteon_device.async_on( on_level=brightness, group=self._insteon_device_group.group )