From f8eb0c12a735890bdfa559d77352b0fe269dc7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Thu, 28 Mar 2024 12:02:34 +0000 Subject: [PATCH] Update ebyte_lora.cpp --- esphome/components/ebyte_lora/ebyte_lora.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/ebyte_lora/ebyte_lora.cpp b/esphome/components/ebyte_lora/ebyte_lora.cpp index 90173e675e..b544dabbb4 100644 --- a/esphome/components/ebyte_lora/ebyte_lora.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora.cpp @@ -166,7 +166,7 @@ void EbyteLoraComponent::loop() { if (data[0] == SWITCH_INFO) { ESP_LOGD(TAG, "GOT INFO ", data.size()); uint8_t i = 1; - while (i < data.size()) { + while (i < data.size() - 1) { for (auto *sensor : this->sensors_) { if (sensor->get_pin() == data[i]) { sensor->publish_state(data[i + 1]); @@ -176,6 +176,7 @@ void EbyteLoraComponent::loop() { i = +2; } } + ESP_LOGD(TAG, "RSSI: %u % ", (data[data.size() - 1] / 255.0) * 100); } } void EbyteLoraComponent::send_switch_info_() {