mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 09:44:12 +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, "VALUE: %u ", data[2]);
|
||||||
ESP_LOGD(TAG, "RSSI: %u ", data[3]);
|
ESP_LOGD(TAG, "RSSI: %u ", data[3]);
|
||||||
} else {
|
} 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 lora
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
|
@ -4,7 +4,11 @@ namespace esphome {
|
||||||
namespace lora {
|
namespace lora {
|
||||||
static const char *const TAG_SWITCH = "lora.switch";
|
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); }
|
void LoraSwitch::dump_config() { LOG_SWITCH(TAG_SWITCH, "Lora Switch", this); }
|
||||||
} // namespace lora
|
} // namespace lora
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
Loading…
Reference in a new issue