mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
Button device class (#2835)
This commit is contained in:
@@ -3,15 +3,17 @@ import esphome.config_validation as cv
|
||||
from esphome.components import button
|
||||
from esphome.const import (
|
||||
CONF_ID,
|
||||
DEVICE_CLASS_RESTART,
|
||||
ENTITY_CATEGORY_CONFIG,
|
||||
ICON_RESTART,
|
||||
)
|
||||
|
||||
restart_ns = cg.esphome_ns.namespace("restart")
|
||||
RestartButton = restart_ns.class_("RestartButton", button.Button, cg.Component)
|
||||
|
||||
CONFIG_SCHEMA = (
|
||||
button.button_schema(icon=ICON_RESTART, entity_category=ENTITY_CATEGORY_CONFIG)
|
||||
button.button_schema(
|
||||
device_class=DEVICE_CLASS_RESTART, entity_category=ENTITY_CATEGORY_CONFIG
|
||||
)
|
||||
.extend({cv.GenerateID(): cv.declare_id(RestartButton)})
|
||||
.extend(cv.COMPONENT_SCHEMA)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user