mirror of
https://github.com/esphome/esphome.git
synced 2025-01-19 04:20:56 +00:00
Allow duration for deep_sleep.enter to be templateable (#1765)
This commit is contained in:
parent
66b0b6feeb
commit
5c3af1d3f6
@ -108,7 +108,9 @@ def to_code(config):
|
||||
DEEP_SLEEP_ENTER_SCHEMA = automation.maybe_simple_id(
|
||||
{
|
||||
cv.GenerateID(): cv.use_id(DeepSleepComponent),
|
||||
cv.Optional(CONF_SLEEP_DURATION): cv.positive_time_period_milliseconds,
|
||||
cv.Optional(CONF_SLEEP_DURATION): cv.templatable(
|
||||
cv.positive_time_period_milliseconds
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -346,6 +346,8 @@ text_sensor:
|
||||
- homeassistant.tag_scanned: 1234-abcd
|
||||
- deep_sleep.enter:
|
||||
sleep_duration: 30min
|
||||
- deep_sleep.enter:
|
||||
sleep_duration: !lambda "return 30 * 60 * 1000;"
|
||||
- platform: template
|
||||
name: 'Template Text Sensor'
|
||||
lambda: |-
|
||||
|
Loading…
x
Reference in New Issue
Block a user