diff --git a/homeassistant/components/group/light.py b/homeassistant/components/group/light.py index 00b7321076f..5720948bc01 100644 --- a/homeassistant/components/group/light.py +++ b/homeassistant/components/group/light.py @@ -88,8 +88,8 @@ class LightGroup(GroupEntity, light.LightEntity): self._brightness: Optional[int] = None self._hs_color: Optional[Tuple[float, float]] = None self._color_temp: Optional[int] = None - self._min_mireds: Optional[int] = 154 - self._max_mireds: Optional[int] = 500 + self._min_mireds: int = 154 + self._max_mireds: int = 500 self._white_value: Optional[int] = None self._effect_list: Optional[List[str]] = None self._effect: Optional[str] = None @@ -152,12 +152,12 @@ class LightGroup(GroupEntity, light.LightEntity): return self._color_temp @property - def min_mireds(self) -> Optional[int]: + def min_mireds(self) -> int: """Return the coldest color_temp that this light group supports.""" return self._min_mireds @property - def max_mireds(self) -> Optional[int]: + def max_mireds(self) -> int: """Return the warmest color_temp that this light group supports.""" return self._max_mireds diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 55476c754f2..4156736f74d 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -407,46 +407,46 @@ class LightEntity(ToggleEntity): """Representation of a light.""" @property - def brightness(self): + def brightness(self) -> Optional[int]: """Return the brightness of this light between 0..255.""" return None @property - def hs_color(self): + def hs_color(self) -> Optional[Tuple[float, float]]: """Return the hue and saturation color value [float, float].""" return None @property - def color_temp(self): + def color_temp(self) -> Optional[int]: """Return the CT color value in mireds.""" return None @property - def min_mireds(self): + def min_mireds(self) -> int: """Return the coldest color_temp that this light supports.""" # Default to the Philips Hue value that HA has always assumed # https://developers.meethue.com/documentation/core-concepts return 153 @property - def max_mireds(self): + def max_mireds(self) -> int: """Return the warmest color_temp that this light supports.""" # Default to the Philips Hue value that HA has always assumed # https://developers.meethue.com/documentation/core-concepts return 500 @property - def white_value(self): + def white_value(self) -> Optional[int]: """Return the white value of this light between 0..255.""" return None @property - def effect_list(self): + def effect_list(self) -> Optional[List[str]]: """Return the list of supported effects.""" return None @property - def effect(self): + def effect(self) -> Optional[str]: """Return the current effect.""" return None @@ -495,7 +495,7 @@ class LightEntity(ToggleEntity): return {key: val for key, val in data.items() if val is not None} @property - def supported_features(self): + def supported_features(self) -> int: """Flag supported features.""" return 0 diff --git a/homeassistant/components/zwave_js/light.py b/homeassistant/components/zwave_js/light.py index b501ecb58e7..d66821c9ba3 100644 --- a/homeassistant/components/zwave_js/light.py +++ b/homeassistant/components/zwave_js/light.py @@ -151,7 +151,7 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity): return self._max_mireds @property - def supported_features(self) -> Optional[int]: + def supported_features(self) -> int: """Flag supported features.""" return self._supported_features diff --git a/homeassistant/util/color.py b/homeassistant/util/color.py index 4a9162707fa..36bf47aaf96 100644 --- a/homeassistant/util/color.py +++ b/homeassistant/util/color.py @@ -508,12 +508,12 @@ def _get_blue(temperature: float) -> float: return _bound(blue) -def color_temperature_mired_to_kelvin(mired_temperature: float) -> float: +def color_temperature_mired_to_kelvin(mired_temperature: float) -> int: """Convert absolute mired shift to degrees kelvin.""" return math.floor(1000000 / mired_temperature) -def color_temperature_kelvin_to_mired(kelvin_temperature: float) -> float: +def color_temperature_kelvin_to_mired(kelvin_temperature: float) -> int: """Convert degrees kelvin to mired shift.""" return math.floor(1000000 / kelvin_temperature)