From 48bd7cf5e1679bda3fa0fb266d25b5903fbe806f Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 23 Jun 2022 12:01:05 +0200 Subject: [PATCH] Add missing ToggleEntity type hints in fans (#73887) --- homeassistant/components/demo/fan.py | 4 ++-- homeassistant/components/fjaraskupan/fan.py | 2 +- homeassistant/components/insteon/fan.py | 2 +- homeassistant/components/lutron_caseta/fan.py | 2 +- homeassistant/components/mqtt/fan.py | 2 +- homeassistant/components/smartthings/fan.py | 2 +- homeassistant/components/smarty/fan.py | 2 +- homeassistant/components/wilight/fan.py | 2 +- homeassistant/components/xiaomi_miio/fan.py | 2 +- homeassistant/components/zha/fan.py | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/demo/fan.py b/homeassistant/components/demo/fan.py index ef6875cb7c6..a36e7a35cff 100644 --- a/homeassistant/components/demo/fan.py +++ b/homeassistant/components/demo/fan.py @@ -208,7 +208,7 @@ class DemoPercentageFan(BaseDemoFan, FanEntity): self.set_percentage(percentage) - def turn_off(self, **kwargs) -> None: + def turn_off(self, **kwargs: Any) -> None: """Turn off the entity.""" self.set_percentage(0) @@ -278,7 +278,7 @@ class AsyncDemoPercentageFan(BaseDemoFan, FanEntity): await self.async_set_percentage(percentage) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the entity.""" await self.async_oscillate(False) await self.async_set_percentage(0) diff --git a/homeassistant/components/fjaraskupan/fan.py b/homeassistant/components/fjaraskupan/fan.py index ae5da3d189c..e372d540f54 100644 --- a/homeassistant/components/fjaraskupan/fan.py +++ b/homeassistant/components/fjaraskupan/fan.py @@ -135,7 +135,7 @@ class Fan(CoordinatorEntity[Coordinator], FanEntity): else: raise UnsupportedPreset(f"The preset {preset_mode} is unsupported") - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the entity off.""" await self._device.send_command(COMMAND_STOP_FAN) self.coordinator.async_set_updated_data(self._device.state) diff --git a/homeassistant/components/insteon/fan.py b/homeassistant/components/insteon/fan.py index 8fe5fc9346e..c7512ba0278 100644 --- a/homeassistant/components/insteon/fan.py +++ b/homeassistant/components/insteon/fan.py @@ -70,7 +70,7 @@ class InsteonFanEntity(InsteonEntity, FanEntity): """Turn on the fan.""" await self.async_set_percentage(percentage or 67) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the fan.""" await self._insteon_device.async_fan_off() diff --git a/homeassistant/components/lutron_caseta/fan.py b/homeassistant/components/lutron_caseta/fan.py index 46eee1bde6b..bf2328565d4 100644 --- a/homeassistant/components/lutron_caseta/fan.py +++ b/homeassistant/components/lutron_caseta/fan.py @@ -70,7 +70,7 @@ class LutronCasetaFan(LutronCasetaDeviceUpdatableEntity, FanEntity): await self.async_set_percentage(percentage) - async def async_turn_off(self, **kwargs): + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the fan off.""" await self.async_set_percentage(0) diff --git a/homeassistant/components/mqtt/fan.py b/homeassistant/components/mqtt/fan.py index 4e7e58afb9f..f1a1dbed657 100644 --- a/homeassistant/components/mqtt/fan.py +++ b/homeassistant/components/mqtt/fan.py @@ -568,7 +568,7 @@ class MqttFan(MqttEntity, FanEntity): self._state = True self.async_write_ha_state() - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the entity. This method is a coroutine. diff --git a/homeassistant/components/smartthings/fan.py b/homeassistant/components/smartthings/fan.py index abcd5d12f75..7278f350dc1 100644 --- a/homeassistant/components/smartthings/fan.py +++ b/homeassistant/components/smartthings/fan.py @@ -78,7 +78,7 @@ class SmartThingsFan(SmartThingsEntity, FanEntity): """Turn the fan on.""" await self._async_set_percentage(percentage) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the fan off.""" await self._device.switch_off(set_status=True) # State is set optimistically in the command above, therefore update diff --git a/homeassistant/components/smarty/fan.py b/homeassistant/components/smarty/fan.py index a51d6783245..ceb3b17e030 100644 --- a/homeassistant/components/smarty/fan.py +++ b/homeassistant/components/smarty/fan.py @@ -107,7 +107,7 @@ class SmartyFan(FanEntity): _LOGGER.debug("Turning on fan. percentage is %s", percentage) self.set_percentage(percentage or DEFAULT_ON_PERCENTAGE) - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn off the fan.""" _LOGGER.debug("Turning off fan") if not self._smarty.turn_off(): diff --git a/homeassistant/components/wilight/fan.py b/homeassistant/components/wilight/fan.py index 7a60fa8ab62..a93e0eb9447 100644 --- a/homeassistant/components/wilight/fan.py +++ b/homeassistant/components/wilight/fan.py @@ -130,6 +130,6 @@ class WiLightFan(WiLightDevice, FanEntity): wl_direction = WL_DIRECTION_FORWARD await self._client.set_fan_direction(self._index, wl_direction) - async def async_turn_off(self, **kwargs): + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the fan off.""" await self._client.set_fan_direction(self._index, WL_DIRECTION_OFF) diff --git a/homeassistant/components/xiaomi_miio/fan.py b/homeassistant/components/xiaomi_miio/fan.py index 31908ba373f..b70ddc945ea 100644 --- a/homeassistant/components/xiaomi_miio/fan.py +++ b/homeassistant/components/xiaomi_miio/fan.py @@ -334,7 +334,7 @@ class XiaomiGenericDevice(XiaomiCoordinatedMiioEntity, FanEntity): self._state = True self.async_write_ha_state() - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" result = await self._try_command( "Turning the miio device off failed.", self._device.off diff --git a/homeassistant/components/zha/fan.py b/homeassistant/components/zha/fan.py index 298f9e47296..1873c906a6f 100644 --- a/homeassistant/components/zha/fan.py +++ b/homeassistant/components/zha/fan.py @@ -99,7 +99,7 @@ class BaseFan(FanEntity): percentage = DEFAULT_ON_PERCENTAGE await self.async_set_percentage(percentage) - async def async_turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs: Any) -> None: """Turn the entity off.""" await self.async_set_percentage(0)