6static constexpr uint8_t HAIER_TUNDRA_FRAME_SIZE = 13;
19 PUBLISH_STATE(this->quiet_mode_switch_,
false);
20 PUBLISH_STATE(this->turbo_mode_switch_,
false);
27 const uint8_t frame[HAIER_TUNDRA_FRAME_SIZE] = {
31 static_cast<uint8_t
>(this->
health_() << 1),
32 static_cast<uint8_t
>(this->
power_() << 6),
34 static_cast<uint8_t
>(this->
quiet_() << 7 | this->
turbo_() << 6),
38 static_cast<uint8_t
>((button == HAIER_BUTTON_SELF_CLEAN ? 1 : 0) << 4),
49 return (uint8_t) roundf(clamp<float>(this->
target_temperature, HAIER_TEMP_MIN, HAIER_TEMP_MAX)) - HAIER_TEMP_MIN;
54 return HAIER_SWING_V_OFF;
59 return HAIER_SWING_V_AUTO;
62 return HAIER_SWING_V_1BOT;
64 return HAIER_SWING_V_1TOP;
72 return HAIER_SWING_H_AUTO;
74 return HAIER_SWING_H_MIDDLE;
89 return HAIER_FAN_HIGH;
92 return HAIER_FAN_AUTO;
101 switch (this->
mode) {
103 return HAIER_MODE_COOL;
105 return HAIER_MODE_DRY;
107 return HAIER_MODE_HEAT;
109 return HAIER_MODE_FAN;
112 return HAIER_MODE_AUTO;
118 if (haier.has_value()) {
126 if (haier.
data.size() != HAIER_TUNDRA_FRAME_SIZE || haier.
data[0] != this->unit_) {
139 PUBLISH_STATE(this->health_mode_switch_, this->
health_mode_);
140 PUBLISH_STATE(this->quiet_mode_switch_, this->
quiet_mode_);
141 PUBLISH_STATE(this->turbo_mode_switch_, this->
turbo_mode_);
152 if (swing_v == HAIER_SWING_V_AUTO) {
153 if (swing_h == HAIER_SWING_H_AUTO) {
158 }
else if (swing_h == HAIER_SWING_H_AUTO) {
171 case HAIER_MODE_COOL:
175 case HAIER_MODE_HEAT:
179 case HAIER_MODE_AUTO:
211 PUBLISH_STATE(this->turbo_mode_switch_,
false);
218 this->
transmit_(HAIER_BUTTON_TURBO_QUIET);
225 PUBLISH_STATE(this->quiet_mode_switch_,
false);
232 this->
transmit_(HAIER_BUTTON_TURBO_QUIET);
243 this->
transmit_(HAIER_BUTTON_SELF_CLEAN);
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.
void transmit_(uint8_t button)
void set_quiet_mode(bool quiet, bool transmit=true)
float get_temperature_(uint8_t temp)
climate::ClimateSwingMode get_swing_mode_(uint8_t swing_v, uint8_t swing_h)
bool on_haier_(const remote_base::HaierData &haier)
uint8_t operation_mode_()
void set_turbo_mode(bool turbo, bool transmit=true)
climate::ClimateFanMode get_fan_speed_(uint8_t fan)
climate::ClimateMode get_operation_mode_(uint8_t power, uint8_t mode)
void set_health_mode(bool health, bool transmit=true)
void transmit_state() override
uint8_t horizontal_swing_()
bool on_receive(remote_base::RemoteReceiveData data) override
uint8_t vertical_swing_()
void encode(RemoteTransmitData *dst, const HaierData &data)
optional< HaierData > decode(RemoteReceiveData src)
RemoteTransmitterBase * transmitter_
ClimateSwingMode
Enum for all modes a climate swing can be in NOTE: If adding values, update ClimateSwingModeMask in c...
@ 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.
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.
ClimateFanMode
NOTE: If adding values, update ClimateFanModeMask in climate_traits.h to use the new last value.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_ON
The fan mode is set to On.
@ 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.
std::vector< uint8_t > data