6static constexpr uint8_t HAIER_TUNDRA_FRAME_SIZE = 13;
19 if (this->quiet_mode_switch_ !=
nullptr) {
20 this->quiet_mode_switch_->publish_state(
false);
22 if (this->turbo_mode_switch_ !=
nullptr) {
23 this->turbo_mode_switch_->publish_state(
false);
31 const uint8_t frame[HAIER_TUNDRA_FRAME_SIZE] = {
35 static_cast<uint8_t
>(this->
health_() << 1),
36 static_cast<uint8_t
>(this->
power_() << 6),
38 static_cast<uint8_t
>(this->
quiet_() << 7 | this->
turbo_() << 6),
42 static_cast<uint8_t
>((button == HAIER_BUTTON_SELF_CLEAN ? 1 : 0) << 4),
53 return (uint8_t) roundf(clamp<float>(this->
target_temperature, HAIER_TEMP_MIN, HAIER_TEMP_MAX)) - HAIER_TEMP_MIN;
58 return HAIER_SWING_V_OFF;
63 return HAIER_SWING_V_AUTO;
66 return HAIER_SWING_V_1BOT;
68 return HAIER_SWING_V_1TOP;
76 return HAIER_SWING_H_AUTO;
78 return HAIER_SWING_H_MIDDLE;
93 return HAIER_FAN_HIGH;
96 return HAIER_FAN_AUTO;
105 switch (this->
mode) {
107 return HAIER_MODE_COOL;
109 return HAIER_MODE_DRY;
111 return HAIER_MODE_HEAT;
113 return HAIER_MODE_FAN;
116 return HAIER_MODE_AUTO;
122 if (haier.has_value()) {
130 if (haier.
data.size() != HAIER_TUNDRA_FRAME_SIZE || haier.
data[0] != this->unit_) {
143 if (this->health_mode_switch_ !=
nullptr) {
144 this->health_mode_switch_->publish_state(this->
health_mode_);
146 if (this->quiet_mode_switch_ !=
nullptr) {
147 this->quiet_mode_switch_->publish_state(this->
quiet_mode_);
149 if (this->turbo_mode_switch_ !=
nullptr) {
150 this->turbo_mode_switch_->publish_state(this->
turbo_mode_);
162 if (swing_v == HAIER_SWING_V_AUTO) {
163 if (swing_h == HAIER_SWING_H_AUTO) {
168 }
else if (swing_h == HAIER_SWING_H_AUTO) {
181 case HAIER_MODE_COOL:
185 case HAIER_MODE_HEAT:
189 case HAIER_MODE_AUTO:
221 if (this->turbo_mode_switch_ !=
nullptr) {
222 this->turbo_mode_switch_->publish_state(
false);
230 this->
transmit_(HAIER_BUTTON_TURBO_QUIET);
237 if (this->quiet_mode_switch_ !=
nullptr) {
238 this->quiet_mode_switch_->publish_state(
false);
246 this->
transmit_(HAIER_BUTTON_TURBO_QUIET);
257 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