mirror of
https://github.com/esphome/esphome.git
synced 2026-10-21 21:36:14 +00:00
[gree] Add sleep preset support for GREE YAC1FB9 (#18090)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
co-authored by
pre-commit-ci-lite[bot]
J. Nick Koston
parent
bf36e7c33a
commit
f3f056ca41
@@ -12,9 +12,12 @@ void GreeClimate::set_model(Model model) {
|
||||
this->swing_modes_.erase(climate::CLIMATE_SWING_BOTH);
|
||||
}
|
||||
if (model == GREE_YX1FF) {
|
||||
this->fan_modes_.insert(climate::CLIMATE_FAN_QUIET); // YX1FF 4 speed
|
||||
this->presets_.insert(climate::CLIMATE_PRESET_NONE); // YX1FF sleep mode
|
||||
this->presets_.insert(climate::CLIMATE_PRESET_SLEEP); // YX1FF sleep mode
|
||||
this->fan_modes_.insert(climate::CLIMATE_FAN_QUIET); // YX1FF 4 speed
|
||||
}
|
||||
// Models with a sleep preset
|
||||
if (model == GREE_YX1FF || model == GREE_YAC1FB9) {
|
||||
this->presets_.insert(climate::CLIMATE_PRESET_NONE);
|
||||
this->presets_.insert(climate::CLIMATE_PRESET_SLEEP);
|
||||
}
|
||||
|
||||
this->model_ = model;
|
||||
@@ -80,10 +83,10 @@ void GreeClimate::transmit_state() {
|
||||
if (this->fan_speed_() == GREE_FAN_TURBO) {
|
||||
remote_state[2] |= GREE_FAN_TURBO_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->preset_() == GREE_PRESET_SLEEP) {
|
||||
remote_state[0] |= GREE_PRESET_SLEEP_BIT;
|
||||
}
|
||||
if (this->preset_() == GREE_PRESET_SLEEP) {
|
||||
remote_state[0] |= GREE_PRESET_SLEEP_BIT;
|
||||
}
|
||||
|
||||
// Calculate the checksum
|
||||
@@ -228,8 +231,8 @@ uint8_t GreeClimate::temperature_() {
|
||||
}
|
||||
|
||||
uint8_t GreeClimate::preset_() {
|
||||
// YX1FF has sleep preset
|
||||
if (this->model_ == GREE_YX1FF) {
|
||||
// YX1FF and YAC1FB9 have sleep preset
|
||||
if (this->model_ == GREE_YX1FF || this->model_ == GREE_YAC1FB9) {
|
||||
switch (this->preset.value_or(climate::CLIMATE_PRESET_NONE)) {
|
||||
case climate::CLIMATE_PRESET_NONE:
|
||||
return GREE_PRESET_NONE;
|
||||
|
||||
@@ -69,9 +69,12 @@ static constexpr uint8_t GREE_HDIR_MRIGHT = 0x05;
|
||||
static constexpr uint8_t GREE_HDIR_RIGHT = 0x06;
|
||||
|
||||
// Only available on YX1FF
|
||||
// Turbo (high) fan mode + sleep preset mode
|
||||
// Turbo (high) fan mode
|
||||
static constexpr uint8_t GREE_FAN_TURBO = 0x80;
|
||||
static constexpr uint8_t GREE_FAN_TURBO_BIT = 0x10;
|
||||
|
||||
// Available on YX1FF and YAC1FB9
|
||||
// Sleep preset mode
|
||||
static constexpr uint8_t GREE_PRESET_NONE = 0x00;
|
||||
static constexpr uint8_t GREE_PRESET_SLEEP = 0x01;
|
||||
static constexpr uint8_t GREE_PRESET_SLEEP_BIT = 0x80;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
packages:
|
||||
remote_transmitter: !include ../../test_build_components/common/remote_transmitter/esp32-idf.yaml
|
||||
|
||||
climate:
|
||||
- platform: gree
|
||||
name: GREE
|
||||
transmitter_id: xmitr
|
||||
model: YAC1FB9
|
||||
Reference in New Issue
Block a user