Add setup type hints (part 3) (#63961)
* Drop return value from vesync * Add setup type hints to netgear_lte * Drop return value from hyperion * Add setup type hints to opentherm_gw Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
0d58887bc0
commit
ec1b45c922
7 changed files with 42 additions and 15 deletions
|
@ -1,12 +1,22 @@
|
|||
"""Support for Netgear LTE sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from . import CONF_MONITORED_CONDITIONS, CONF_SENSOR, DATA_KEY, LTEEntity
|
||||
from .sensor_types import SENSOR_SMS, SENSOR_SMS_TOTAL, SENSOR_UNITS, SENSOR_USAGE
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info):
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up Netgear LTE sensor devices."""
|
||||
if discovery_info is None:
|
||||
return
|
||||
|
@ -19,7 +29,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info)
|
|||
sensor_conf = discovery_info[CONF_SENSOR]
|
||||
monitored_conditions = sensor_conf[CONF_MONITORED_CONDITIONS]
|
||||
|
||||
sensors = []
|
||||
sensors: list[SensorEntity] = []
|
||||
for sensor_type in monitored_conditions:
|
||||
if sensor_type == SENSOR_SMS:
|
||||
sensors.append(SMSUnreadSensor(modem_data, sensor_type))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue