Fix esphome v1.19 changes

Addresses issue #37.
This commit is contained in:
Mark Blakeney 2021-06-21 14:28:38 +10:00
parent 48afbf0caa
commit 6e3ea4989b
3 changed files with 6 additions and 6 deletions

View File

@ -239,7 +239,7 @@ climate:
hardware_uart: UART2
baud_rate: 9600
supports:
mode: [AUTO, COOL, HEAT, FAN_ONLY]
mode: [HEAT_COOL, COOL, HEAT, FAN_ONLY]
fan_mode: [AUTO, LOW, MEDIUM, HIGH]
swing_mode: [OFF, VERTICAL]
visual:
@ -261,7 +261,7 @@ climate:
is 9 seconds due to underlying issues with the HeatPump library. Default: 500ms
* *supports* (_Optional_): Supported features for the device. ** *mode*
(_Optional_, list): Supported climate modes for the HeatPump. Default:
`['AUTO', 'COOL', 'HEAT', 'DRY', 'FAN_ONLY']`
`['HEAT_COOL', 'COOL', 'HEAT', 'DRY', 'FAN_ONLY']`
** *fan_mode* (_Optional_, list):
Supported fan speeds for the HeatPump. Default: `['AUTO', 'DIFFUSE', 'LOW',
'MEDIUM', 'MIDDLE', 'HIGH']` ** *swing_mode* (_Optional_, list): Supported

View File

@ -16,7 +16,7 @@ from esphome.core import CORE, coroutine
AUTO_LOAD = ["climate"]
CONF_SUPPORTS = "supports"
DEFAULT_CLIMATE_MODES = ['AUTO', 'COOL', 'HEAT', 'DRY', 'FAN_ONLY']
DEFAULT_CLIMATE_MODES = ['HEAT_COOL', 'COOL', 'HEAT', 'DRY', 'FAN_ONLY']
DEFAULT_FAN_MODES = ['AUTO', 'DIFFUSE', 'LOW', 'MEDIUM', 'MIDDLE', 'HIGH']
DEFAULT_SWING_MODES = ['OFF', 'VERTICAL']

View File

@ -141,7 +141,7 @@ void MitsubishiHeatPump::control(const climate::ClimateCall &call) {
updated = true;
}
break;
case climate::CLIMATE_MODE_AUTO:
case climate::CLIMATE_MODE_HEAT_COOL:
hp->setModeSetting("AUTO");
hp->setPowerSetting("ON");
if (has_mode){
@ -291,7 +291,7 @@ void MitsubishiHeatPump::hpSettingsChanged() {
this->mode = climate::CLIMATE_MODE_FAN_ONLY;
this->action = climate::CLIMATE_ACTION_FAN;
} else if (strcmp(currentSettings.mode, "AUTO") == 0) {
this->mode = climate::CLIMATE_MODE_AUTO;
this->mode = climate::CLIMATE_MODE_HEAT_COOL;
if (auto_setpoint != currentSettings.temperature) {
auto_setpoint = currentSettings.temperature;
save(currentSettings.temperature, auto_storage);
@ -378,7 +378,7 @@ void MitsubishiHeatPump::hpStatusChanged(heatpumpStatus currentStatus) {
this->action = climate::CLIMATE_ACTION_IDLE;
}
break;
case climate::CLIMATE_MODE_AUTO:
case climate::CLIMATE_MODE_HEAT_COOL:
this->action = climate::CLIMATE_ACTION_IDLE;
if (currentStatus.operating) {
if (this->current_temperature > this->target_temperature) {