Add switch setup type hints [n-r] (#63304)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-03 19:24:34 +01:00 committed by GitHub
parent f39531dcfc
commit e4a88e921f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 155 additions and 23 deletions

View file

@ -1,4 +1,6 @@
"""Switch platform integration for Numato USB GPIO expanders."""
from __future__ import annotations
import logging
from numato_gpio import NumatoGpioError
@ -9,14 +11,22 @@ from homeassistant.const import (
CONF_SWITCHES,
DEVICE_DEFAULT_NAME,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import CONF_INVERT_LOGIC, CONF_PORTS, DATA_API, DOMAIN
_LOGGER = logging.getLogger(__name__)
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 configured Numato USB GPIO switch ports."""
if discovery_info is None:
return