diff --git a/components/ehmtxv2/__init__.py b/components/ehmtxv2/__init__.py index d3cfabc8..7fdfd07e 100644 --- a/components/ehmtxv2/__init__.py +++ b/components/ehmtxv2/__init__.py @@ -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), } @@ -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)