7static const char *
const TAG =
"gree.climate";
20 uint8_t remote_state[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00};
26 remote_state[2] = 0x60;
27 remote_state[3] = 0x50;
32 remote_state[5] = 0x40;
35 remote_state[0] |= (1 << 6);
44 remote_state[2] = 0x20;
45 remote_state[3] = 0x50;
46 remote_state[6] = 0x20;
49 remote_state[0] |= (1 << 6);
67 remote_state[7] = ((remote_state[0] << 4) + (remote_state[1] << 4) + 0xC0);
70 ((((remote_state[0] & 0x0F) + (remote_state[1] & 0x0F) + (remote_state[2] & 0x0F) + (remote_state[3] & 0x0F) +
71 ((remote_state[4] & 0xF0) >> 4) + ((remote_state[5] & 0xF0) >> 4) + ((remote_state[6] & 0xF0) >> 4) + 0x0A) &
76 ((((remote_state[0] & 0x0F) + (remote_state[1] & 0x0F) + (remote_state[2] & 0x0F) + (remote_state[3] & 0x0F) +
77 ((remote_state[5] & 0xF0) >> 4) + ((remote_state[6] & 0xF0) >> 4) + ((remote_state[7] & 0xF0) >> 4) + 0x0A) &
80 (remote_state[7] & 0x0F);
94 for (
int i = 0; i < 4; i++) {
95 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
97 bool bit = remote_state[i] & mask;
116 for (
int i = 4; i < 8; i++) {
117 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
119 bool bit = remote_state[i] & mask;
133 switch (this->
mode) {
155 return 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.
optional< ClimatePreset > preset
The active preset of the climate device.
std::set< climate::ClimateFanMode > fan_modes_
std::set< climate::ClimatePreset > presets_
uint8_t operation_mode_()
void set_model(Model model)
uint8_t horizontal_swing_()
uint8_t vertical_swing_()
void transmit_state() override
value_type const & value() const
void set_carrier_frequency(uint32_t carrier_frequency)
RemoteTransmitterBase * transmitter_
RemoteTransmitData * get_data()
@ CLIMATE_PRESET_NONE
No preset is active.
@ CLIMATE_PRESET_SLEEP
Device is prepared for sleep.
@ 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.
@ 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_QUIET
The fan mode is set to Quiet.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
const uint32_t GREE_IR_FREQUENCY
const uint8_t GREE_PRESET_SLEEP_BIT
const uint32_t GREE_BIT_MARK
const uint8_t GREE_FAN_AUTO
const uint32_t GREE_YAC1FB9_MESSAGE_SPACE
const uint32_t GREE_HEADER_MARK
const uint8_t GREE_VDIR_AUTO
const uint32_t GREE_YAC1FB9_HEADER_SPACE
const uint8_t GREE_FAN_TURBO_BIT
const uint8_t GREE_MODE_FAN
const uint8_t GREE_MODE_OFF
const uint8_t GREE_TEMP_MIN
const uint8_t GREE_MODE_AUTO
const uint8_t GREE_VDIR_SWING
const uint8_t GREE_MODE_ON
const uint8_t GREE_HDIR_MANUAL
const uint8_t GREE_MODE_DRY
const uint32_t GREE_ZERO_SPACE
const uint8_t GREE_HDIR_SWING
const uint8_t GREE_PRESET_SLEEP
const uint8_t GREE_VDIR_MANUAL
const uint32_t GREE_MESSAGE_SPACE
const uint8_t GREE_MODE_COOL
const uint8_t GREE_TEMP_MAX
const uint32_t GREE_HEADER_SPACE
const uint8_t GREE_MODE_HEAT
const uint8_t GREE_FAN_TURBO
const uint8_t GREE_PRESET_NONE
const uint32_t GREE_ONE_SPACE
Providing packet encoding functions for exchanging data with a remote host.