mirror of
https://github.com/esphome/esphome.git
synced 2025-09-27 23:52:28 +01:00
add SUB_BUTTON macro and ability to button schema to define the class (#4450)
* add ability to button schema to define the class * add SUB_BUTTON macro
This commit is contained in:
@@ -17,11 +17,11 @@ SafeModeButton = safe_mode_ns.class_("SafeModeButton", button.Button, cg.Compone
|
||||
|
||||
CONFIG_SCHEMA = (
|
||||
button.button_schema(
|
||||
SafeModeButton,
|
||||
device_class=DEVICE_CLASS_RESTART,
|
||||
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||
icon=ICON_RESTART_ALERT,
|
||||
)
|
||||
.extend({cv.GenerateID(): cv.declare_id(SafeModeButton)})
|
||||
.extend({cv.GenerateID(CONF_OTA): cv.use_id(OTAComponent)})
|
||||
.extend(cv.COMPONENT_SCHEMA)
|
||||
)
|
||||
|
Reference in New Issue
Block a user