Update ebyte_lora_component.cpp

This commit is contained in:
Daniël Koek 2024-06-03 15:17:56 +01:00
parent 679676543d
commit 17e56598c7

View file

@ -418,7 +418,8 @@ void EbyteLoraComponent::loop() {
ESP_LOGD(TAG, "Got switch info, making sure it is itself"); ESP_LOGD(TAG, "Got switch info, making sure it is itself");
// Make sure it is not itself // Make sure it is not itself
if (network_id != data[1]) { if (network_id != data[1]) {
for (int i = 2; i < data.size(); i = i + 2) { // last data bit is rssi
for (int i = 2; i < data.size() - 1; i = i + 2) {
uint8_t pin = data[i]; uint8_t pin = data[i];
bool value = data[i + 1]; bool value = data[i + 1];
for (auto *sensor : this->sensors_) { for (auto *sensor : this->sensors_) {