Add light.on_state trigger (#2868)

This commit is contained in:
tony
2021-12-12 15:19:57 -05:00
committed by GitHub
parent beeb0c7c5a
commit 9c0506592b
3 changed files with 18 additions and 0 deletions
+7
View File
@@ -141,6 +141,13 @@ class LightTurnOffTrigger : public Trigger<> {
}
};
class LightStateTrigger : public Trigger<> {
public:
LightStateTrigger(LightState *a_light) {
a_light->add_new_remote_values_callback([this]() { this->trigger(); });
}
};
// This is slightly ugly, but we can't log in headers, and can't make this a static method on AddressableSet
// due to the template. It's just a temporary warning anyway.
void addressableset_warn_about_scale(const char *field);