[deep_sleep] Fix sleep_duration codegen type to uint32_t (#15965)

This commit is contained in:
J. Nick Koston
2026-04-24 02:19:59 -05:00
committed by GitHub
parent 404620b99c
commit eceb534895
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -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:
+6
View File
@@ -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