1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-10 23:32:23 +01:00

Remove double scheduling from addressable lights (#1963)

This commit is contained in:
Oxan van Leeuwen
2021-08-23 10:00:38 +02:00
committed by GitHub
parent 5ec9bb0fb5
commit 2f33cd2db5
12 changed files with 57 additions and 45 deletions

View File

@@ -50,13 +50,11 @@ class PartitionLightOutput : public light::AddressableLight {
}
}
light::LightTraits get_traits() override { return this->segments_[0].get_src()->get_traits(); }
void loop() override {
if (this->should_show_()) {
for (auto seg : this->segments_) {
seg.get_src()->schedule_show();
}
this->mark_shown_();
void write_state(light::LightState *state) override {
for (auto seg : this->segments_) {
seg.get_src()->schedule_show();
}
this->mark_shown_();
}
protected: