mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	Add is_detected() for Nextion displays (#5825)
				
					
				
			This commit is contained in:
		| @@ -93,7 +93,8 @@ bool Nextion::check_connect_() { | ||||
|     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()); | ||||
|  | ||||
|     this->device_model_ = connect_info[2]; | ||||
|   | ||||
| @@ -48,10 +48,12 @@ class NextionBase { | ||||
|  | ||||
|   bool is_sleeping() { return this->is_sleeping_; } | ||||
|   bool is_setup() { return this->is_setup_; } | ||||
|   bool is_detected() { return this->is_detected_; } | ||||
|  | ||||
|  protected: | ||||
|   bool is_setup_ = false; | ||||
|   bool is_sleeping_ = false; | ||||
|   bool is_detected_ = false; | ||||
| }; | ||||
|  | ||||
| }  // namespace nextion | ||||
|   | ||||
		Reference in New Issue
	
	Block a user