Add sensor setup type hints [g-h] (#63316)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-03 19:13:59 +01:00 committed by GitHub
parent a9901356c3
commit 30a64bd0f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 150 additions and 25 deletions

View file

@ -4,8 +4,10 @@ from __future__ import annotations
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.core import callback
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import dt
from .const import DEFAULT_ICON, DOMAIN, FEED
@ -26,7 +28,9 @@ DEFAULT_UNIT_OF_MEASUREMENT = "alerts"
PARALLEL_UPDATES = 0
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 the GDACS Feed platform."""
manager = hass.data[DOMAIN][FEED][entry.entry_id]
sensor = GdacsSensor(entry.entry_id, entry.unique_id, entry.title, manager)