mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Add Platform StrEnum to entity_platform (#60818)
This commit is contained in:
parent
4107063a5a
commit
7d3fcfbd30
@ -1,27 +1,21 @@
|
||||
"""Support for WLED."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
|
||||
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN
|
||||
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
|
||||
from homeassistant.components.number import DOMAIN as NUMBER_DOMAIN
|
||||
from homeassistant.components.select import DOMAIN as SELECT_DOMAIN
|
||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import Platform
|
||||
|
||||
from .const import DOMAIN
|
||||
from .coordinator import WLEDDataUpdateCoordinator
|
||||
|
||||
PLATFORMS = (
|
||||
BINARY_SENSOR_DOMAIN,
|
||||
BUTTON_DOMAIN,
|
||||
LIGHT_DOMAIN,
|
||||
SELECT_DOMAIN,
|
||||
SENSOR_DOMAIN,
|
||||
SWITCH_DOMAIN,
|
||||
NUMBER_DOMAIN,
|
||||
Platform.BINARY_SENSOR,
|
||||
Platform.BUTTON,
|
||||
Platform.LIGHT,
|
||||
Platform.NUMBER,
|
||||
Platform.SELECT,
|
||||
Platform.SENSOR,
|
||||
Platform.SWITCH,
|
||||
)
|
||||
|
||||
|
||||
|
@ -34,6 +34,7 @@ from homeassistant.exceptions import (
|
||||
)
|
||||
from homeassistant.setup import async_start_setup
|
||||
from homeassistant.util.async_ import run_callback_threadsafe
|
||||
from homeassistant.util.enum import StrEnum
|
||||
|
||||
from . import (
|
||||
config_validation as cv,
|
||||
@ -62,6 +63,41 @@ PLATFORM_NOT_READY_BASE_WAIT_TIME = 30 # seconds
|
||||
_LOGGER = getLogger(__name__)
|
||||
|
||||
|
||||
class Platform(StrEnum):
|
||||
"""Available platforms."""
|
||||
|
||||
AIR_QUALITY = "air_quality"
|
||||
ALARM_CONTROL_PANEL = "alarm_control_panel"
|
||||
BINARY_SENSOR = "binary_sensor"
|
||||
BUTTON = "button"
|
||||
CALENDAR = "calendar"
|
||||
CAMERA = "camera"
|
||||
CLIMATE = "climate"
|
||||
COVER = "cover"
|
||||
DEVICE_TRACKER = "device_tracker"
|
||||
FAN = "fan"
|
||||
GEO_LOCATION = "geo_location"
|
||||
HUMIDIFIER = "humidifier"
|
||||
IMAGE_PROCESSING = "image_processing"
|
||||
LIGHT = "light"
|
||||
LOCK = "lock"
|
||||
MAILBOX = "mailbox"
|
||||
MEDIA_PLAYER = "media_player"
|
||||
NOTIFY = "notify"
|
||||
NUMBER = "number"
|
||||
REMOTE = "remote"
|
||||
SCENE = "scene"
|
||||
SELECT = "select"
|
||||
SENSOR = "sensor"
|
||||
SIREN = "siren"
|
||||
SST = "sst"
|
||||
SWITCH = "switch"
|
||||
TTS = "tts"
|
||||
VACUUM = "vacuum"
|
||||
WATER_HEATER = "water_heater"
|
||||
WEATHER = "weather"
|
||||
|
||||
|
||||
class AddEntitiesCallback(Protocol):
|
||||
"""Protocol type for EntityPlatform.add_entities callback."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user