mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	[climate_ir_lg] use this-> (#8687)
				
					
				
			This commit is contained in:
		| @@ -43,11 +43,11 @@ void LgIrClimate::transmit_state() { | |||||||
|   // ESP_LOGD(TAG, "climate_lg_ir mode_before_ code: 0x%02X", modeBefore_); |   // ESP_LOGD(TAG, "climate_lg_ir mode_before_ code: 0x%02X", modeBefore_); | ||||||
|  |  | ||||||
|   // Set command |   // Set command | ||||||
|   if (send_swing_cmd_) { |   if (this->send_swing_cmd_) { | ||||||
|     send_swing_cmd_ = false; |     this->send_swing_cmd_ = false; | ||||||
|     remote_state |= COMMAND_SWING; |     remote_state |= COMMAND_SWING; | ||||||
|   } else { |   } else { | ||||||
|     bool climate_is_off = (mode_before_ == climate::CLIMATE_MODE_OFF); |     bool climate_is_off = (this->mode_before_ == climate::CLIMATE_MODE_OFF); | ||||||
|     switch (this->mode) { |     switch (this->mode) { | ||||||
|       case climate::CLIMATE_MODE_COOL: |       case climate::CLIMATE_MODE_COOL: | ||||||
|         remote_state |= climate_is_off ? COMMAND_ON_COOL : COMMAND_COOL; |         remote_state |= climate_is_off ? COMMAND_ON_COOL : COMMAND_COOL; | ||||||
| @@ -71,7 +71,7 @@ void LgIrClimate::transmit_state() { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   mode_before_ = this->mode; |   this->mode_before_ = this->mode; | ||||||
|  |  | ||||||
|   ESP_LOGD(TAG, "climate_lg_ir mode code: 0x%02X", this->mode); |   ESP_LOGD(TAG, "climate_lg_ir mode code: 0x%02X", this->mode); | ||||||
|  |  | ||||||
| @@ -102,7 +102,7 @@ void LgIrClimate::transmit_state() { | |||||||
|     remote_state |= ((temp - 15) << TEMP_SHIFT); |     remote_state |= ((temp - 15) << TEMP_SHIFT); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   transmit_(remote_state); |   this->transmit_(remote_state); | ||||||
|   this->publish_state(); |   this->publish_state(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -187,7 +187,7 @@ bool LgIrClimate::on_receive(remote_base::RemoteReceiveData data) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void LgIrClimate::transmit_(uint32_t value) { | void LgIrClimate::transmit_(uint32_t value) { | ||||||
|   calc_checksum_(value); |   this->calc_checksum_(value); | ||||||
|   ESP_LOGD(TAG, "Sending climate_lg_ir code: 0x%02" PRIX32, value); |   ESP_LOGD(TAG, "Sending climate_lg_ir code: 0x%02" PRIX32, value); | ||||||
|  |  | ||||||
|   auto transmit = this->transmitter_->transmit(); |   auto transmit = this->transmitter_->transmit(); | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ class LgIrClimate : public climate_ir::ClimateIR { | |||||||
|  |  | ||||||
|   /// Override control to change settings of the climate device. |   /// Override control to change settings of the climate device. | ||||||
|   void control(const climate::ClimateCall &call) override { |   void control(const climate::ClimateCall &call) override { | ||||||
|     send_swing_cmd_ = call.get_swing_mode().has_value(); |     this->send_swing_cmd_ = call.get_swing_mode().has_value(); | ||||||
|     // swing resets after unit powered off |     // swing resets after unit powered off | ||||||
|     if (call.get_mode().has_value() && *call.get_mode() == climate::CLIMATE_MODE_OFF) |     if (call.get_mode().has_value() && *call.get_mode() == climate::CLIMATE_MODE_OFF) | ||||||
|       this->swing_mode = climate::CLIMATE_SWING_OFF; |       this->swing_mode = climate::CLIMATE_SWING_OFF; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user