Add setup type hints [o-q] (#63465)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
754f4c52c2
commit
8756fa28e2
9 changed files with 106 additions and 25 deletions
|
@ -28,8 +28,11 @@ from homeassistant.const import (
|
|||
PERCENTAGE,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -193,7 +196,12 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
def setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up the QNAP NAS sensor."""
|
||||
api = QNAPStatsAPI(config)
|
||||
api.update()
|
||||
|
@ -203,7 +211,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
raise PlatformNotReady
|
||||
|
||||
monitored_conditions = config[CONF_MONITORED_CONDITIONS]
|
||||
sensors = []
|
||||
sensors: list[QNAPSensor] = []
|
||||
|
||||
# Basic sensors
|
||||
sensors.extend(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue