[factory_reset] Keep the node's own factory reset button on button_schema

This commit is contained in:
J. Nick Koston
2026-10-17 06:38:50 -10:00
committed by GitHub
parent 012e440e3e
commit 394fa7a140
@@ -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: