mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
Add is_detected()
for Nextion displays (#5825)
This commit is contained in:
parent
c43518c391
commit
ccd7f0661c
2 changed files with 4 additions and 1 deletions
|
@ -93,7 +93,8 @@ bool Nextion::check_connect_() {
|
||||||
connect_info.push_back(response.substr(start, end - start));
|
connect_info.push_back(response.substr(start, end - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connect_info.size() == 7) {
|
this->is_detected_ = (connect_info.size() == 7);
|
||||||
|
if (this->is_detected_) {
|
||||||
ESP_LOGN(TAG, "Received connect_info %zu", connect_info.size());
|
ESP_LOGN(TAG, "Received connect_info %zu", connect_info.size());
|
||||||
|
|
||||||
this->device_model_ = connect_info[2];
|
this->device_model_ = connect_info[2];
|
||||||
|
|
|
@ -48,10 +48,12 @@ class NextionBase {
|
||||||
|
|
||||||
bool is_sleeping() { return this->is_sleeping_; }
|
bool is_sleeping() { return this->is_sleeping_; }
|
||||||
bool is_setup() { return this->is_setup_; }
|
bool is_setup() { return this->is_setup_; }
|
||||||
|
bool is_detected() { return this->is_detected_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool is_setup_ = false;
|
bool is_setup_ = false;
|
||||||
bool is_sleeping_ = false;
|
bool is_sleeping_ = false;
|
||||||
|
bool is_detected_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace nextion
|
} // namespace nextion
|
||||||
|
|
Loading…
Reference in a new issue