mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	toshiba: add support for quiet fan mode (#4283)
This commit is contained in:
		| @@ -190,6 +190,10 @@ void ToshibaClimate::transmit_generic_() { | |||||||
|  |  | ||||||
|   uint8_t fan; |   uint8_t fan; | ||||||
|   switch (this->fan_mode.value()) { |   switch (this->fan_mode.value()) { | ||||||
|  |     case climate::CLIMATE_FAN_QUIET: | ||||||
|  |       fan = TOSHIBA_FAN_SPEED_QUIET; | ||||||
|  |       break; | ||||||
|  |  | ||||||
|     case climate::CLIMATE_FAN_LOW: |     case climate::CLIMATE_FAN_LOW: | ||||||
|       fan = TOSHIBA_FAN_SPEED_1; |       fan = TOSHIBA_FAN_SPEED_1; | ||||||
|       break; |       break; | ||||||
| @@ -692,6 +696,30 @@ bool ToshibaClimate::on_receive(remote_base::RemoteReceiveData data) { | |||||||
|           this->mode = climate::CLIMATE_MODE_HEAT_COOL; |           this->mode = climate::CLIMATE_MODE_HEAT_COOL; | ||||||
|       } |       } | ||||||
|  |  | ||||||
|  |       // Get the fan mode | ||||||
|  |       switch (message[6] & 0xF0) { | ||||||
|  |         case TOSHIBA_FAN_SPEED_QUIET: | ||||||
|  |           this->fan_mode = climate::CLIMATE_FAN_QUIET; | ||||||
|  |           break; | ||||||
|  |  | ||||||
|  |         case TOSHIBA_FAN_SPEED_1: | ||||||
|  |           this->fan_mode = climate::CLIMATE_FAN_LOW; | ||||||
|  |           break; | ||||||
|  |  | ||||||
|  |         case TOSHIBA_FAN_SPEED_3: | ||||||
|  |           this->fan_mode = climate::CLIMATE_FAN_MEDIUM; | ||||||
|  |           break; | ||||||
|  |  | ||||||
|  |         case TOSHIBA_FAN_SPEED_5: | ||||||
|  |           this->fan_mode = climate::CLIMATE_FAN_HIGH; | ||||||
|  |           break; | ||||||
|  |  | ||||||
|  |         case TOSHIBA_FAN_SPEED_AUTO: | ||||||
|  |         default: | ||||||
|  |           this->fan_mode = climate::CLIMATE_FAN_AUTO; | ||||||
|  |           break; | ||||||
|  |       } | ||||||
|  |  | ||||||
|       // Get the target temperature |       // Get the target temperature | ||||||
|       this->target_temperature = (message[5] >> 4) + TOSHIBA_GENERIC_TEMP_C_MIN; |       this->target_temperature = (message[5] >> 4) + TOSHIBA_GENERIC_TEMP_C_MIN; | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ class ToshibaClimate : public climate_ir::ClimateIR { | |||||||
|   ToshibaClimate() |   ToshibaClimate() | ||||||
|       : climate_ir::ClimateIR(TOSHIBA_GENERIC_TEMP_C_MIN, TOSHIBA_GENERIC_TEMP_C_MAX, 1.0f, true, true, |       : climate_ir::ClimateIR(TOSHIBA_GENERIC_TEMP_C_MIN, TOSHIBA_GENERIC_TEMP_C_MAX, 1.0f, true, true, | ||||||
|                               {climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM, |                               {climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM, | ||||||
|                                climate::CLIMATE_FAN_HIGH}) {} |                                climate::CLIMATE_FAN_HIGH, climate::CLIMATE_FAN_QUIET}) {} | ||||||
|  |  | ||||||
|   void setup() override; |   void setup() override; | ||||||
|   void set_model(Model model) { this->model_ = model; } |   void set_model(Model model) { this->model_ = model; } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user