Add setup type hints (part 2) (#63960)

* Add setup type hints to demo

* Add setup type hints to group

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-12 09:28:14 +01:00 committed by GitHub
parent 67c35652f0
commit 29d58e427b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -15,7 +15,7 @@ async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType = None,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the demo Button entity."""
async_add_entities(

View File

@ -16,7 +16,7 @@ async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType = None,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the demo Select entity."""
async_add_entities(

View File

@ -12,18 +12,18 @@ from homeassistant.components.siren.const import (
SUPPORT_VOLUME_SET,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Config, HomeAssistant
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import DiscoveryInfoType
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
SUPPORT_FLAGS = SUPPORT_TURN_OFF | SUPPORT_TURN_ON
async def async_setup_platform(
hass: HomeAssistant,
config: Config,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType = None,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the Demo siren devices."""
async_add_entities(

View File

@ -1,7 +1,6 @@
"""This platform allows several media players to be grouped into one media player."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any
import voluptuous as vol
@ -57,6 +56,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant, State, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType, EventType
@ -83,7 +83,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: Callable,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the Media Group platform."""