Add missing type hints in fans (#73835)

This commit is contained in:
epenet 2022-06-22 18:43:41 +02:00 committed by GitHub
parent 532e25d087
commit 6b6e5fad3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 106 additions and 75 deletions

View file

@ -118,7 +118,7 @@ class ComfoConnectFan(FanEntity):
self, self,
percentage: int | None = None, percentage: int | None = None,
preset_mode: str | None = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""
if percentage is None: if percentage is None:

View file

@ -1,6 +1,8 @@
"""Demo fan platform that has a fake fan.""" """Demo fan platform that has a fake fan."""
from __future__ import annotations from __future__ import annotations
from typing import Any
from homeassistant.components.fan import FanEntity, FanEntityFeature from homeassistant.components.fan import FanEntity, FanEntityFeature
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
@ -192,9 +194,9 @@ class DemoPercentageFan(BaseDemoFan, FanEntity):
def turn_on( def turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the entity.""" """Turn on the entity."""
if preset_mode: if preset_mode:
@ -262,9 +264,9 @@ class AsyncDemoPercentageFan(BaseDemoFan, FanEntity):
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the entity.""" """Turn on the entity."""
if preset_mode: if preset_mode:

View file

@ -1,6 +1,8 @@
"""Support for Fjäråskupan fans.""" """Support for Fjäråskupan fans."""
from __future__ import annotations from __future__ import annotations
from typing import Any
from fjaraskupan import ( from fjaraskupan import (
COMMAND_AFTERCOOKINGTIMERAUTO, COMMAND_AFTERCOOKINGTIMERAUTO,
COMMAND_AFTERCOOKINGTIMERMANUAL, COMMAND_AFTERCOOKINGTIMERMANUAL,
@ -93,9 +95,9 @@ class Fan(CoordinatorEntity[Coordinator], FanEntity):
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""

View file

@ -60,7 +60,7 @@ class FreedomproFan(CoordinatorEntity, FanEntity):
return self._attr_is_on return self._attr_is_on
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current speed percentage.""" """Return the current speed percentage."""
return self._attr_percentage return self._attr_percentage
@ -111,7 +111,7 @@ class FreedomproFan(CoordinatorEntity, FanEntity):
) )
await self.coordinator.async_request_refresh() await self.coordinator.async_request_refresh()
async def async_set_percentage(self, percentage: int): async def async_set_percentage(self, percentage: int) -> None:
"""Set the speed percentage of the fan.""" """Set the speed percentage of the fan."""
rotation_speed = {"rotationSpeed": percentage} rotation_speed = {"rotationSpeed": percentage}
payload = json.dumps(rotation_speed) payload = json.dumps(rotation_speed)

View file

@ -2,6 +2,7 @@
from __future__ import annotations from __future__ import annotations
import math import math
from typing import Any
from homeassistant.components.fan import ( from homeassistant.components.fan import (
DOMAIN as FAN_DOMAIN, DOMAIN as FAN_DOMAIN,
@ -62,9 +63,9 @@ class InsteonFanEntity(InsteonEntity, FanEntity):
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""
await self.async_set_percentage(percentage or 67) await self.async_set_percentage(percentage or 67)

View file

@ -1,6 +1,8 @@
"""Support for Lutron Caseta fans.""" """Support for Lutron Caseta fans."""
from __future__ import annotations from __future__ import annotations
from typing import Any
from pylutron_caseta import FAN_HIGH, FAN_LOW, FAN_MEDIUM, FAN_MEDIUM_HIGH, FAN_OFF from pylutron_caseta import FAN_HIGH, FAN_LOW, FAN_MEDIUM, FAN_MEDIUM_HIGH, FAN_OFF
from homeassistant.components.fan import DOMAIN, FanEntity, FanEntityFeature from homeassistant.components.fan import DOMAIN, FanEntity, FanEntityFeature
@ -58,10 +60,10 @@ class LutronCasetaFan(LutronCasetaDeviceUpdatableEntity, FanEntity):
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
): ) -> None:
"""Turn the fan on.""" """Turn the fan on."""
if percentage is None: if percentage is None:
percentage = DEFAULT_ON_PERCENTAGE percentage = DEFAULT_ON_PERCENTAGE

View file

@ -127,7 +127,7 @@ class ModernFormsFanEntity(FanEntity, ModernFormsDeviceEntity):
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int | None = None, percentage: int | None = None,
preset_mode: int | None = None, preset_mode: str | None = None,
**kwargs: Any, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""

View file

@ -4,6 +4,7 @@ from __future__ import annotations
import functools import functools
import logging import logging
import math import math
from typing import Any
import voluptuous as vol import voluptuous as vol
@ -511,17 +512,17 @@ class MqttFan(MqttEntity, FanEntity):
return self._state return self._state
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current percentage.""" """Return the current percentage."""
return self._percentage return self._percentage
@property @property
def preset_mode(self): def preset_mode(self) -> str | None:
"""Return the current preset _mode.""" """Return the current preset _mode."""
return self._preset_mode return self._preset_mode
@property @property
def preset_modes(self) -> list: def preset_modes(self) -> list[str]:
"""Get the list of available preset modes.""" """Get the list of available preset modes."""
return self._preset_modes return self._preset_modes
@ -536,16 +537,16 @@ class MqttFan(MqttEntity, FanEntity):
return self._speed_count return self._speed_count
@property @property
def oscillating(self): def oscillating(self) -> bool | None:
"""Return the oscillation state.""" """Return the oscillation state."""
return self._oscillation return self._oscillation
# The speed attribute deprecated in the schema, support will be removed after a quarter (2021.7) # The speed attribute deprecated in the schema, support will be removed after a quarter (2021.7)
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the entity. """Turn on the entity.

View file

@ -3,6 +3,7 @@ from __future__ import annotations
from collections.abc import Sequence from collections.abc import Sequence
import math import math
from typing import Any
from pysmartthings import Capability from pysmartthings import Capability
@ -72,7 +73,7 @@ class SmartThingsFan(SmartThingsEntity, FanEntity):
self, self,
percentage: int | None = None, percentage: int | None = None,
preset_mode: str | None = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn the fan on.""" """Turn the fan on."""
await self._async_set_percentage(percentage) await self._async_set_percentage(percentage)

View file

@ -3,6 +3,7 @@ from __future__ import annotations
import logging import logging
import math import math
from typing import Any
from homeassistant.components.fan import FanEntity, FanEntityFeature from homeassistant.components.fan import FanEntity, FanEntityFeature
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -64,7 +65,7 @@ class SmartyFan(FanEntity):
return "mdi:air-conditioner" return "mdi:air-conditioner"
@property @property
def is_on(self): def is_on(self) -> bool:
"""Return state of the fan.""" """Return state of the fan."""
return bool(self._smarty_fan_speed) return bool(self._smarty_fan_speed)
@ -96,7 +97,12 @@ class SmartyFan(FanEntity):
self._smarty_fan_speed = fan_speed self._smarty_fan_speed = fan_speed
self.schedule_update_ha_state() self.schedule_update_ha_state()
def turn_on(self, percentage=None, preset_mode=None, **kwargs): def turn_on(
self,
percentage: int | None = None,
preset_mode: str | None = None,
**kwargs: Any,
) -> None:
"""Turn on the fan.""" """Turn on the fan."""
_LOGGER.debug("Turning on fan. percentage is %s", percentage) _LOGGER.debug("Turning on fan. percentage is %s", percentage)
self.set_percentage(percentage or DEFAULT_ON_PERCENTAGE) self.set_percentage(percentage or DEFAULT_ON_PERCENTAGE)

View file

@ -1,6 +1,8 @@
"""Fan support for switch entities.""" """Fan support for switch entities."""
from __future__ import annotations from __future__ import annotations
from typing import Any
from homeassistant.components.fan import FanEntity from homeassistant.components.fan import FanEntity
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_ENTITY_ID from homeassistant.const import CONF_ENTITY_ID
@ -53,7 +55,7 @@ class FanSwitch(BaseToggleEntity, FanEntity):
self, self,
percentage: int | None = None, percentage: int | None = None,
preset_mode: str | None = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan. """Turn on the fan.

View file

@ -215,35 +215,35 @@ class TemplateFan(TemplateEntity, FanEntity):
return self._preset_modes return self._preset_modes
@property @property
def is_on(self): def is_on(self) -> bool:
"""Return true if device is on.""" """Return true if device is on."""
return self._state == STATE_ON return self._state == STATE_ON
@property @property
def preset_mode(self): def preset_mode(self) -> str | None:
"""Return the current preset mode.""" """Return the current preset mode."""
return self._preset_mode return self._preset_mode
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current speed percentage.""" """Return the current speed percentage."""
return self._percentage return self._percentage
@property @property
def oscillating(self): def oscillating(self) -> bool | None:
"""Return the oscillation state.""" """Return the oscillation state."""
return self._oscillating return self._oscillating
@property @property
def current_direction(self): def current_direction(self) -> str | None:
"""Return the oscillation state.""" """Return the oscillation state."""
return self._direction return self._direction
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""
await self.async_run_script( await self.async_run_script(

View file

@ -158,8 +158,8 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
def turn_on( def turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs: Any, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""

View file

@ -1,6 +1,9 @@
"""Support for VeSync fans.""" """Support for VeSync fans."""
from __future__ import annotations
import logging import logging
import math import math
from typing import Any
from homeassistant.components.fan import FanEntity, FanEntityFeature from homeassistant.components.fan import FanEntity, FanEntityFeature
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
@ -91,7 +94,7 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
self.smartfan = fan self.smartfan = fan
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current speed.""" """Return the current speed."""
if ( if (
self.smartfan.mode == "manual" self.smartfan.mode == "manual"
@ -115,7 +118,7 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
return PRESET_MODES[SKU_TO_BASE_DEVICE.get(self.device.device_type)] return PRESET_MODES[SKU_TO_BASE_DEVICE.get(self.device.device_type)]
@property @property
def preset_mode(self): def preset_mode(self) -> str | None:
"""Get the current preset mode.""" """Get the current preset mode."""
if self.smartfan.mode in (FAN_MODE_AUTO, FAN_MODE_SLEEP): if self.smartfan.mode in (FAN_MODE_AUTO, FAN_MODE_SLEEP):
return self.smartfan.mode return self.smartfan.mode
@ -148,7 +151,7 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
return attr return attr
def set_percentage(self, percentage): def set_percentage(self, percentage: int) -> None:
"""Set the speed of the device.""" """Set the speed of the device."""
if percentage == 0: if percentage == 0:
self.smartfan.turn_off() self.smartfan.turn_off()
@ -167,7 +170,7 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
) )
self.schedule_update_ha_state() self.schedule_update_ha_state()
def set_preset_mode(self, preset_mode): def set_preset_mode(self, preset_mode: str) -> None:
"""Set the preset mode of device.""" """Set the preset mode of device."""
if preset_mode not in self.preset_modes: if preset_mode not in self.preset_modes:
raise ValueError( raise ValueError(
@ -187,9 +190,9 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
def turn_on( def turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn the device on.""" """Turn the device on."""
if preset_mode: if preset_mode:

View file

@ -1,6 +1,8 @@
"""Support for WiLight Fan.""" """Support for WiLight Fan."""
from __future__ import annotations from __future__ import annotations
from typing import Any
from pywilight.const import ( from pywilight.const import (
FAN_V1, FAN_V1,
ITEM_FAN, ITEM_FAN,
@ -64,7 +66,7 @@ class WiLightFan(WiLightDevice, FanEntity):
return "mdi:fan" return "mdi:fan"
@property @property
def is_on(self): def is_on(self) -> bool:
"""Return true if device is on.""" """Return true if device is on."""
return self._status.get("direction", WL_DIRECTION_OFF) != WL_DIRECTION_OFF return self._status.get("direction", WL_DIRECTION_OFF) != WL_DIRECTION_OFF
@ -98,9 +100,9 @@ class WiLightFan(WiLightDevice, FanEntity):
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""
if percentage is None: if percentage is None:
@ -108,7 +110,7 @@ class WiLightFan(WiLightDevice, FanEntity):
else: else:
await self.async_set_percentage(percentage) await self.async_set_percentage(percentage)
async def async_set_percentage(self, percentage: int): async def async_set_percentage(self, percentage: int) -> None:
"""Set the speed of the fan.""" """Set the speed of the fan."""
if percentage == 0: if percentage == 0:
await self._client.set_fan_direction(self._index, WL_DIRECTION_OFF) await self._client.set_fan_direction(self._index, WL_DIRECTION_OFF)
@ -121,7 +123,7 @@ class WiLightFan(WiLightDevice, FanEntity):
wl_speed = percentage_to_ordered_list_item(ORDERED_NAMED_FAN_SPEEDS, percentage) wl_speed = percentage_to_ordered_list_item(ORDERED_NAMED_FAN_SPEEDS, percentage)
await self._client.set_fan_speed(self._index, wl_speed) await self._client.set_fan_speed(self._index, wl_speed)
async def async_set_direction(self, direction: str): async def async_set_direction(self, direction: str) -> None:
"""Set the direction of the fan.""" """Set the direction of the fan."""
wl_direction = WL_DIRECTION_REVERSE wl_direction = WL_DIRECTION_REVERSE
if direction == DIRECTION_FORWARD: if direction == DIRECTION_FORWARD:

View file

@ -1,8 +1,11 @@
"""Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier.""" """Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier."""
from __future__ import annotations
from abc import abstractmethod from abc import abstractmethod
import asyncio import asyncio
import logging import logging
import math import math
from typing import Any
from miio.airfresh import OperationMode as AirfreshOperationMode from miio.airfresh import OperationMode as AirfreshOperationMode
from miio.airfresh_t2017 import OperationMode as AirfreshOperationModeT2017 from miio.airfresh_t2017 import OperationMode as AirfreshOperationModeT2017
@ -291,12 +294,12 @@ class XiaomiGenericDevice(XiaomiCoordinatedMiioEntity, FanEntity):
"""Hold operation mode class.""" """Hold operation mode class."""
@property @property
def preset_modes(self) -> list: def preset_modes(self) -> list[str]:
"""Get the list of available preset modes.""" """Get the list of available preset modes."""
return self._preset_modes return self._preset_modes
@property @property
def percentage(self): def percentage(self) -> None:
"""Return the percentage based speed of the fan.""" """Return the percentage based speed of the fan."""
return None return None
@ -306,15 +309,15 @@ class XiaomiGenericDevice(XiaomiCoordinatedMiioEntity, FanEntity):
return self._state_attrs return self._state_attrs
@property @property
def is_on(self): def is_on(self) -> bool | None:
"""Return true if device is on.""" """Return true if device is on."""
return self._state return self._state
async def async_turn_on( async def async_turn_on(
self, self,
percentage: int = None, percentage: int | None = None,
preset_mode: str = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn the device on.""" """Turn the device on."""
result = await self._try_command( result = await self._try_command(
@ -352,12 +355,12 @@ class XiaomiGenericAirPurifier(XiaomiGenericDevice):
self._speed_count = 100 self._speed_count = 100
@property @property
def speed_count(self): def speed_count(self) -> int:
"""Return the number of speeds of the fan supported.""" """Return the number of speeds of the fan supported."""
return self._speed_count return self._speed_count
@property @property
def preset_mode(self): def preset_mode(self) -> str | None:
"""Get the active preset mode.""" """Get the active preset mode."""
if self._state: if self._state:
preset_mode = self.operation_mode_class(self._mode).name preset_mode = self.operation_mode_class(self._mode).name
@ -451,7 +454,7 @@ class XiaomiAirPurifier(XiaomiGenericAirPurifier):
return AirpurifierOperationMode return AirpurifierOperationMode
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current percentage based speed.""" """Return the current percentage based speed."""
if self._state: if self._state:
mode = self.operation_mode_class(self._mode) mode = self.operation_mode_class(self._mode)
@ -528,7 +531,7 @@ class XiaomiAirPurifierMiot(XiaomiAirPurifier):
return AirpurifierMiotOperationMode return AirpurifierMiotOperationMode
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current percentage based speed.""" """Return the current percentage based speed."""
if self._fan_level is None: if self._fan_level is None:
return None return None
@ -642,7 +645,7 @@ class XiaomiAirFresh(XiaomiGenericAirPurifier):
return AirfreshOperationMode return AirfreshOperationMode
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current percentage based speed.""" """Return the current percentage based speed."""
if self._state: if self._state:
mode = AirfreshOperationMode(self._mode) mode = AirfreshOperationMode(self._mode)
@ -733,7 +736,7 @@ class XiaomiAirFreshA1(XiaomiGenericAirPurifier):
return AirfreshOperationModeT2017 return AirfreshOperationModeT2017
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current percentage based speed.""" """Return the current percentage based speed."""
if self._favorite_speed is None: if self._favorite_speed is None:
return None return None
@ -826,17 +829,17 @@ class XiaomiGenericFan(XiaomiGenericDevice):
self._percentage = None self._percentage = None
@property @property
def preset_mode(self): def preset_mode(self) -> str | None:
"""Get the active preset mode.""" """Get the active preset mode."""
return self._preset_mode return self._preset_mode
@property @property
def preset_modes(self) -> list: def preset_modes(self) -> list[str]:
"""Get the list of available preset modes.""" """Get the list of available preset modes."""
return [mode.name for mode in self.operation_mode_class] return [mode.name for mode in self.operation_mode_class]
@property @property
def percentage(self): def percentage(self) -> int | None:
"""Return the current speed as a percentage.""" """Return the current speed as a percentage."""
if self._state: if self._state:
return self._percentage return self._percentage
@ -844,7 +847,7 @@ class XiaomiGenericFan(XiaomiGenericDevice):
return None return None
@property @property
def oscillating(self): def oscillating(self) -> bool | None:
"""Return whether or not the fan is currently oscillating.""" """Return whether or not the fan is currently oscillating."""
return self._oscillating return self._oscillating
@ -890,12 +893,12 @@ class XiaomiFan(XiaomiGenericFan):
"""Hold operation mode class.""" """Hold operation mode class."""
@property @property
def preset_mode(self): def preset_mode(self) -> str:
"""Get the active preset mode.""" """Get the active preset mode."""
return ATTR_MODE_NATURE if self._nature_mode else ATTR_MODE_NORMAL return ATTR_MODE_NATURE if self._nature_mode else ATTR_MODE_NORMAL
@property @property
def preset_modes(self) -> list: def preset_modes(self) -> list[str]:
"""Get the list of available preset modes.""" """Get the list of available preset modes."""
return [ATTR_MODE_NATURE, ATTR_MODE_NORMAL] return [ATTR_MODE_NATURE, ATTR_MODE_NORMAL]
@ -1030,7 +1033,7 @@ class XiaomiFanMiot(XiaomiGenericFan):
return FanOperationMode return FanOperationMode
@property @property
def preset_mode(self): def preset_mode(self) -> str | None:
"""Get the active preset mode.""" """Get the active preset mode."""
return self._preset_mode return self._preset_mode

View file

@ -4,6 +4,7 @@ from __future__ import annotations
from abc import abstractmethod from abc import abstractmethod
import functools import functools
import math import math
from typing import Any
from zigpy.exceptions import ZigbeeException from zigpy.exceptions import ZigbeeException
from zigpy.zcl.clusters import hvac from zigpy.zcl.clusters import hvac
@ -87,7 +88,12 @@ class BaseFan(FanEntity):
"""Return the number of speeds the fan supports.""" """Return the number of speeds the fan supports."""
return int_states_in_range(SPEED_RANGE) return int_states_in_range(SPEED_RANGE)
async def async_turn_on(self, percentage=None, preset_mode=None, **kwargs) -> None: async def async_turn_on(
self,
percentage: int | None = None,
preset_mode: str | None = None,
**kwargs: Any,
) -> None:
"""Turn the entity on.""" """Turn the entity on."""
if percentage is None: if percentage is None:
percentage = DEFAULT_ON_PERCENTAGE percentage = DEFAULT_ON_PERCENTAGE

View file

@ -66,7 +66,7 @@ class ZWaveMeFan(ZWaveMeEntity, FanEntity):
self, self,
percentage: int | None = None, percentage: int | None = None,
preset_mode: str | None = None, preset_mode: str | None = None,
**kwargs, **kwargs: Any,
) -> None: ) -> None:
"""Turn on the fan.""" """Turn on the fan."""
self.set_percentage(percentage if percentage is not None else 99) self.set_percentage(percentage if percentage is not None else 99)