mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 14:04:53 +01:00
commit
8bf112669f
7 changed files with 12 additions and 12 deletions
|
@ -89,7 +89,7 @@ SUPPORTED_SWING_MODES_OPTIONS = {
|
||||||
|
|
||||||
SUPPORTED_CLIMATE_MODES_OPTIONS = {
|
SUPPORTED_CLIMATE_MODES_OPTIONS = {
|
||||||
"OFF": ClimateMode.CLIMATE_MODE_OFF, # always available
|
"OFF": ClimateMode.CLIMATE_MODE_OFF, # always available
|
||||||
"AUTO": ClimateMode.CLIMATE_MODE_AUTO, # always available
|
"HEAT_COOL": ClimateMode.CLIMATE_MODE_HEAT_COOL, # always available
|
||||||
"COOL": ClimateMode.CLIMATE_MODE_COOL,
|
"COOL": ClimateMode.CLIMATE_MODE_COOL,
|
||||||
"HEAT": ClimateMode.CLIMATE_MODE_HEAT,
|
"HEAT": ClimateMode.CLIMATE_MODE_HEAT,
|
||||||
"DRY": ClimateMode.CLIMATE_MODE_DRY,
|
"DRY": ClimateMode.CLIMATE_MODE_DRY,
|
||||||
|
|
|
@ -72,7 +72,7 @@ HaierClimateBase::HaierClimateBase()
|
||||||
this->traits_ = climate::ClimateTraits();
|
this->traits_ = climate::ClimateTraits();
|
||||||
this->traits_.set_supported_modes({climate::CLIMATE_MODE_OFF, climate::CLIMATE_MODE_COOL, climate::CLIMATE_MODE_HEAT,
|
this->traits_.set_supported_modes({climate::CLIMATE_MODE_OFF, climate::CLIMATE_MODE_COOL, climate::CLIMATE_MODE_HEAT,
|
||||||
climate::CLIMATE_MODE_FAN_ONLY, climate::CLIMATE_MODE_DRY,
|
climate::CLIMATE_MODE_FAN_ONLY, climate::CLIMATE_MODE_DRY,
|
||||||
climate::CLIMATE_MODE_AUTO});
|
climate::CLIMATE_MODE_HEAT_COOL});
|
||||||
this->traits_.set_supported_fan_modes(
|
this->traits_.set_supported_fan_modes(
|
||||||
{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM, climate::CLIMATE_FAN_HIGH});
|
{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM, climate::CLIMATE_FAN_HIGH});
|
||||||
this->traits_.set_supported_swing_modes({climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_BOTH,
|
this->traits_.set_supported_swing_modes({climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_BOTH,
|
||||||
|
@ -172,7 +172,7 @@ void HaierClimateBase::set_answer_timeout(uint32_t timeout) {
|
||||||
void HaierClimateBase::set_supported_modes(const std::set<climate::ClimateMode> &modes) {
|
void HaierClimateBase::set_supported_modes(const std::set<climate::ClimateMode> &modes) {
|
||||||
this->traits_.set_supported_modes(modes);
|
this->traits_.set_supported_modes(modes);
|
||||||
this->traits_.add_supported_mode(climate::CLIMATE_MODE_OFF); // Always available
|
this->traits_.add_supported_mode(climate::CLIMATE_MODE_OFF); // Always available
|
||||||
this->traits_.add_supported_mode(climate::CLIMATE_MODE_AUTO); // Always available
|
this->traits_.add_supported_mode(climate::CLIMATE_MODE_HEAT_COOL); // Always available
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaierClimateBase::set_supported_presets(const std::set<climate::ClimatePreset> &presets) {
|
void HaierClimateBase::set_supported_presets(const std::set<climate::ClimatePreset> &presets) {
|
||||||
|
|
|
@ -458,7 +458,7 @@ haier_protocol::HaierMessage HonClimate::get_control_message() {
|
||||||
case CLIMATE_MODE_OFF:
|
case CLIMATE_MODE_OFF:
|
||||||
out_data->ac_power = 0;
|
out_data->ac_power = 0;
|
||||||
break;
|
break;
|
||||||
case CLIMATE_MODE_AUTO:
|
case CLIMATE_MODE_HEAT_COOL:
|
||||||
out_data->ac_power = 1;
|
out_data->ac_power = 1;
|
||||||
out_data->ac_mode = (uint8_t) hon_protocol::ConditioningMode::AUTO;
|
out_data->ac_mode = (uint8_t) hon_protocol::ConditioningMode::AUTO;
|
||||||
out_data->fan_mode = this->other_modes_fan_speed_;
|
out_data->fan_mode = this->other_modes_fan_speed_;
|
||||||
|
@ -758,7 +758,7 @@ haier_protocol::HandlerError HonClimate::process_status_message_(const uint8_t *
|
||||||
this->mode = CLIMATE_MODE_FAN_ONLY;
|
this->mode = CLIMATE_MODE_FAN_ONLY;
|
||||||
break;
|
break;
|
||||||
case (uint8_t) hon_protocol::ConditioningMode::AUTO:
|
case (uint8_t) hon_protocol::ConditioningMode::AUTO:
|
||||||
this->mode = CLIMATE_MODE_AUTO;
|
this->mode = CLIMATE_MODE_HEAT_COOL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,7 +270,7 @@ haier_protocol::HaierMessage Smartair2Climate::get_control_message() {
|
||||||
out_data->ac_power = 0;
|
out_data->ac_power = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLIMATE_MODE_AUTO:
|
case CLIMATE_MODE_HEAT_COOL:
|
||||||
out_data->ac_power = 1;
|
out_data->ac_power = 1;
|
||||||
out_data->ac_mode = (uint8_t) smartair2_protocol::ConditioningMode::AUTO;
|
out_data->ac_mode = (uint8_t) smartair2_protocol::ConditioningMode::AUTO;
|
||||||
out_data->fan_mode = this->other_modes_fan_speed_;
|
out_data->fan_mode = this->other_modes_fan_speed_;
|
||||||
|
@ -487,7 +487,7 @@ haier_protocol::HandlerError Smartair2Climate::process_status_message_(const uin
|
||||||
this->mode = CLIMATE_MODE_FAN_ONLY;
|
this->mode = CLIMATE_MODE_FAN_ONLY;
|
||||||
break;
|
break;
|
||||||
case (uint8_t) smartair2_protocol::ConditioningMode::AUTO:
|
case (uint8_t) smartair2_protocol::ConditioningMode::AUTO:
|
||||||
this->mode = CLIMATE_MODE_AUTO;
|
this->mode = CLIMATE_MODE_HEAT_COOL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,14 +100,14 @@ bool check_sml_data(const bytes &buffer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t crc_received = (buffer.at(buffer.size() - 2) << 8) | buffer.at(buffer.size() - 1);
|
uint16_t crc_received = (buffer.at(buffer.size() - 2) << 8) | buffer.at(buffer.size() - 1);
|
||||||
uint16_t crc_calculated = crc16(buffer.data(), buffer.size(), 0x6e23, 0x8408, true, true);
|
uint16_t crc_calculated = crc16(buffer.data(), buffer.size() - 2, 0x6e23, 0x8408, true, true);
|
||||||
crc_calculated = (crc_calculated >> 8) | (crc_calculated << 8);
|
crc_calculated = (crc_calculated >> 8) | (crc_calculated << 8);
|
||||||
if (crc_received == crc_calculated) {
|
if (crc_received == crc_calculated) {
|
||||||
ESP_LOGV(TAG, "Checksum verification successful with CRC16/X25.");
|
ESP_LOGV(TAG, "Checksum verification successful with CRC16/X25.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
crc_calculated = crc16(buffer.data(), buffer.size(), 0xed50, 0x8408);
|
crc_calculated = crc16(buffer.data(), buffer.size() - 2, 0xed50, 0x8408);
|
||||||
if (crc_received == crc_calculated) {
|
if (crc_received == crc_calculated) {
|
||||||
ESP_LOGV(TAG, "Checksum verification successful with CRC16/KERMIT.");
|
ESP_LOGV(TAG, "Checksum verification successful with CRC16/KERMIT.");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2023.8.0"
|
__version__ = "2023.8.1"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
|
|
@ -957,7 +957,7 @@ climate:
|
||||||
temperature_step: 1 °C
|
temperature_step: 1 °C
|
||||||
supported_modes:
|
supported_modes:
|
||||||
- 'OFF'
|
- 'OFF'
|
||||||
- AUTO
|
- HEAT_COOL
|
||||||
- COOL
|
- COOL
|
||||||
- HEAT
|
- HEAT
|
||||||
- DRY
|
- DRY
|
||||||
|
|
Loading…
Reference in a new issue