Update ebyte_lora_component.h

This commit is contained in:
Daniël Koek 2024-06-03 15:23:31 +01:00
parent 443c155cdd
commit 7a344b082e

View file

@ -97,7 +97,12 @@ class EbyteLoraSwitch : public switch_::Switch, public Parented<EbyteLoraCompone
uint8_t get_pin() { return pin_; }
protected:
void write_state(bool state) override { this->parent_->send_switch_info_(); }
void write_state(bool state) override {
// set it first
this->publish_state(state);
// then tell the world about it
this->parent_->send_switch_info_();
}
uint8_t pin_;
};
#endif