mirror of
https://github.com/esphome/esphome.git
synced 2025-03-16 07:38:17 +00:00
Write pin inverted correction and switch state publishing correction
This commit is contained in:
parent
93efb803fb
commit
0fd4d2f4a0
@ -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_control_byte_2 = 0xFF;
|
||||||
uint8_t channel_info_byte;
|
uint8_t channel_info_byte;
|
||||||
uint16_t received_crc = 0;
|
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;
|
InterruptLock lock;
|
||||||
this->send_command_(DALLAS_DS2406_COMMAND_CHANNEL_ACCESS);
|
this->send_command_(DALLAS_DS2406_COMMAND_CHANNEL_ACCESS);
|
||||||
|
@ -62,10 +62,7 @@ void DallasPioSwitch::write_state(bool state) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->status_clear_warning();
|
this->status_clear_warning();
|
||||||
|
this->dallas_pio_->write_state(state, this->pin_, this->pin_inverted_);
|
||||||
if (!this->dallas_pio_->write_state(state, this->pin_, this->pin_inverted_)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this->publish_state(state); // Set state in ESPHome
|
this->publish_state(state); // Set state in ESPHome
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user