7 static const char *
const TAG =
"emmeti.climate";
131 for (
size_t i = 0; i <
len; i++) {
132 result |= ((val & 1 << i) != 0) << (len - 1 - i);
138 for (
size_t i = len; i > 0; i--) {
156 ESP_LOGV(TAG,
"Expected checksum: %X", expected);
157 ESP_LOGV(TAG,
"Checksum received: %X", checksum);
159 return checksum == expected;
177 this->
add_(0, 8, data);
182 this->
add_(0x52, 11, data);
188 this->
add_(0, 4, data);
190 this->
add_(0, 18, data);
193 this->
add_(9, 12, data);
194 this->
add_(0, 8, data);
195 this->
add_(0x2052, 15, data);
198 this->
add_(0, 8, data);
199 this->
add_(1, 2, data);
200 this->
add_(0, 18, data);
201 this->
add_(0x0C, 4, data);
215 if (!(curr_state.
bitmap & 0x01)) {
227 ESP_LOGD(TAG,
"Received emmeti frame");
231 for (
size_t pos = 0; pos < 3; pos++) {
233 curr_state.
mode |= 1 << pos;
239 ESP_LOGD(TAG,
"Mode: %d", curr_state.
mode);
242 curr_state.
bitmap |= 1 << 0;
247 ESP_LOGD(TAG,
"On: %d", curr_state.
bitmap & 0x01);
249 for (
size_t pos = 0; pos < 2; pos++) {
257 ESP_LOGD(TAG,
"Fan speed: %d", curr_state.
fan_speed);
259 for (
size_t pos = 0; pos < 2; pos++) {
261 curr_state.
bitmap |= 1 << (pos + 1);
267 ESP_LOGD(TAG,
"Swing: %d", (curr_state.
bitmap >> 1) & 0x01);
268 ESP_LOGD(TAG,
"Sleep: %d", (curr_state.
bitmap >> 2) & 0x01);
270 for (
size_t pos = 0; pos < 4; pos++) {
272 curr_state.
temp |= 1 << pos;
278 ESP_LOGD(TAG,
"Temp: %d", curr_state.
temp);
280 for (
size_t pos = 0; pos < 8; pos++) {
286 for (
size_t pos = 0; pos < 4; pos++) {
288 curr_state.
bitmap |= 1 << (pos + 3);
294 ESP_LOGD(TAG,
"Turbo: %d", (curr_state.
bitmap >> 3) & 0x01);
295 ESP_LOGD(TAG,
"Light: %d", (curr_state.
bitmap >> 4) & 0x01);
296 ESP_LOGD(TAG,
"Tree: %d", (curr_state.
bitmap >> 5) & 0x01);
297 ESP_LOGD(TAG,
"Blow: %d", (curr_state.
bitmap >> 6) & 0x01);
299 uint16_t control_data = 0;
300 for (
size_t pos = 0; pos < 11; pos++) {
302 control_data |= 1 << pos;
308 if (control_data != 0x250) {
The fan mode is set to Low.
value_type const & value() const
ClimateSwingMode swing_mode
The active swing mode of the climate device.
float target_temperature
The target temperature of the climate device.
void set_carrier_frequency(uint32_t carrier_frequency)
bool parse_state_frame_(EmmetiState curr_state)
The climate device is set to heat to reach the target temperature.
const uint32_t EMMETI_HEADER_MARK
ClimateMode mode
The active mode of the climate device.
float get_temp_(uint8_t temp)
const uint32_t EMMETI_MESSAGE_SPACE
The climate device is set to dry/humidity mode.
climate::ClimateSwingMode get_swing_(uint8_t bitmap)
ClimateSwingMode
Enum for all modes a climate swing can be in.
bool check_checksum_(uint8_t checksum)
climate::ClimateFanMode get_fan_speed_(uint8_t fan)
void reverse_add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *data)
The climate device is set to cool to reach the target temperature.
The fan mode is set to Auto.
const uint32_t EMMETI_IR_FREQUENCY
RemoteTransmitterBase * transmitter_
void mark(uint32_t length)
The climate device is set to heat/cool to reach the target temperature.
The fan mode is set to Vertical.
void publish_state()
Publish the state of the climate device, to be called from integrations.
The fan mode is set to High.
RemoteTransmitData * get_data()
ClimateMode
Enum for all modes a climate device can be in.
const uint32_t EMMETI_HEADER_SPACE
The swing mode is set to Off.
The climate device is off.
climate::ClimateMode get_mode_(uint8_t mode)
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
const uint32_t EMMETI_ONE_SPACE
const uint32_t EMMETI_BIT_MARK
void transmit_state() override
void space(uint32_t length)
void add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *ata)
Implementation of SPI Controller mode.
T reverse_(T val, size_t len)
const uint8_t EMMETI_TEMP_MAX
bool on_receive(remote_base::RemoteReceiveData data) override
The fan mode is set to Medium.
const uint32_t EMMETI_ZERO_SPACE
bool expect_item(uint32_t mark, uint32_t space)
The climate device only has the fan enabled, no heating or cooling is taking place.
const uint8_t EMMETI_TEMP_MIN