diff --git a/esphome/components/lora/lora.cpp b/esphome/components/lora/lora.cpp index 23a1b3f827..5203087acf 100644 --- a/esphome/components/lora/lora.cpp +++ b/esphome/components/lora/lora.cpp @@ -162,17 +162,8 @@ void Lora::loop() { ESP_LOGD(TAG, "VALUE: %u ", data[2]); ESP_LOGD(TAG, "RSSI: %u ", data[3]); } else { - ESP_LOGD(TAG, "WEIRD "); + ESP_LOGD(TAG, "WEIRD"); } - - // char *ptr; - // // set the rssi - // rssi_ = strtol(buffer.substr(buffer.length() - 1, 1).c_str(), &ptr, 2); - // ESP_LOGD(TAG, "RSSI: %u ", rssi_); - // // set the raw message - // if (!pin_data_found) { - // raw_message_ = buffer.substr(0, buffer.length() - 1); - // } } } // namespace lora } // namespace esphome diff --git a/esphome/components/lora/switch/switch_lora.cpp b/esphome/components/lora/switch/switch_lora.cpp index ba026799d1..5bac173af1 100644 --- a/esphome/components/lora/switch/switch_lora.cpp +++ b/esphome/components/lora/switch/switch_lora.cpp @@ -4,7 +4,11 @@ namespace esphome { namespace lora { static const char *const TAG_SWITCH = "lora.switch"; -void LoraSwitch::write_state(bool state) { this->parent_->digital_write(this->pin_, state != this->inverted_); } +void LoraSwitch::write_state(bool state) { + this->parent_->digital_write(this->pin_, state != this->inverted_); + // finally set it + this->publish_state(state); +} void LoraSwitch::dump_config() { LOG_SWITCH(TAG_SWITCH, "Lora Switch", this); } } // namespace lora } // namespace esphome