And done!

This commit is contained in:
Daniël Koek 2024-03-26 17:51:53 +00:00
parent 76b276516a
commit ca950d68e4
2 changed files with 6 additions and 11 deletions

View file

@ -164,15 +164,6 @@ void Lora::loop() {
} else {
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

View file

@ -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