mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 08:55:22 +01:00
Add support for the Gree YAC1FB9 in climate_ir (#7056)
This commit is contained in:
parent
a34cec217e
commit
54b77a1174
3 changed files with 17 additions and 4 deletions
|
@ -16,6 +16,7 @@ MODELS = {
|
||||||
"yan": Model.GREE_YAN,
|
"yan": Model.GREE_YAN,
|
||||||
"yaa": Model.GREE_YAA,
|
"yaa": Model.GREE_YAA,
|
||||||
"yac": Model.GREE_YAC,
|
"yac": Model.GREE_YAC,
|
||||||
|
"yac1fb9": Model.GREE_YAC1FB9,
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG_SCHEMA = climate_ir.CLIMATE_IR_WITH_RECEIVER_SCHEMA.extend(
|
CONFIG_SCHEMA = climate_ir.CLIMATE_IR_WITH_RECEIVER_SCHEMA.extend(
|
||||||
|
|
|
@ -24,7 +24,7 @@ void GreeClimate::transmit_state() {
|
||||||
remote_state[4] |= (this->horizontal_swing_() << 4);
|
remote_state[4] |= (this->horizontal_swing_() << 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->model_ == GREE_YAA || this->model_ == GREE_YAC) {
|
if (this->model_ == GREE_YAA || this->model_ == GREE_YAC || this->model_ == GREE_YAC1FB9) {
|
||||||
remote_state[2] = 0x20; // bits 0..3 always 0000, bits 4..7 TURBO,LIGHT,HEALTH,X-FAN
|
remote_state[2] = 0x20; // bits 0..3 always 0000, bits 4..7 TURBO,LIGHT,HEALTH,X-FAN
|
||||||
remote_state[3] = 0x50; // bits 4..7 always 0101
|
remote_state[3] = 0x50; // bits 4..7 always 0101
|
||||||
remote_state[6] = 0x20; // YAA1FB, FAA1FB1, YB1F2 bits 4..7 always 0010
|
remote_state[6] = 0x20; // YAA1FB, FAA1FB1, YB1F2 bits 4..7 always 0010
|
||||||
|
@ -53,7 +53,11 @@ void GreeClimate::transmit_state() {
|
||||||
data->set_carrier_frequency(GREE_IR_FREQUENCY);
|
data->set_carrier_frequency(GREE_IR_FREQUENCY);
|
||||||
|
|
||||||
data->mark(GREE_HEADER_MARK);
|
data->mark(GREE_HEADER_MARK);
|
||||||
data->space(GREE_HEADER_SPACE);
|
if (this->model_ == GREE_YAC1FB9) {
|
||||||
|
data->space(GREE_YAC1FB9_HEADER_SPACE);
|
||||||
|
} else {
|
||||||
|
data->space(GREE_HEADER_SPACE);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
for (uint8_t mask = 1; mask > 0; mask <<= 1) { // iterate through bit mask
|
for (uint8_t mask = 1; mask > 0; mask <<= 1) { // iterate through bit mask
|
||||||
|
@ -71,7 +75,11 @@ void GreeClimate::transmit_state() {
|
||||||
data->space(GREE_ZERO_SPACE);
|
data->space(GREE_ZERO_SPACE);
|
||||||
|
|
||||||
data->mark(GREE_BIT_MARK);
|
data->mark(GREE_BIT_MARK);
|
||||||
data->space(GREE_MESSAGE_SPACE);
|
if (this->model_ == GREE_YAC1FB9) {
|
||||||
|
data->space(GREE_YAC1FB9_MESSAGE_SPACE);
|
||||||
|
} else {
|
||||||
|
data->space(GREE_MESSAGE_SPACE);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 4; i < 8; i++) {
|
for (int i = 4; i < 8; i++) {
|
||||||
for (uint8_t mask = 1; mask > 0; mask <<= 1) { // iterate through bit mask
|
for (uint8_t mask = 1; mask > 0; mask <<= 1) { // iterate through bit mask
|
||||||
|
|
|
@ -41,6 +41,10 @@ const uint32_t GREE_YAC_HEADER_MARK = 6000;
|
||||||
const uint32_t GREE_YAC_HEADER_SPACE = 3000;
|
const uint32_t GREE_YAC_HEADER_SPACE = 3000;
|
||||||
const uint32_t GREE_YAC_BIT_MARK = 650;
|
const uint32_t GREE_YAC_BIT_MARK = 650;
|
||||||
|
|
||||||
|
// Timing specific to YAC1FB9
|
||||||
|
const uint32_t GREE_YAC1FB9_HEADER_SPACE = 4500;
|
||||||
|
const uint32_t GREE_YAC1FB9_MESSAGE_SPACE = 19980;
|
||||||
|
|
||||||
// State Frame size
|
// State Frame size
|
||||||
const uint8_t GREE_STATE_FRAME_SIZE = 8;
|
const uint8_t GREE_STATE_FRAME_SIZE = 8;
|
||||||
|
|
||||||
|
@ -67,7 +71,7 @@ const uint8_t GREE_HDIR_MRIGHT = 0x05;
|
||||||
const uint8_t GREE_HDIR_RIGHT = 0x06;
|
const uint8_t GREE_HDIR_RIGHT = 0x06;
|
||||||
|
|
||||||
// Model codes
|
// Model codes
|
||||||
enum Model { GREE_GENERIC, GREE_YAN, GREE_YAA, GREE_YAC };
|
enum Model { GREE_GENERIC, GREE_YAN, GREE_YAA, GREE_YAC, GREE_YAC1FB9 };
|
||||||
|
|
||||||
class GreeClimate : public climate_ir::ClimateIR {
|
class GreeClimate : public climate_ir::ClimateIR {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue