mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 10:00:36 +01:00
Fix restore (#4655)
* ALWAYS_OFF for fan * ALWAYS_OFF for light * ALWAYS_OFF for switch
This commit is contained in:
parent
0547f2a931
commit
4eb69d6af5
@ -63,7 +63,7 @@ FanIsOffCondition = fan_ns.class_("FanIsOffCondition", automation.Condition.temp
|
||||
FAN_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(Fan),
|
||||
cv.Optional(CONF_RESTORE_MODE, default="RESTORE_DEFAULT_OFF"): cv.enum(
|
||||
cv.Optional(CONF_RESTORE_MODE, default="ALWAYS_OFF"): cv.enum(
|
||||
RESTORE_MODES, upper=True, space="_"
|
||||
),
|
||||
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(mqtt.MQTTFanComponent),
|
||||
|
@ -60,7 +60,7 @@ LIGHT_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).ex
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(LightState),
|
||||
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(mqtt.MQTTJSONLightComponent),
|
||||
cv.Optional(CONF_RESTORE_MODE, default="restore_default_off"): cv.enum(
|
||||
cv.Optional(CONF_RESTORE_MODE, default="ALWAYS_OFF"): cv.enum(
|
||||
RESTORE_MODES, upper=True, space="_"
|
||||
),
|
||||
cv.Optional(CONF_ON_TURN_ON): auto.validate_automation(
|
||||
|
@ -92,7 +92,7 @@ def switch_schema(
|
||||
device_class: str = _UNDEF,
|
||||
icon: str = _UNDEF,
|
||||
block_inverted: bool = False,
|
||||
default_restore_mode: str = "RESTORE_DEFAULT_OFF",
|
||||
default_restore_mode: str = "ALWAYS_OFF",
|
||||
):
|
||||
schema = _SWITCH_SCHEMA.extend(
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user