Use AddEntitiesCallback type, pt.2 (#49921)

This commit is contained in:
Ruslan Sayfutdinov 2021-04-30 19:38:59 +01:00 committed by GitHub
parent 4ed74cd2f5
commit cbaeec2a4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 91 additions and 103 deletions

View file

@ -1,6 +1,5 @@
"""This platform provides support for sensor data from RainMachine."""
from functools import partial
from typing import Callable
from regenmaschine.controller import Controller
@ -8,6 +7,7 @@ from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import TEMP_CELSIUS, VOLUME_CUBIC_METERS
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from . import RainMachineEntity
@ -70,7 +70,7 @@ SENSORS = {
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up RainMachine sensors based on a config entry."""
controller = hass.data[DOMAIN][DATA_CONTROLLER][entry.entry_id]