mirror of
https://github.com/home-assistant/core.git
synced 2025-08-09 15:45:08 +02:00
Add setup type hints to iperf3
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
"""Support for Iperf3 sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
||||
from homeassistant.const import ATTR_ATTRIBUTION
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from . import ATTR_VERSION, DATA_UPDATED, DOMAIN as IPERF3_DOMAIN, SENSOR_TYPES
|
||||
|
||||
@@ -16,8 +20,16 @@ ATTR_REMOTE_HOST = "Remote Server"
|
||||
ATTR_REMOTE_PORT = "Remote Port"
|
||||
|
||||
|
||||
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 the Iperf3 sensor."""
|
||||
if not discovery_info:
|
||||
return
|
||||
|
||||
entities = [
|
||||
Iperf3Sensor(iperf3_host, description)
|
||||
for iperf3_host in hass.data[IPERF3_DOMAIN].values()
|
||||
|
Reference in New Issue
Block a user