Add sensor setup type hints [r] (#63312)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
595e8a327c
commit
822ac203c3
13 changed files with 128 additions and 14 deletions
|
@ -1,4 +1,6 @@
|
|||
"""Support for Rflink sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from rflink.parser import PACKET_FIELDS, UNITS
|
||||
import voluptuous as vol
|
||||
|
||||
|
@ -10,8 +12,11 @@ from homeassistant.const import (
|
|||
CONF_SENSOR_TYPE,
|
||||
CONF_UNIT_OF_MEASUREMENT,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from . import (
|
||||
CONF_ALIASES,
|
||||
|
@ -77,7 +82,12 @@ def devices_from_config(domain_config):
|
|||
return devices
|
||||
|
||||
|
||||
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 Rflink platform."""
|
||||
async_add_entities(devices_from_config(config))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue