Add sensor setup type hints [o-q] (#63313)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-03 19:10:57 +01:00 committed by GitHub
parent 80b6195505
commit 9184eb8916
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 199 additions and 29 deletions

View file

@ -5,10 +5,14 @@ from pyplaato.models.device import PlaatoDevice
from pyplaato.plaato import PlaatoKeg
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import ATTR_TEMP, SENSOR_UPDATE
from ...core import callback
@ -24,11 +28,18 @@ from .const import (
from .entity import PlaatoEntity
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 Plaato sensor."""
async def async_setup_entry(hass, entry, async_add_entities):
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up Plaato from a config entry."""
entry_data = hass.data[DOMAIN][entry.entry_id]