diff --git a/homeassistant/components/blebox/light.py b/homeassistant/components/blebox/light.py index 75900ca7d97..4db64d998f5 100644 --- a/homeassistant/components/blebox/light.py +++ b/homeassistant/components/blebox/light.py @@ -74,7 +74,7 @@ class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity): return self._feature.is_on @property - def brightness(self): + def brightness(self) -> int | None: """Return the name.""" return self._feature.brightness diff --git a/homeassistant/components/control4/light.py b/homeassistant/components/control4/light.py index 2b4d6e7b45e..2e9528063d1 100644 --- a/homeassistant/components/control4/light.py +++ b/homeassistant/components/control4/light.py @@ -199,7 +199,7 @@ class Control4Light(Control4Entity, LightEntity): return self.coordinator.data[self._idx][CONTROL4_NON_DIMMER_VAR] > 0 @property - def brightness(self): + def brightness(self) -> int | None: """Return the brightness of this light between 0..255.""" if self._is_dimmer: for var in CONTROL4_DIMMER_VARS: diff --git a/homeassistant/components/decora_wifi/light.py b/homeassistant/components/decora_wifi/light.py index cf17b613416..4ec9a1e4246 100644 --- a/homeassistant/components/decora_wifi/light.py +++ b/homeassistant/components/decora_wifi/light.py @@ -132,7 +132,7 @@ class DecoraWifiLight(LightEntity): return self._switch.serial @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of the dimmer switch.""" return int(self._switch.brightness * 255 / 100) diff --git a/homeassistant/components/eufy/light.py b/homeassistant/components/eufy/light.py index d782dadba6c..48ba97c01df 100644 --- a/homeassistant/components/eufy/light.py +++ b/homeassistant/components/eufy/light.py @@ -75,7 +75,7 @@ class EufyHomeLight(LightEntity): self._attr_is_on = self._bulb.power @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return int(self._brightness * 255 / 100) @@ -88,7 +88,7 @@ class EufyHomeLight(LightEntity): ) @property - def hs_color(self): + def hs_color(self) -> tuple[float, float] | None: """Return the color of this light.""" return self._hs diff --git a/homeassistant/components/iglo/light.py b/homeassistant/components/iglo/light.py index 1989bcd8ecc..3fb09f0eac6 100644 --- a/homeassistant/components/iglo/light.py +++ b/homeassistant/components/iglo/light.py @@ -68,7 +68,7 @@ class IGloLamp(LightEntity): return self._name @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return int((self._lamp.state()["brightness"] / 200.0) * 255) @@ -97,17 +97,17 @@ class IGloLamp(LightEntity): return self._lamp.min_kelvin @property - def hs_color(self): + def hs_color(self) -> tuple[float, float]: """Return the hs value.""" return color_util.color_RGB_to_hs(*self._lamp.state()["rgb"]) @property - def effect(self): + def effect(self) -> str: """Return the current effect.""" return self._lamp.state()["effect"] @property - def effect_list(self): + def effect_list(self) -> list[str]: """Return the list of supported effects.""" return self._lamp.effect_list() diff --git a/homeassistant/components/insteon/light.py b/homeassistant/components/insteon/light.py index e4f09fe5689..c617f7c5592 100644 --- a/homeassistant/components/insteon/light.py +++ b/homeassistant/components/insteon/light.py @@ -61,7 +61,7 @@ class InsteonDimmerEntity(InsteonEntity, LightEntity): self._attr_supported_color_modes = {ColorMode.ONOFF} @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return self._insteon_device_group.value diff --git a/homeassistant/components/osramlightify/light.py b/homeassistant/components/osramlightify/light.py index a55ed36518c..8dad03d4bba 100644 --- a/homeassistant/components/osramlightify/light.py +++ b/homeassistant/components/osramlightify/light.py @@ -244,7 +244,7 @@ class Luminary(LightEntity): return self._luminary.name() @property - def hs_color(self): + def hs_color(self) -> tuple[float, float]: """Return last hs color value set.""" return color_util.color_RGB_to_hs(*self._rgb_color) diff --git a/homeassistant/components/pilight/light.py b/homeassistant/components/pilight/light.py index 9e1ecbf59d4..dd10cb12266 100644 --- a/homeassistant/components/pilight/light.py +++ b/homeassistant/components/pilight/light.py @@ -62,7 +62,7 @@ class PilightLight(PilightBaseDevice, LightEntity): self._dimlevel_max = config.get(CONF_DIMLEVEL_MAX) @property - def brightness(self): + def brightness(self) -> int | None: """Return the brightness.""" return self._brightness diff --git a/homeassistant/components/qwikswitch/light.py b/homeassistant/components/qwikswitch/light.py index 0f91faeedc8..9de959d7009 100644 --- a/homeassistant/components/qwikswitch/light.py +++ b/homeassistant/components/qwikswitch/light.py @@ -30,7 +30,7 @@ class QSLight(QSToggleEntity, LightEntity): """Light based on a Qwikswitch relay/dimmer module.""" @property - def brightness(self): + def brightness(self) -> int | None: """Return the brightness of this light (0-255).""" return self.device.value if self.device.is_dimmer else None diff --git a/homeassistant/components/rflink/light.py b/homeassistant/components/rflink/light.py index 7eb53433d88..24bbf06c049 100644 --- a/homeassistant/components/rflink/light.py +++ b/homeassistant/components/rflink/light.py @@ -226,7 +226,7 @@ class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity): self._state = True @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return self._brightness diff --git a/homeassistant/components/sisyphus/light.py b/homeassistant/components/sisyphus/light.py index 9a649c0b645..c89d8d11d54 100644 --- a/homeassistant/components/sisyphus/light.py +++ b/homeassistant/components/sisyphus/light.py @@ -78,7 +78,7 @@ class SisyphusLight(LightEntity): return not self._table.is_sleeping @property - def brightness(self): + def brightness(self) -> int: """Return the current brightness of the table's ring light.""" return self._table.brightness * 255 diff --git a/homeassistant/components/smarttub/light.py b/homeassistant/components/smarttub/light.py index 0c58460640d..42c644fddd4 100644 --- a/homeassistant/components/smarttub/light.py +++ b/homeassistant/components/smarttub/light.py @@ -65,7 +65,7 @@ class SmartTubLight(SmartTubEntity, LightEntity): return self.coordinator.data[self.spa.id][ATTR_LIGHTS][self.light_zone] @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" # SmartTub intensity is 0..100 @@ -87,7 +87,7 @@ class SmartTubLight(SmartTubEntity, LightEntity): return self.light.mode != SpaLight.LightMode.OFF @property - def effect(self): + def effect(self) -> str | None: """Return the current effect.""" mode = self.light.mode.name.lower() if mode in self.effect_list: @@ -95,7 +95,7 @@ class SmartTubLight(SmartTubEntity, LightEntity): return None @property - def effect_list(self): + def effect_list(self) -> list[str]: """Return the list of supported effects.""" return [ effect diff --git a/homeassistant/components/tellduslive/light.py b/homeassistant/components/tellduslive/light.py index 4a3c14b141b..86fdb4d1d64 100644 --- a/homeassistant/components/tellduslive/light.py +++ b/homeassistant/components/tellduslive/light.py @@ -53,7 +53,7 @@ class TelldusLiveLight(TelldusLiveEntity, LightEntity): self.schedule_update_ha_state() @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return self.device.dim_level diff --git a/homeassistant/components/tellstick/light.py b/homeassistant/components/tellstick/light.py index 72ff8e4df05..4b335f69558 100644 --- a/homeassistant/components/tellstick/light.py +++ b/homeassistant/components/tellstick/light.py @@ -52,7 +52,7 @@ class TellstickLight(TellstickDevice, LightEntity): self._brightness = 255 @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return self._brightness diff --git a/homeassistant/components/xiaomi_aqara/light.py b/homeassistant/components/xiaomi_aqara/light.py index 47b9e5a6730..585ab39ba6b 100644 --- a/homeassistant/components/xiaomi_aqara/light.py +++ b/homeassistant/components/xiaomi_aqara/light.py @@ -91,12 +91,12 @@ class XiaomiGatewayLight(XiaomiDevice, LightEntity): return True @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return int(255 * self._brightness / 100) @property - def hs_color(self): + def hs_color(self) -> tuple[float, float]: """Return the hs color value.""" return self._hs diff --git a/homeassistant/components/xiaomi_miio/light.py b/homeassistant/components/xiaomi_miio/light.py index 0ff6df93d3e..4c08dae6f52 100644 --- a/homeassistant/components/xiaomi_miio/light.py +++ b/homeassistant/components/xiaomi_miio/light.py @@ -1041,12 +1041,12 @@ class XiaomiGatewayLight(LightEntity): ) @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of this light between 0..255.""" return int(255 * self._brightness_pct / 100) @property - def hs_color(self): + def hs_color(self) -> tuple[float, float]: """Return the hs color value.""" return self._hs @@ -1102,7 +1102,7 @@ class XiaomiGatewayBulb(XiaomiGatewayDevice, LightEntity): _sub_device: LightBulb @property - def brightness(self): + def brightness(self) -> int: """Return the brightness of the light.""" return round((self._sub_device.status["brightness"] * 255) / 100)