Skip to content

Commit

Permalink
ewh: update time at next loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dentra committed Jun 24, 2024
1 parent 4753d7b commit b91eae9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/ewh/ewh_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ void EWHComponent::on_state(const ewh_state_t &state) {
#ifdef USE_TIME
auto time = this->time_->now();
if (time.is_valid() && state.clock_hours != time.hour && state.clock_minutes != time.minute) {
this->api_->set_clock(time.hour, time.minute);
this->defer([this]() {
auto time = this->time_->now();
this->api_->set_clock(time.hour, time.minute);
});
}
#endif
#ifdef USE_SWITCH
Expand Down

0 comments on commit b91eae9

Please sign in to comment.