mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Add preset mode to SmartThings climate (#142180)
* Add preset mode to SmartThings climate * Add preset mode to SmartThings climate
This commit is contained in:
parent
4643fc2c14
commit
2a4996055a
@ -333,7 +333,6 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity):
|
|||||||
"""Define a SmartThings Air Conditioner."""
|
"""Define a SmartThings Air Conditioner."""
|
||||||
|
|
||||||
_attr_name = None
|
_attr_name = None
|
||||||
_attr_preset_mode = None
|
|
||||||
|
|
||||||
def __init__(self, client: SmartThings, device: FullDevice) -> None:
|
def __init__(self, client: SmartThings, device: FullDevice) -> None:
|
||||||
"""Init the class."""
|
"""Init the class."""
|
||||||
@ -545,6 +544,18 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity):
|
|||||||
SWING_OFF,
|
SWING_OFF,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def preset_mode(self) -> str | None:
|
||||||
|
"""Return the preset mode."""
|
||||||
|
if self.supports_capability(Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE):
|
||||||
|
mode = self.get_attribute_value(
|
||||||
|
Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE,
|
||||||
|
Attribute.AC_OPTIONAL_MODE,
|
||||||
|
)
|
||||||
|
if mode == WINDFREE:
|
||||||
|
return WINDFREE
|
||||||
|
return None
|
||||||
|
|
||||||
def _determine_preset_modes(self) -> list[str] | None:
|
def _determine_preset_modes(self) -> list[str] | None:
|
||||||
"""Return a list of available preset modes."""
|
"""Return a list of available preset modes."""
|
||||||
if self.supports_capability(Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE):
|
if self.supports_capability(Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE):
|
||||||
|
@ -473,7 +473,7 @@
|
|||||||
"timestamp": "2024-09-10T10:26:28.781Z"
|
"timestamp": "2024-09-10T10:26:28.781Z"
|
||||||
},
|
},
|
||||||
"acOptionalMode": {
|
"acOptionalMode": {
|
||||||
"value": "off",
|
"value": "windFree",
|
||||||
"timestamp": "2025-02-09T09:14:39.642Z"
|
"timestamp": "2025-02-09T09:14:39.642Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -211,7 +211,7 @@
|
|||||||
]),
|
]),
|
||||||
'max_temp': 35,
|
'max_temp': 35,
|
||||||
'min_temp': 7,
|
'min_temp': 7,
|
||||||
'preset_mode': None,
|
'preset_mode': 'windFree',
|
||||||
'preset_modes': list([
|
'preset_modes': list([
|
||||||
'windFree',
|
'windFree',
|
||||||
]),
|
]),
|
||||||
|
@ -1065,7 +1065,7 @@
|
|||||||
'custom.airConditionerOptionalMode': dict({
|
'custom.airConditionerOptionalMode': dict({
|
||||||
'acOptionalMode': dict({
|
'acOptionalMode': dict({
|
||||||
'timestamp': '2025-02-09T09:14:39.642Z',
|
'timestamp': '2025-02-09T09:14:39.642Z',
|
||||||
'value': 'off',
|
'value': 'windFree',
|
||||||
}),
|
}),
|
||||||
'supportedAcOptionalMode': dict({
|
'supportedAcOptionalMode': dict({
|
||||||
'timestamp': '2024-09-10T10:26:28.781Z',
|
'timestamp': '2024-09-10T10:26:28.781Z',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user