Skip to content

Commit

Permalink
2024.1.0: Fix for on_show_display on_night_mode on_next_screen
Browse files Browse the repository at this point in the history
…triggers
  • Loading branch information
andrewjswan authored Jan 30, 2024
1 parent 8e3f8d7 commit 07642b2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/ehmtxv2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def rgb565_888(v565):
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(AddScreenTrigger),
}
),
cv.Optional(CONF_ON_EXPIRED_SCREEN): automation.validate_automation(
cv.Optional(CONF_ON_NEXT_SCREEN): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(NextScreenTrigger),
}
Expand Down Expand Up @@ -655,4 +655,12 @@ def thumbnails(frames):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [] , conf)

for conf in config.get(CONF_ON_SHOW_DISPLAY, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(bool, "state")] , conf)

for conf in config.get(CONF_ON_NIGHT_MODE, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(bool, "state")] , conf)

await cg.register_component(var, config)

0 comments on commit 07642b2

Please sign in to comment.