mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 01:34:18 +01:00
Update ebyte_lora_component.h
This commit is contained in:
parent
443c155cdd
commit
7a344b082e
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue