ESPHome 2025.5.0
Loading...
Searching...
No Matches
emmeti.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome {
6namespace emmeti {
7
8const uint8_t EMMETI_TEMP_MIN = 16; // Celsius
9const uint8_t EMMETI_TEMP_MAX = 30; // Celsius
10
11// Modes
12
20
21// Fan Speed
22
23enum EmmetiFanMode : uint8_t {
28};
29
30// Fan Position
31
44
45// IR Transmission
46const uint32_t EMMETI_IR_FREQUENCY = 38000;
47const uint32_t EMMETI_HEADER_MARK = 9076;
48const uint32_t EMMETI_HEADER_SPACE = 4408;
49const uint32_t EMMETI_BIT_MARK = 660;
50const uint32_t EMMETI_ONE_SPACE = 1630;
51const uint32_t EMMETI_ZERO_SPACE = 530;
52const uint32_t EMMETI_MESSAGE_SPACE = 20000;
53
55 uint8_t mode = 0;
56 uint8_t bitmap = 0;
57 uint8_t fan_speed = 0;
58 uint8_t temp = 0;
59 uint8_t fan_pos = 0;
60 uint8_t th = 0;
61 uint8_t checksum = 0;
62};
63
65 public:
71
72 protected:
73 // Transmit via IR the state of this climate controller
74 void transmit_state() override;
75 // Handle received IR Buffer
76 bool on_receive(remote_base::RemoteReceiveData data) override;
77 bool parse_state_frame_(EmmetiState curr_state);
78
79 // setters
80 uint8_t set_mode_();
81 uint8_t set_temp_();
82 uint8_t set_fan_speed_();
83 uint8_t gen_checksum_();
84 uint8_t set_blades_();
85
86 // getters
89 void get_blades_(uint8_t fanpos);
90 // get swing
92 float get_temp_(uint8_t temp);
93
94 // check if the received frame is valid
95 bool check_checksum_(uint8_t checksum);
96
97 template<typename T> T reverse_(T val, size_t len);
98
99 template<typename T> void add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *ata);
100
101 template<typename T> void add_(T val, esphome::remote_base::RemoteTransmitData *data);
102
103 template<typename T> void reverse_add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *data);
104
106};
107
108} // namespace emmeti
109} // namespace esphome
uint8_t checksum
Definition bl0906.h:3
ClimateMode mode
The active mode of the climate device.
Definition climate.h:173
ClimateIR(float minimum_temperature, float maximum_temperature, float temperature_step=1.0f, bool supports_dry=false, bool supports_fan_only=false, std::set< climate::ClimateFanMode > fan_modes={}, std::set< climate::ClimateSwingMode > swing_modes={}, std::set< climate::ClimatePreset > presets={})
Definition climate_ir.h:26
bool on_receive(remote_base::RemoteReceiveData data) override
Definition emmeti.cpp:223
climate::ClimateSwingMode get_swing_(uint8_t bitmap)
Definition emmeti.cpp:125
void transmit_state() override
Definition emmeti.cpp:162
void add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *ata)
Definition emmeti.cpp:137
bool parse_state_frame_(EmmetiState curr_state)
Definition emmeti.cpp:209
climate::ClimateFanMode get_fan_speed_(uint8_t fan)
Definition emmeti.cpp:111
T reverse_(T val, size_t len)
Definition emmeti.cpp:129
void reverse_add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *data)
Definition emmeti.cpp:150
bool check_checksum_(uint8_t checksum)
Definition emmeti.cpp:154
float get_temp_(uint8_t temp)
Definition emmeti.cpp:92
void get_blades_(uint8_t fanpos)
climate::ClimateMode get_mode_(uint8_t mode)
Definition emmeti.cpp:94
mopeka_std_values val[4]
ClimateSwingMode
Enum for all modes a climate swing can be in.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
ClimateMode
Enum for all modes a climate device can be in.
@ 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 uint32_t EMMETI_MESSAGE_SPACE
Definition emmeti.h:52
const uint32_t EMMETI_ZERO_SPACE
Definition emmeti.h:51
const uint32_t EMMETI_HEADER_MARK
Definition emmeti.h:47
@ EMMETI_MODE_HEAT_COOL
Definition emmeti.h:14
const uint32_t EMMETI_IR_FREQUENCY
Definition emmeti.h:46
const uint32_t EMMETI_HEADER_SPACE
Definition emmeti.h:48
const uint32_t EMMETI_BIT_MARK
Definition emmeti.h:49
const uint8_t EMMETI_TEMP_MAX
Definition emmeti.h:9
@ EMMETI_BLADES_FULL
Definition emmeti.h:34
@ EMMETI_BLADES_MID
Definition emmeti.h:41
@ EMMETI_BLADES_STOP
Definition emmeti.h:33
@ EMMETI_BLADES_HIGH
Definition emmeti.h:42
@ EMMETI_BLADES_LOW
Definition emmeti.h:40
const uint8_t EMMETI_TEMP_MIN
Definition emmeti.h:8
const uint32_t EMMETI_ONE_SPACE
Definition emmeti.h:50
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
std::string size_t len
Definition helpers.h:301