Fix SmartThings climate entity missing off HAVC mode (#141700)

* Fix smartthing climate entity missing off HAVC mode:

* Fix tests

* Fix test

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
This commit is contained in:
Franck Nijhof 2025-03-31 11:41:52 +02:00
parent d0b61af7ec
commit a88678cf42
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
3 changed files with 12 additions and 4 deletions

View File

@ -281,7 +281,7 @@ class SmartThingsThermostat(SmartThingsEntity, ClimateEntity):
return [ return [
state state
for mode in supported_thermostat_modes for mode in supported_thermostat_modes
if (state := AC_MODE_TO_STATE.get(mode)) is not None if (state := MODE_TO_STATE.get(mode)) is not None
] ]
@property @property

View File

@ -70,6 +70,7 @@
'area_id': None, 'area_id': None,
'capabilities': dict({ 'capabilities': dict({
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>, <HVACMode.HEAT: 'heat'>,
]), ]),
'max_temp': 35, 'max_temp': 35,
@ -109,6 +110,7 @@
'current_temperature': 23.9, 'current_temperature': 23.9,
'friendly_name': 'Radiator Thermostat II [+M] Wohnzimmer', 'friendly_name': 'Radiator Thermostat II [+M] Wohnzimmer',
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>, <HVACMode.HEAT: 'heat'>,
]), ]),
'max_temp': 35, 'max_temp': 35,
@ -431,6 +433,7 @@
'auto', 'auto',
]), ]),
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.COOL: 'cool'>, <HVACMode.COOL: 'cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>, <HVACMode.HEAT_COOL: 'heat_cool'>,
]), ]),
@ -478,6 +481,7 @@
'friendly_name': 'Main Floor', 'friendly_name': 'Main Floor',
'hvac_action': <HVACAction.HEATING: 'heating'>, 'hvac_action': <HVACAction.HEATING: 'heating'>,
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.COOL: 'cool'>, <HVACMode.COOL: 'cool'>,
<HVACMode.HEAT_COOL: 'heat_cool'>, <HVACMode.HEAT_COOL: 'heat_cool'>,
]), ]),
@ -628,6 +632,7 @@
'area_id': None, 'area_id': None,
'capabilities': dict({ 'capabilities': dict({
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>, <HVACMode.HEAT: 'heat'>,
]), ]),
'max_temp': 35, 'max_temp': 35,
@ -668,6 +673,7 @@
'friendly_name': 'Hall thermostat', 'friendly_name': 'Hall thermostat',
'hvac_action': <HVACAction.HEATING: 'heating'>, 'hvac_action': <HVACAction.HEATING: 'heating'>,
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>, <HVACMode.HEAT: 'heat'>,
]), ]),
'max_temp': 35, 'max_temp': 35,
@ -695,6 +701,7 @@
'on', 'on',
]), ]),
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.AUTO: 'auto'>,
]), ]),
'max_temp': 35.0, 'max_temp': 35.0,
'min_temp': 7.0, 'min_temp': 7.0,
@ -738,6 +745,7 @@
'friendly_name': 'asd', 'friendly_name': 'asd',
'hvac_action': <HVACAction.COOLING: 'cooling'>, 'hvac_action': <HVACAction.COOLING: 'cooling'>,
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.AUTO: 'auto'>,
]), ]),
'max_temp': 35.0, 'max_temp': 35.0,
'min_temp': 7.0, 'min_temp': 7.0,

View File

@ -817,10 +817,10 @@ async def test_updating_humidity(
( (
Capability.THERMOSTAT_MODE, Capability.THERMOSTAT_MODE,
Attribute.SUPPORTED_THERMOSTAT_MODES, Attribute.SUPPORTED_THERMOSTAT_MODES,
["coolClean", "dryClean"], ["rush hour", "heat"],
ATTR_HVAC_MODES, ATTR_HVAC_MODES,
[], [HVACMode.AUTO],
[HVACMode.COOL, HVACMode.DRY], [HVACMode.AUTO, HVACMode.HEAT],
), ),
], ],
ids=[ ids=[