1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-25 13:13:48 +01:00

[datetime] Fix DateTimeStateTrigger compilation when time component is not used (#11287)

This commit is contained in:
J. Nick Koston
2025-10-15 23:45:42 -10:00
committed by Jesse Hills
parent 070b0882b8
commit 9c235b4140

View File

@@ -30,14 +30,12 @@ class DateTimeBase : public EntityBase {
#endif
};
#ifdef USE_TIME
class DateTimeStateTrigger : public Trigger<ESPTime> {
public:
explicit DateTimeStateTrigger(DateTimeBase *parent) {
parent->add_on_state_callback([this, parent]() { this->trigger(parent->state_as_esptime()); });
}
};
#endif
} // namespace datetime
} // namespace esphome