mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Allow duration for deep_sleep.enter to be templateable (#1765)
This commit is contained in:
parent
66b0b6feeb
commit
5c3af1d3f6
2 changed files with 5 additions and 1 deletions
|
@ -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…
Reference in a new issue