diff --git a/homeassistant/components/ads/light.py b/homeassistant/components/ads/light.py index a4ec970ee15..8dd55775b7a 100644 --- a/homeassistant/components/ads/light.py +++ b/homeassistant/components/ads/light.py @@ -1,6 +1,8 @@ """Support for ADS light sources.""" from __future__ import annotations +from typing import Any + import pyads import voluptuous as vol @@ -66,7 +68,7 @@ class AdsLight(AdsEntity, LightEntity): self._attr_color_mode = ColorMode.ONOFF self._attr_supported_color_modes = {ColorMode.ONOFF} - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register device notification.""" await self.async_initialize_device(self._ads_var, pyads.PLCTYPE_BOOL) @@ -87,7 +89,7 @@ class AdsLight(AdsEntity, LightEntity): """Return True if the entity is on.""" return self._state_dict[STATE_KEY_STATE] - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the light on or set a specific dimmer value.""" brightness = kwargs.get(ATTR_BRIGHTNESS) self._ads_hub.write_by_name(self._ads_var, True, pyads.PLCTYPE_BOOL) @@ -97,6 +99,6 @@ class AdsLight(AdsEntity, LightEntity): self._ads_var_brightness, brightness, pyads.PLCTYPE_UINT ) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" self._ads_hub.write_by_name(self._ads_var, False, pyads.PLCTYPE_BOOL) diff --git a/homeassistant/components/avea/light.py b/homeassistant/components/avea/light.py index 31054e2e287..5b306b058d3 100644 --- a/homeassistant/components/avea/light.py +++ b/homeassistant/components/avea/light.py @@ -1,6 +1,8 @@ """Support for the Elgato Avea lights.""" from __future__ import annotations +from typing import Any + import avea # pylint: disable=import-error from homeassistant.components.light import ( @@ -46,7 +48,7 @@ class AveaLight(LightEntity): self._attr_name = light.name self._attr_brightness = light.brightness - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Instruct the light to turn on.""" if not kwargs: self._light.set_brightness(4095) @@ -58,11 +60,11 @@ class AveaLight(LightEntity): rgb = color_util.color_hs_to_RGB(*kwargs[ATTR_HS_COLOR]) self._light.set_rgb(rgb[0], rgb[1], rgb[2]) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Instruct the light to turn off.""" self._light.set_brightness(0) - def update(self): + def update(self) -> None: """Fetch new state data for this light. This is the only method that should fetch new data for Home Assistant. diff --git a/homeassistant/components/avion/light.py b/homeassistant/components/avion/light.py index 7df17c2e74e..54d06d50a60 100644 --- a/homeassistant/components/avion/light.py +++ b/homeassistant/components/avion/light.py @@ -3,6 +3,7 @@ from __future__ import annotations import importlib import time +from typing import Any import voluptuous as vol @@ -103,7 +104,7 @@ class AvionLight(LightEntity): self._switch.connect() return True - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the specified or all lights on.""" if (brightness := kwargs.get(ATTR_BRIGHTNESS)) is not None: self._attr_brightness = brightness @@ -111,7 +112,7 @@ class AvionLight(LightEntity): self.set_state(self.brightness) self._attr_is_on = True - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the specified or all lights off.""" self.set_state(0) self._attr_is_on = False diff --git a/homeassistant/components/broadlink/light.py b/homeassistant/components/broadlink/light.py index 4b655e4bd42..c4dd48b7dc0 100644 --- a/homeassistant/components/broadlink/light.py +++ b/homeassistant/components/broadlink/light.py @@ -1,5 +1,6 @@ """Support for Broadlink lights.""" import logging +from typing import Any from broadlink.exceptions import BroadlinkException @@ -88,7 +89,7 @@ class BroadlinkLight(BroadlinkEntity, LightEntity): # Scenes are not yet supported. self._attr_color_mode = ColorMode.UNKNOWN - async def async_turn_on(self, **kwargs): + async def async_turn_on(self, **kwargs: Any) -> None: """Turn on the light.""" state = {"pwr": 1} @@ -122,7 +123,7 @@ class BroadlinkLight(BroadlinkEntity, LightEntity): await self._async_set_state(state) - async def async_turn_off(self, **kwargs): + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the light.""" await self._async_set_state({"pwr": 0}) diff --git a/homeassistant/components/control4/light.py b/homeassistant/components/control4/light.py index ded72944af7..539547a79f1 100644 --- a/homeassistant/components/control4/light.py +++ b/homeassistant/components/control4/light.py @@ -4,6 +4,7 @@ from __future__ import annotations import asyncio from datetime import timedelta import logging +from typing import Any from pyControl4.error_handling import C4Exception from pyControl4.light import C4Light @@ -197,7 +198,7 @@ class Control4Light(Control4Entity, LightEntity): return LightEntityFeature.TRANSITION return 0 - async def async_turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs: Any) -> None: """Turn the entity on.""" c4_light = self.create_api_object() if self._is_dimmer: @@ -220,7 +221,7 @@ class Control4Light(Control4Entity, LightEntity): await asyncio.sleep(delay_time) await self.coordinator.async_request_refresh() - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the entity off.""" c4_light = self.create_api_object() if self._is_dimmer: diff --git a/homeassistant/components/decora_wifi/light.py b/homeassistant/components/decora_wifi/light.py index 7d3b1e353e2..3c43e816097 100644 --- a/homeassistant/components/decora_wifi/light.py +++ b/homeassistant/components/decora_wifi/light.py @@ -2,6 +2,7 @@ from __future__ import annotations import logging +from typing import Any # pylint: disable=import-error from decora_wifi import DecoraWiFiSession @@ -111,7 +112,7 @@ class DecoraWifiLight(LightEntity): return {self.color_mode} @property - def supported_features(self): + def supported_features(self) -> int: """Return supported features.""" if self._switch.canSetLevel: return LightEntityFeature.TRANSITION @@ -137,9 +138,9 @@ class DecoraWifiLight(LightEntity): """Return true if switch is on.""" return self._switch.power == "ON" - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Instruct the switch to turn on & adjust brightness.""" - attribs = {"power": "ON"} + attribs: dict[str, Any] = {"power": "ON"} if ATTR_BRIGHTNESS in kwargs: min_level = self._switch.data.get("minLevel", 0) @@ -157,7 +158,7 @@ class DecoraWifiLight(LightEntity): except ValueError: _LOGGER.error("Failed to turn on myLeviton switch") - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Instruct the switch to turn off.""" attribs = {"power": "OFF"} try: @@ -165,7 +166,7 @@ class DecoraWifiLight(LightEntity): except ValueError: _LOGGER.error("Failed to turn off myLeviton switch") - def update(self): + def update(self) -> None: """Fetch new state data for this switch.""" try: self._switch.refresh() diff --git a/homeassistant/components/dynalite/light.py b/homeassistant/components/dynalite/light.py index 826506fa9b7..27cd6f8cae8 100644 --- a/homeassistant/components/dynalite/light.py +++ b/homeassistant/components/dynalite/light.py @@ -1,5 +1,7 @@ """Support for Dynalite channels as lights.""" +from typing import Any + from homeassistant.components.light import ColorMode, LightEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant @@ -35,10 +37,10 @@ class DynaliteLight(DynaliteBase, LightEntity): """Return true if device is on.""" return self._device.is_on - async def async_turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" await self._device.async_turn_on(**kwargs) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" await self._device.async_turn_off(**kwargs) diff --git a/homeassistant/components/enocean/light.py b/homeassistant/components/enocean/light.py index 8ecc3f63831..479723bd051 100644 --- a/homeassistant/components/enocean/light.py +++ b/homeassistant/components/enocean/light.py @@ -2,6 +2,7 @@ from __future__ import annotations import math +from typing import Any from enocean.utils import combine_hex import voluptuous as vol @@ -80,7 +81,7 @@ class EnOceanLight(EnOceanEntity, LightEntity): """If light is on.""" return self._on_state - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the light source on or sets a specific dimmer value.""" if (brightness := kwargs.get(ATTR_BRIGHTNESS)) is not None: self._brightness = brightness @@ -94,7 +95,7 @@ class EnOceanLight(EnOceanEntity, LightEntity): self.send_command(command, [], 0x01) self._on_state = True - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the light source off.""" command = [0xA5, 0x02, 0x00, 0x01, 0x09] command.extend(self._sender_id) diff --git a/homeassistant/components/eufy/light.py b/homeassistant/components/eufy/light.py index 57d54146137..f3d5fe58e7d 100644 --- a/homeassistant/components/eufy/light.py +++ b/homeassistant/components/eufy/light.py @@ -1,6 +1,8 @@ """Support for Eufy lights.""" from __future__ import annotations +from typing import Any + import lakeside from homeassistant.components.light import ( @@ -59,7 +61,7 @@ class EufyLight(LightEntity): self._attr_supported_color_modes = {ColorMode.COLOR_TEMP, ColorMode.HS} self._bulb.connect() - def update(self): + def update(self) -> None: """Synchronise state from the bulb.""" self._bulb.update() if self._bulb.power: @@ -93,12 +95,12 @@ class EufyLight(LightEntity): return int(self._brightness * 255 / 100) @property - def min_mireds(self): + def min_mireds(self) -> int: """Return minimum supported color temperature.""" return kelvin_to_mired(EUFY_MAX_KELVIN) @property - def max_mireds(self): + def max_mireds(self) -> int: """Return maximum supported color temperature.""" return kelvin_to_mired(EUFY_MIN_KELVIN) @@ -116,7 +118,7 @@ class EufyLight(LightEntity): return self._hs @property - def color_mode(self) -> str | None: + def color_mode(self) -> ColorMode: """Return the color mode of the light.""" if self._type == "T1011": return ColorMode.BRIGHTNESS @@ -127,7 +129,7 @@ class EufyLight(LightEntity): return ColorMode.COLOR_TEMP return ColorMode.HS - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the specified light on.""" brightness = kwargs.get(ATTR_BRIGHTNESS) colortemp = kwargs.get(ATTR_COLOR_TEMP) @@ -169,7 +171,7 @@ class EufyLight(LightEntity): power=True, brightness=brightness, temperature=temp, colors=rgb ) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the specified light off.""" try: self._bulb.set_state(power=False) diff --git a/homeassistant/components/firmata/light.py b/homeassistant/components/firmata/light.py index 8f562b12d30..59be2484d66 100644 --- a/homeassistant/components/firmata/light.py +++ b/homeassistant/components/firmata/light.py @@ -2,6 +2,7 @@ from __future__ import annotations import logging +from typing import Any from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity from homeassistant.config_entries import ConfigEntry @@ -82,14 +83,14 @@ class FirmataLight(FirmataPinEntity, LightEntity): """Return the brightness of the light.""" return self._api.state - async def async_turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs: Any) -> None: """Turn on light.""" level = kwargs.get(ATTR_BRIGHTNESS, self._last_on_level) await self._api.set_level(level) self.async_write_ha_state() self._last_on_level = level - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off light.""" await self._api.set_level(0) self.async_write_ha_state() diff --git a/homeassistant/components/fjaraskupan/light.py b/homeassistant/components/fjaraskupan/light.py index f492f628a3a..c42943710de 100644 --- a/homeassistant/components/fjaraskupan/light.py +++ b/homeassistant/components/fjaraskupan/light.py @@ -1,6 +1,8 @@ """Support for lights.""" from __future__ import annotations +from typing import Any + from fjaraskupan import COMMAND_LIGHT_ON_OFF, Device from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity @@ -45,7 +47,7 @@ class Light(CoordinatorEntity[Coordinator], LightEntity): self._attr_unique_id = device.address self._attr_device_info = device_info - async def async_turn_on(self, **kwargs): + async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" if ATTR_BRIGHTNESS in kwargs: await self._device.send_dim(int(kwargs[ATTR_BRIGHTNESS] * (100.0 / 255.0))) @@ -54,7 +56,7 @@ class Light(CoordinatorEntity[Coordinator], LightEntity): await self._device.send_command(COMMAND_LIGHT_ON_OFF) self.coordinator.async_set_updated_data(self._device.state) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the entity off.""" if self.is_on: await self._device.send_command(COMMAND_LIGHT_ON_OFF) diff --git a/homeassistant/components/futurenow/light.py b/homeassistant/components/futurenow/light.py index e27436966fc..d070d832052 100644 --- a/homeassistant/components/futurenow/light.py +++ b/homeassistant/components/futurenow/light.py @@ -1,6 +1,8 @@ """Support for FutureNow Ethernet unit outputs as Lights.""" from __future__ import annotations +from typing import Any + import pyfnip import voluptuous as vol @@ -106,18 +108,18 @@ class FutureNowLight(LightEntity): return self._brightness @property - def color_mode(self) -> str: + def color_mode(self) -> ColorMode: """Return the color mode of the light.""" if self._dimmable: return ColorMode.BRIGHTNESS return ColorMode.ONOFF @property - def supported_color_modes(self) -> set[str] | None: + def supported_color_modes(self) -> set[ColorMode]: """Flag supported color modes.""" return {self.color_mode} - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" if self._dimmable: level = kwargs.get(ATTR_BRIGHTNESS, self._last_brightness) @@ -125,13 +127,13 @@ class FutureNowLight(LightEntity): level = 255 self._light.turn_on(to_futurenow_level(level)) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" self._light.turn_off() if self._brightness: self._last_brightness = self._brightness - def update(self): + def update(self) -> None: """Fetch new state data for this light.""" state = int(self._light.is_on()) self._state = bool(state) diff --git a/homeassistant/components/greenwave/light.py b/homeassistant/components/greenwave/light.py index a6b018f33ff..1e991feee90 100644 --- a/homeassistant/components/greenwave/light.py +++ b/homeassistant/components/greenwave/light.py @@ -4,6 +4,7 @@ from __future__ import annotations from datetime import timedelta import logging import os +from typing import Any import greenwavereality as greenwave import voluptuous as vol @@ -99,17 +100,17 @@ class GreenwaveLight(LightEntity): """Return true if light is on.""" return self._state - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Instruct the light to turn on.""" temp_brightness = int((kwargs.get(ATTR_BRIGHTNESS, 255) / 255) * 100) greenwave.set_brightness(self._host, self._did, temp_brightness, self._token) greenwave.turn_on(self._host, self._did, self._token) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Instruct the light to turn off.""" greenwave.turn_off(self._host, self._did, self._token) - def update(self): + def update(self) -> None: """Fetch new state data for this light.""" self._gatewaydata.update() bulbs = self._gatewaydata.greenwave diff --git a/homeassistant/components/homematic/light.py b/homeassistant/components/homematic/light.py index 4087f83dd2a..38a75266a17 100644 --- a/homeassistant/components/homematic/light.py +++ b/homeassistant/components/homematic/light.py @@ -1,6 +1,8 @@ """Support for Homematic lights.""" from __future__ import annotations +from typing import Any + from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, @@ -80,9 +82,9 @@ class HMLight(HMDevice, LightEntity): return color_modes @property - def supported_features(self): + def supported_features(self) -> int: """Flag supported features.""" - features = LightEntityFeature.TRANSITION + features: int = LightEntityFeature.TRANSITION if "PROGRAM" in self._hmdevice.WRITENODE: features |= LightEntityFeature.EFFECT return features @@ -117,7 +119,7 @@ class HMLight(HMDevice, LightEntity): return None return self._hmdevice.get_effect() - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the light on and/or change color or color effect settings.""" if ATTR_TRANSITION in kwargs: self._hmdevice.setValue("RAMP_TIME", kwargs[ATTR_TRANSITION], self._channel) @@ -146,7 +148,7 @@ class HMLight(HMDevice, LightEntity): if ATTR_EFFECT in kwargs: self._hmdevice.set_effect(kwargs[ATTR_EFFECT]) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" if ATTR_TRANSITION in kwargs: self._hmdevice.setValue("RAMP_TIME", kwargs[ATTR_TRANSITION], self._channel) diff --git a/homeassistant/components/homematicip_cloud/light.py b/homeassistant/components/homematicip_cloud/light.py index 0cf02d88471..c43ac510023 100644 --- a/homeassistant/components/homematicip_cloud/light.py +++ b/homeassistant/components/homematicip_cloud/light.py @@ -81,11 +81,11 @@ class HomematicipLight(HomematicipGenericEntity, LightEntity): """Return true if light is on.""" return self._device.on - async def async_turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" await self._device.turn_on() - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" await self._device.turn_off() @@ -125,7 +125,7 @@ class HomematicipMultiDimmer(HomematicipGenericEntity, LightEntity): (self._device.functionalChannels[self._channel].dimLevel or 0.0) * 255 ) - async def async_turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs: Any) -> None: """Turn the dimmer on.""" if ATTR_BRIGHTNESS in kwargs: await self._device.set_dim_level( @@ -134,7 +134,7 @@ class HomematicipMultiDimmer(HomematicipGenericEntity, LightEntity): else: await self._device.set_dim_level(1, self._channel) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the dimmer off.""" await self._device.set_dim_level(0, self._channel) @@ -213,7 +213,7 @@ class HomematicipNotificationLight(HomematicipGenericEntity, LightEntity): """Return a unique ID.""" return f"{self.__class__.__name__}_{self._post}_{self._device.id}" - async def async_turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" # Use hs_color from kwargs, # if not applicable use current hs_color. @@ -241,7 +241,7 @@ class HomematicipNotificationLight(HomematicipGenericEntity, LightEntity): rampTime=transition, ) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" simple_rgb_color = self._func_channel.simpleRGBColorState transition = kwargs.get(ATTR_TRANSITION, 0.5) diff --git a/homeassistant/components/homeworks/light.py b/homeassistant/components/homeworks/light.py index 0a8d7f2fb28..35a9e5665d1 100644 --- a/homeassistant/components/homeworks/light.py +++ b/homeassistant/components/homeworks/light.py @@ -2,6 +2,7 @@ from __future__ import annotations import logging +from typing import Any from pyhomeworks.pyhomeworks import HW_LIGHT_CHANGED @@ -50,7 +51,7 @@ class HomeworksLight(HomeworksDevice, LightEntity): self._level = 0 self._prev_level = 0 - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Call when entity is added to hass.""" signal = f"homeworks_entity_{self._addr}" _LOGGER.debug("connecting %s", signal) @@ -59,7 +60,7 @@ class HomeworksLight(HomeworksDevice, LightEntity): ) self._controller.request_dimmer_level(self._addr) - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn on the light.""" if ATTR_BRIGHTNESS in kwargs: new_level = kwargs[ATTR_BRIGHTNESS] @@ -69,7 +70,7 @@ class HomeworksLight(HomeworksDevice, LightEntity): new_level = self._prev_level self._set_brightness(new_level) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn off the light.""" self._set_brightness(0) diff --git a/homeassistant/components/iaqualink/light.py b/homeassistant/components/iaqualink/light.py index 505ad8da0cc..3a8b1e0fb4a 100644 --- a/homeassistant/components/iaqualink/light.py +++ b/homeassistant/components/iaqualink/light.py @@ -1,6 +1,8 @@ """Support for Aqualink pool lights.""" from __future__ import annotations +from typing import Any + from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_EFFECT, @@ -46,7 +48,7 @@ class HassAqualinkLight(AqualinkEntity, LightEntity): return self.dev.is_on @refresh_system - async def async_turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs: Any) -> None: """Turn on the light. This handles brightness and light effects for lights that do support @@ -63,7 +65,7 @@ class HassAqualinkLight(AqualinkEntity, LightEntity): await await_or_reraise(self.dev.turn_on()) @refresh_system - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the light.""" await await_or_reraise(self.dev.turn_off()) @@ -93,7 +95,7 @@ class HassAqualinkLight(AqualinkEntity, LightEntity): return ColorMode.ONOFF @property - def supported_color_modes(self) -> set[str] | None: + def supported_color_modes(self) -> set[ColorMode]: """Flag supported color modes.""" return {self.color_mode} diff --git a/homeassistant/components/iglo/light.py b/homeassistant/components/iglo/light.py index 39e1a5986ab..5de24625ea3 100644 --- a/homeassistant/components/iglo/light.py +++ b/homeassistant/components/iglo/light.py @@ -2,6 +2,7 @@ from __future__ import annotations import math +from typing import Any from iglo import Lamp from iglo.lamp import MODE_WHITE @@ -86,14 +87,14 @@ class IGloLamp(LightEntity): return color_util.color_temperature_kelvin_to_mired(self._lamp.state()["white"]) @property - def min_mireds(self): + def min_mireds(self) -> int: """Return the coldest color_temp that this light supports.""" return math.ceil( color_util.color_temperature_kelvin_to_mired(self._lamp.max_kelvin) ) @property - def max_mireds(self): + def max_mireds(self) -> int: """Return the warmest color_temp that this light supports.""" return math.ceil( color_util.color_temperature_kelvin_to_mired(self._lamp.min_kelvin) @@ -119,7 +120,7 @@ class IGloLamp(LightEntity): """Return true if light is on.""" return self._lamp.state()["on"] - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" if not self.is_on: self._lamp.switch(True) @@ -145,6 +146,6 @@ class IGloLamp(LightEntity): self._lamp.effect(effect) return - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" self._lamp.switch(False) diff --git a/homeassistant/components/ihc/light.py b/homeassistant/components/ihc/light.py index caceaf9737c..089317ca7d7 100644 --- a/homeassistant/components/ihc/light.py +++ b/homeassistant/components/ihc/light.py @@ -1,6 +1,8 @@ """Support for IHC lights.""" from __future__ import annotations +from typing import Any + from ihcsdk.ihccontroller import IHCController from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity @@ -90,7 +92,7 @@ class IhcLight(IHCDevice, LightEntity): """Return true if light is on.""" return self._state - async def async_turn_on(self, **kwargs): + async def async_turn_on(self, **kwargs: Any) -> None: """Turn the light on.""" if ATTR_BRIGHTNESS in kwargs: brightness = kwargs[ATTR_BRIGHTNESS] @@ -108,7 +110,7 @@ class IhcLight(IHCDevice, LightEntity): else: await async_set_bool(self.hass, self.ihc_controller, self.ihc_id, True) - async def async_turn_off(self, **kwargs): + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" if self._dimmable: await async_set_int(self.hass, self.ihc_controller, self.ihc_id, 0)