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

Fix GPIO Switch not handling inverted #387

Merged
merged 1 commit into from
Jan 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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