mirror of
https://github.com/esphome/esphome.git
synced 2024-12-29 00:41:44 +01:00
And done!
This commit is contained in:
parent
76b276516a
commit
ca950d68e4
2 changed files with 6 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue