From 271444b27fe5ecbb2844a9a63d3c6e1ac6a425f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Tue, 26 Mar 2024 19:13:20 +0000 Subject: [PATCH] Update lora.cpp --- esphome/components/lora/lora.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/lora/lora.cpp b/esphome/components/lora/lora.cpp index af10675dbe..1b1d910865 100644 --- a/esphome/components/lora/lora.cpp +++ b/esphome/components/lora/lora.cpp @@ -137,7 +137,7 @@ void Lora::send_pin_info_(uint8_t pin, bool value) { uint8_t data[3]; data[1] = 0xFF; // just some bit to indicate, yo this is pin info data[1] = pin; // Pin to send - data[2] = value; // high or low + data[2] = value; // Inverted for the pcf8574 ESP_LOGD(TAG, "Sending message"); ESP_LOGD(TAG, "PIN: %u ", data[1]); ESP_LOGD(TAG, "VALUE: %u ", data[2]); @@ -167,9 +167,9 @@ void Lora::loop() { if (this->message_text_sensor_ != nullptr) this->message_text_sensor_->publish_state("Got something"); if (this->pcf8574_ != nullptr) { - ESP_LOGD(TAG, " pcf8574_ PIN: %u ", data[1]); - ESP_LOGD(TAG, " pcf8574_ VALUE: %u ", data[2]); - this->pcf8574_->digital_write(data[1], data[2]); + ESP_LOGD(TAG, "pcf8574 PIN: %u ", data[1]); + ESP_LOGD(TAG, "pcf8574 VALUE: %u ", !data[2]); + this->pcf8574_->digital_write(data[1], !data[2]); } } else { ESP_LOGD(TAG, "WEIRD");