Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Fix GPIO Switch not handling inverted (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
OttoWinter committed Jan 13, 2019
1 parent c03ed40 commit 27c54a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/esphomelib/switch_/gpio_switch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ void GPIOSwitch::setup() {
}

// write state before setup
this->pin_->digital_write(initial_state);
this->pin_->digital_write(initial_state != this->inverted_);
this->pin_->setup();
// write after setup again for other IOs
this->pin_->digital_write(initial_state);
this->pin_->digital_write(initial_state != this->inverted_);
this->publish_state(initial_state);
}
void GPIOSwitch::dump_config() {
Expand Down

0 comments on commit 27c54a0

Please sign in to comment.