mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Fix expire_after requires MQTT (#354)
Fixes https://github.com/OttoWinter/esphomelib/issues/372
This commit is contained in:
parent
70016d7641
commit
8424f9c34b
@ -100,7 +100,8 @@ SENSOR_SCHEMA = cv.MQTT_COMPONENT_SCHEMA.extend({
|
|||||||
vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string_strict,
|
vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string_strict,
|
||||||
vol.Optional(CONF_ICON): cv.icon,
|
vol.Optional(CONF_ICON): cv.icon,
|
||||||
vol.Optional(CONF_ACCURACY_DECIMALS): vol.Coerce(int),
|
vol.Optional(CONF_ACCURACY_DECIMALS): vol.Coerce(int),
|
||||||
vol.Optional(CONF_EXPIRE_AFTER): vol.Any(None, cv.positive_time_period_milliseconds),
|
vol.Optional(CONF_EXPIRE_AFTER): vol.All(cv.requires_component('mqtt'),
|
||||||
|
vol.Any(None, cv.positive_time_period_milliseconds)),
|
||||||
vol.Optional(CONF_FILTERS): FILTERS_SCHEMA,
|
vol.Optional(CONF_FILTERS): FILTERS_SCHEMA,
|
||||||
vol.Optional(CONF_ON_VALUE): automation.validate_automation({
|
vol.Optional(CONF_ON_VALUE): automation.validate_automation({
|
||||||
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_variable_id(SensorStateTrigger),
|
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_variable_id(SensorStateTrigger),
|
||||||
|
Loading…
Reference in New Issue
Block a user