Add fan setup type hints (#63287)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet
2022-01-03 15:10:53 +01:00
committed by GitHub
parent 457ce195dd
commit 71cb42f53a
11 changed files with 97 additions and 19 deletions

View File

@@ -1,12 +1,15 @@
"""Platform to control a Salda Smarty XP/XV ventilation unit."""
from __future__ import annotations
import logging
import math
from homeassistant.components.fan import SUPPORT_SET_SPEED, FanEntity
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from homeassistant.util.percentage import (
int_states_in_range,
percentage_to_ranged_value,
@@ -21,7 +24,12 @@ DEFAULT_ON_PERCENTAGE = 66
SPEED_RANGE = (1, 3) # off is not included
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the Smarty Fan Platform."""
smarty = hass.data[DOMAIN]["api"]
name = hass.data[DOMAIN]["name"]