Add missing ToggleEntity type hints in fans (#73887)

pull/73895/head
epenet 2022-06-23 12:01:05 +02:00 committed by GitHub
parent a3ce80baed
commit 48bd7cf5e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 11 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -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)

View File

@ -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.

View File

@ -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

View File

@ -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():

View File

@ -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)

View File

@ -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

View File

@ -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)