ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
heatpumpir.h
Go to the documentation of this file.
1#pragma once
2
3#if defined(USE_ARDUINO) || defined(USE_ESP32)
4
6
7// Forward-declare HeatpumpIR class from library. We cannot include its header here because it has unnamespaced defines
8// that conflict with ESPHome.
9class HeatpumpIR;
10
11namespace esphome::heatpumpir {
12
13// Simple enum to represent protocols.
71
72// Simple enum to represent horizontal directios
81
82// Simple enum to represent vertical directions
91
93template<Protocol P> HeatpumpIR *create_heatpump_ir();
94
96template<Protocol P> struct ProtocolTag {};
97
98// Temperature
99const float TEMP_MIN = 0; // Celsius
100const float TEMP_MAX = 100; // Celsius
101
103 public:
104 template<Protocol P>
106 void setup() override;
107 void set_horizontal_default(HorizontalDirection horizontal_direction) {
108 this->default_horizontal_direction_ = horizontal_direction;
109 }
110 void set_vertical_default(VerticalDirection vertical_direction) {
111 this->default_vertical_direction_ = vertical_direction;
112 }
113
116
117 protected:
130 HeatpumpIR *heatpump_ir_;
131 void control(const climate::ClimateCall &call) override;
133 void transmit_state() override;
139 bool on_receive(remote_base::RemoteReceiveData data) override;
143
146};
147
148} // namespace esphome::heatpumpir
149
150#endif
This class is used to encode all control actions on a climate device.
Definition climate.h:31
climate::ClimatePresetMask presets_
Definition climate_ir.h:84
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_receive(remote_base::RemoteReceiveData data) override
Handle received IR data from the remote control.
VerticalDirection default_vertical_direction_
Definition heatpumpir.h:142
void transmit_state() override
Transmit via IR the state of this climate controller.
bool has_fan_byte_presets_() const
Mitsubishi Heavy ZJ and ZMP carry HiPower and Econo in the fan byte as FAN_4 and FAN_5.
Definition heatpumpir.h:135
void set_horizontal_default(HorizontalDirection horizontal_direction)
Definition heatpumpir.h:107
void set_vertical_default(VerticalDirection vertical_direction)
Definition heatpumpir.h:110
void set_max_temperature(float temperature)
Definition heatpumpir.h:114
HeatpumpIRClimate(Protocol protocol, HeatpumpIR *heatpump_ir)
Definition heatpumpir.h:118
HorizontalDirection default_horizontal_direction_
Definition heatpumpir.h:141
void control(const climate::ClimateCall &call) override
void set_min_temperature(float temperature)
Definition heatpumpir.h:115
@ CLIMATE_PRESET_NONE
No preset is active.
@ CLIMATE_PRESET_BOOST
Device is in boost preset.
@ CLIMATE_PRESET_ECO
Device is running an energy-saving preset.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_HORIZONTAL
The fan mode is set to Horizontal.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_SWING_BOTH
The fan mode is set to Both.
@ 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.
HeatpumpIR * create_heatpump_ir()
Creates the HeatpumpIR library class for a protocol; instantiated in heatpumpir.cpp.
const float TEMP_MAX
Definition heatpumpir.h:100
const float TEMP_MIN
Definition heatpumpir.h:99
Selects the protocol at compile time so the enum and the library object always match.
Definition heatpumpir.h:96
uint16_t temperature
Definition sun_gtil2.cpp:12