Add sensor setup type hints [g-h] (#63316)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
a9901356c3
commit
30a64bd0f2
18 changed files with 150 additions and 25 deletions
|
@ -1,4 +1,6 @@
|
|||
"""Sensor for retrieving latest GitLab CI job information."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
|
@ -13,7 +15,10 @@ from homeassistant.const import (
|
|||
CONF_TOKEN,
|
||||
CONF_URL,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
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__)
|
||||
|
@ -49,7 +54,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 GitLab sensor platform."""
|
||||
_name = config.get(CONF_NAME)
|
||||
_interval = config.get(CONF_SCAN_INTERVAL, SCAN_INTERVAL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue