Use AddEntitiesCallback type, pt.3 (#49953)

This commit is contained in:
Ruslan Sayfutdinov 2021-05-04 22:36:48 +01:00 committed by GitHub
parent 4d939486a9
commit 004fa63dbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 113 additions and 106 deletions

View file

@ -1,15 +1,13 @@
"""Support for Litter-Robot sensors."""
from __future__ import annotations
from typing import Callable
from pylitterbot.robot import Robot
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, PERCENTAGE
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN
from .entity import LitterRobotEntity
@ -83,7 +81,7 @@ ROBOT_SENSORS: list[tuple[type[LitterRobotPropertySensor], str, str]] = [
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
async_add_entities: Callable[[list[Entity], bool], None],
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up Litter-Robot sensors using config entry."""
hub: LitterRobotHub = hass.data[DOMAIN][entry.entry_id]