Add device class support for button entity (#60560)

pull/60564/head
Franck Nijhof 2021-11-30 01:44:21 +01:00 committed by GitHub
parent a925451906
commit 9f26850a19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,8 @@ from datetime import datetime, timedelta
import logging
from typing import final
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.config_validation import ( # noqa: F401
@ -28,6 +30,13 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
_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:
"""Set up Button entities."""