Return PRESET_NONE in Honeywell (#108599)

* Return PRESET_NONE

* format preset_hold

* Address Hold in tests

* Add translations
This commit is contained in:
mkmer 2024-01-23 09:57:55 -05:00 committed by GitHub
parent 074d59f849
commit f3b1f47d34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 6 deletions

View file

@ -51,7 +51,7 @@ ATTR_FAN_ACTION = "fan_action"
ATTR_PERMANENT_HOLD = "permanent_hold" ATTR_PERMANENT_HOLD = "permanent_hold"
PRESET_HOLD = "Hold" PRESET_HOLD = "hold"
HEATING_MODES = {"heat", "emheat", "auto"} HEATING_MODES = {"heat", "emheat", "auto"}
COOLING_MODES = {"cool", "auto"} COOLING_MODES = {"cool", "auto"}
@ -142,6 +142,7 @@ class HoneywellUSThermostat(ClimateEntity):
_attr_has_entity_name = True _attr_has_entity_name = True
_attr_name = None _attr_name = None
_attr_translation_key = "honeywell"
def __init__( def __init__(
self, self,
@ -303,7 +304,7 @@ class HoneywellUSThermostat(ClimateEntity):
if self._is_permanent_hold(): if self._is_permanent_hold():
return PRESET_HOLD return PRESET_HOLD
return None return PRESET_NONE
@property @property
def is_aux_heat(self) -> bool | None: def is_aux_heat(self) -> bool | None:

View file

@ -40,6 +40,19 @@
"outdoor_humidity": { "outdoor_humidity": {
"name": "Outdoor humidity" "name": "Outdoor humidity"
} }
},
"climate": {
"honeywell": {
"state_attributes": {
"preset_mode": {
"state": {
"hold": "Hold",
"away": "[%key:component::climate::entity_component::_::state_attributes::preset_mode::state::away%]",
"none": "[%key:component::climate::entity_component::_::state_attributes::preset_mode::state::none%]"
}
}
}
}
} }
} }
} }

View file

@ -24,11 +24,11 @@
'min_humidity': 30, 'min_humidity': 30,
'min_temp': -13.9, 'min_temp': -13.9,
'permanent_hold': False, 'permanent_hold': False,
'preset_mode': None, 'preset_mode': 'none',
'preset_modes': list([ 'preset_modes': list([
'none', 'none',
'away', 'away',
'Hold', 'hold',
]), ]),
'supported_features': <ClimateEntityFeature: 95>, 'supported_features': <ClimateEntityFeature: 95>,
'target_temp_high': None, 'target_temp_high': None,

View file

@ -28,7 +28,7 @@ from homeassistant.components.climate import (
SERVICE_SET_TEMPERATURE, SERVICE_SET_TEMPERATURE,
HVACMode, HVACMode,
) )
from homeassistant.components.honeywell.climate import RETRY, SCAN_INTERVAL from homeassistant.components.honeywell.climate import PRESET_HOLD, RETRY, SCAN_INTERVAL
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
ATTR_TEMPERATURE, ATTR_TEMPERATURE,
@ -46,7 +46,6 @@ from . import init_integration, reset_mock
from tests.common import async_fire_time_changed from tests.common import async_fire_time_changed
FAN_ACTION = "fan_action" FAN_ACTION = "fan_action"
PRESET_HOLD = "Hold"
async def test_no_thermostat_options( async def test_no_thermostat_options(