ESPHome 2026.5.0
Loading...
Searching...
No Matches
midea_ir.h
Go to the documentation of this file.
1#pragma once
2
4#include "midea_data.h"
5
6namespace esphome::midea_ir {
7
8// Temperature
9const uint8_t MIDEA_TEMPC_MIN = 17; // Celsius
10const uint8_t MIDEA_TEMPC_MAX = 30; // Celsius
11const uint8_t MIDEA_TEMPF_MIN = 62; // Fahrenheit
12const uint8_t MIDEA_TEMPF_MAX = 86; // Fahrenheit
13
15 public:
23
25 void control(const climate::ClimateCall &call) override;
26
28 void set_fahrenheit(bool value) {
29 this->fahrenheit_ = value;
30 this->temperature_step_ = value ? 0.5f : 1.0f;
31 }
32
33 protected:
35 void transmit_state() override;
36 void transmit_(MideaData &data);
39 bool on_midea_(const MideaData &data);
40 bool fahrenheit_{false};
41 bool swing_{false};
42 bool boost_{false};
43};
44
45} // namespace esphome::midea_ir
ClimateIR(float minimum_temperature, float maximum_temperature, float temperature_step=1.0f, bool supports_dry=false, bool supports_fan_only=false, climate::ClimateFanModeMask fan_modes=climate::ClimateFanModeMask(), climate::ClimateSwingModeMask swing_modes=climate::ClimateSwingModeMask(), climate::ClimatePresetMask presets=climate::ClimatePresetMask())
Definition climate_ir.h:25
bool on_midea_(const MideaData &data)
Definition midea_ir.cpp:171
void transmit_state() override
Transmit via IR the state of this climate controller.
Definition midea_ir.cpp:141
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
Definition midea_ir.cpp:111
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
Definition midea_ir.cpp:164
void set_fahrenheit(bool value)
Set use of Fahrenheit units.
Definition midea_ir.h:28
void transmit_(MideaData &data)
Definition midea_ir.cpp:134
@ CLIMATE_PRESET_NONE
No preset is active.
@ CLIMATE_PRESET_BOOST
Device is in boost preset.
@ CLIMATE_PRESET_SLEEP
Device is prepared for sleep.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
@ CLIMATE_FAN_LOW
The fan mode is set to Low.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
const uint8_t MIDEA_TEMPC_MAX
Definition midea_ir.h:10
const uint8_t MIDEA_TEMPF_MAX
Definition midea_ir.h:12
const uint8_t MIDEA_TEMPC_MIN
Definition midea_ir.h:9
const uint8_t MIDEA_TEMPF_MIN
Definition midea_ir.h:11