mirror of
https://github.com/esphome/esphome.git
synced 2024-12-01 03:04:12 +01:00
Update ebyte_lora.cpp
This commit is contained in:
parent
5f9d702287
commit
f8eb0c12a7
1 changed files with 2 additions and 1 deletions
|
@ -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_() {
|
||||
|
|
Loading…
Reference in a new issue