mirror of
https://github.com/esphome/esphome.git
synced 2026-05-30 23:54:04 +08:00
[deep_sleep] Fix sleep_duration codegen type to uint32_t (#15965)
This commit is contained in:
@@ -417,7 +417,7 @@ async def deep_sleep_enter_to_code(config, action_id, template_arg, args):
|
|||||||
paren = await cg.get_variable(config[CONF_ID])
|
paren = await cg.get_variable(config[CONF_ID])
|
||||||
var = cg.new_Pvariable(action_id, template_arg, paren)
|
var = cg.new_Pvariable(action_id, template_arg, paren)
|
||||||
if CONF_SLEEP_DURATION in config:
|
if CONF_SLEEP_DURATION in config:
|
||||||
template_ = await cg.templatable(config[CONF_SLEEP_DURATION], args, cg.int32)
|
template_ = await cg.templatable(config[CONF_SLEEP_DURATION], args, cg.uint32)
|
||||||
cg.add(var.set_sleep_duration(template_))
|
cg.add(var.set_sleep_duration(template_))
|
||||||
|
|
||||||
if CONF_UNTIL in config:
|
if CONF_UNTIL in config:
|
||||||
|
|||||||
@@ -4,3 +4,9 @@ esphome:
|
|||||||
- deep_sleep.prevent
|
- deep_sleep.prevent
|
||||||
- delay: 1s
|
- delay: 1s
|
||||||
- deep_sleep.allow
|
- deep_sleep.allow
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
lambda: 'return false;'
|
||||||
|
then:
|
||||||
|
- deep_sleep.enter:
|
||||||
|
sleep_duration: 60min
|
||||||
|
|||||||
Reference in New Issue
Block a user