mirror of
https://github.com/esphome/esphome.git
synced 2026-10-22 05:46:12 +00:00
[factory_reset] Keep the node's own factory reset button on button_schema
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import esphome.codegen as cg
|
||||
from esphome.components import button
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID
|
||||
from esphome.const import (
|
||||
CONF_ID,
|
||||
DEVICE_CLASS_RESTART,
|
||||
ENTITY_CATEGORY_CONFIG,
|
||||
ICON_RESTART_ALERT,
|
||||
)
|
||||
from esphome.types import ConfigType
|
||||
|
||||
from .. import factory_reset_ns
|
||||
@@ -10,9 +15,12 @@ FactoryResetButton = factory_reset_ns.class_(
|
||||
"FactoryResetButton", button.Button, cg.Component
|
||||
)
|
||||
|
||||
CONFIG_SCHEMA = button.factory_reset_button_schema(FactoryResetButton).extend(
|
||||
cv.COMPONENT_SCHEMA
|
||||
)
|
||||
CONFIG_SCHEMA = button.button_schema(
|
||||
FactoryResetButton,
|
||||
device_class=DEVICE_CLASS_RESTART,
|
||||
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||
icon=ICON_RESTART_ALERT,
|
||||
).extend(cv.COMPONENT_SCHEMA)
|
||||
|
||||
|
||||
async def to_code(config: ConfigType) -> None:
|
||||
|
||||
Reference in New Issue
Block a user