mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Adjust setup type hints in mqtt (#72227)
This commit is contained in:
parent
71d6a17073
commit
99ad785d0a
@ -1,9 +1,15 @@
|
||||
"""Support for MQTT vacuums."""
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import vacuum
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from ..mixins import async_setup_entry_helper, async_setup_platform_helper
|
||||
from .schema import CONF_SCHEMA, LEGACY, MQTT_VACUUM_SCHEMA, STATE
|
||||
@ -40,14 +46,23 @@ PLATFORM_SCHEMA = vol.All(
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up MQTT vacuum through configuration.yaml."""
|
||||
await async_setup_platform_helper(
|
||||
hass, vacuum.DOMAIN, config, async_add_entities, _async_setup_entity
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up MQTT vacuum dynamically through MQTT discovery."""
|
||||
setup = functools.partial(
|
||||
_async_setup_entity, hass, async_add_entities, config_entry=config_entry
|
||||
|
Loading…
x
Reference in New Issue
Block a user