mirror of
https://github.com/home-assistant/core.git
synced 2026-10-01 00:23:27 +01:00
30 lines
670 B
Python
30 lines
670 B
Python
"""Provides the constants needed for the component."""
|
|
|
|
from enum import StrEnum
|
|
from typing import TYPE_CHECKING, Final
|
|
|
|
import probatio
|
|
|
|
from homeassistant.util.hass_dict import HassKey
|
|
|
|
if TYPE_CHECKING:
|
|
from homeassistant.helpers.entity_component import EntityComponent
|
|
|
|
from . import ButtonEntity
|
|
|
|
DOMAIN: Final = "button"
|
|
DATA_COMPONENT: HassKey[EntityComponent[ButtonEntity]] = HassKey(DOMAIN)
|
|
|
|
SERVICE_PRESS = "press"
|
|
|
|
|
|
class ButtonDeviceClass(StrEnum):
|
|
"""Device class for buttons."""
|
|
|
|
IDENTIFY = "identify"
|
|
RESTART = "restart"
|
|
UPDATE = "update"
|
|
|
|
|
|
DEVICE_CLASSES_SCHEMA = probatio.All(probatio.Lower, probatio.Coerce(ButtonDeviceClass))
|