Add device class support for button entity (#60560)
parent
a925451906
commit
9f26850a19
|
@ -6,6 +6,8 @@ from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import final
|
from typing import final
|
||||||
|
|
||||||
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.config_validation import ( # noqa: F401
|
from homeassistant.helpers.config_validation import ( # noqa: F401
|
||||||
|
@ -28,6 +30,13 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
DEVICE_CLASS_RESTART = "restart"
|
||||||
|
DEVICE_CLASS_UPDATE = "update"
|
||||||
|
|
||||||
|
DEVICE_CLASSES = [DEVICE_CLASS_RESTART, DEVICE_CLASS_UPDATE]
|
||||||
|
|
||||||
|
DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES))
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
"""Set up Button entities."""
|
"""Set up Button entities."""
|
||||||
|
|
Loading…
Reference in New Issue