7static 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);
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) {
BedjetMode mode
BedJet operating mode.
ClimateMode mode
The active mode of the climate device.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
float target_temperature
The target temperature of the climate device.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
void publish_state()
Publish the state of the climate device, to be called from integrations.
bool on_receive(remote_base::RemoteReceiveData data) override
climate::ClimateSwingMode get_swing_(uint8_t bitmap)
void transmit_state() override
void add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *ata)
bool parse_state_frame_(EmmetiState curr_state)
climate::ClimateFanMode get_fan_speed_(uint8_t fan)
T reverse_(T val, size_t len)
void reverse_add_(T val, size_t len, esphome::remote_base::RemoteTransmitData *data)
bool check_checksum_(uint8_t checksum)
float get_temp_(uint8_t temp)
climate::ClimateMode get_mode_(uint8_t mode)
value_type const & value() const
bool expect_item(uint32_t mark, uint32_t space)
void space(uint32_t length)
void set_carrier_frequency(uint32_t carrier_frequency)
void mark(uint32_t length)
RemoteTransmitterBase * transmitter_
RemoteTransmitData * get_data()
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_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_HEAT_COOL
The climate device is set to heat/cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
@ 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
const uint32_t EMMETI_ZERO_SPACE
const uint32_t EMMETI_HEADER_MARK
const uint32_t EMMETI_IR_FREQUENCY
const uint32_t EMMETI_HEADER_SPACE
const uint32_t EMMETI_BIT_MARK
const uint8_t EMMETI_TEMP_MAX
const uint8_t EMMETI_TEMP_MIN
const uint32_t EMMETI_ONE_SPACE
Providing packet encoding functions for exchanging data with a remote host.