mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 00:51:49 +00:00 
			
		
		
		
	check if the select is configured
This commit is contained in:
		@@ -140,6 +140,7 @@ void LD2420Component::setup() {
 | 
			
		||||
  if (get_firmware_int_(ld2420_firmware_ver_) < CALIBRATE_VERSION_MIN) {
 | 
			
		||||
    this->set_operating_mode(OP_SIMPLE_MODE_STRING);
 | 
			
		||||
#ifdef USE_SELECT
 | 
			
		||||
    if (this->operating_selector_ != nullptr)
 | 
			
		||||
      this->operating_selector_->publish_state(OP_SIMPLE_MODE_STRING);
 | 
			
		||||
#endif
 | 
			
		||||
    this->set_mode_(CMD_SYSTEM_MODE_SIMPLE);
 | 
			
		||||
@@ -147,6 +148,7 @@ void LD2420Component::setup() {
 | 
			
		||||
  } else {
 | 
			
		||||
    this->set_mode_(CMD_SYSTEM_MODE_ENERGY);
 | 
			
		||||
#ifdef USE_SELECT    
 | 
			
		||||
    if (this->operating_selector_ != nullptr)
 | 
			
		||||
      this->operating_selector_->publish_state(OP_NORMAL_MODE_STRING);
 | 
			
		||||
#endif
 | 
			
		||||
  }
 | 
			
		||||
@@ -300,6 +302,7 @@ void LD2420Component::set_operating_mode(const std::string &state) {
 | 
			
		||||
    this->current_operating_mode = OP_MODE_TO_UINT.at(state);
 | 
			
		||||
    // Entering Auto Calibrate we need to clear the privoiuos data collection
 | 
			
		||||
#ifdef USE_SELECT
 | 
			
		||||
    if (this->operating_selector_ != nullptr)
 | 
			
		||||
      this->operating_selector_->publish_state(state);
 | 
			
		||||
#endif
 | 
			
		||||
    if (current_operating_mode == OP_CALIBRATE_MODE) {
 | 
			
		||||
@@ -321,6 +324,7 @@ void LD2420Component::set_operating_mode(const std::string &state) {
 | 
			
		||||
  } else {
 | 
			
		||||
    this->current_operating_mode = OP_SIMPLE_MODE;
 | 
			
		||||
#ifdef USE_SELECT
 | 
			
		||||
    if (this->operating_selector_ != nullptr)
 | 
			
		||||
      this->operating_selector_->publish_state(OP_SIMPLE_MODE_STRING);
 | 
			
		||||
#endif
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user