1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

Write pin inverted correction and switch state publishing correction

This commit is contained in:
Thierry DUVERNOY 2025-01-25 15:04:53 +01:00
parent 93efb803fb
commit 0fd4d2f4a0
2 changed files with 2 additions and 5 deletions

View File

@ -371,7 +371,7 @@ void DallasPio::ds2406_write_state_(bool state, bool use_crc = false) {
uint8_t channel_control_byte_2 = 0xFF;
uint8_t channel_info_byte;
uint16_t received_crc = 0;
uint8_t ds2406_write_state = state ? 0xFF : 0x00;
uint8_t ds2406_write_state = (state ^ this->pin_inverted_) ? 0xFF : 0x00;
{
InterruptLock lock;
this->send_command_(DALLAS_DS2406_COMMAND_CHANNEL_ACCESS);

View File

@ -62,10 +62,7 @@ void DallasPioSwitch::write_state(bool state) {
return;
}
this->status_clear_warning();
if (!this->dallas_pio_->write_state(state, this->pin_, this->pin_inverted_)) {
return;
}
this->dallas_pio_->write_state(state, this->pin_, this->pin_inverted_);
this->publish_state(state); // Set state in ESPHome
}