mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 21:37:07 +00:00
fix supportedFanOscillationModes is null (#105205)
* fix supportedFanOscillationModes is null * set default supported_swings to None * return None if no fan oscillation modes listed
This commit is contained in:
parent
d86abf214b
commit
83a1ca5e83
@ -497,14 +497,16 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity):
|
|||||||
"""Return the unit of measurement."""
|
"""Return the unit of measurement."""
|
||||||
return UNIT_MAP[self._device.status.attributes[Attribute.temperature].unit]
|
return UNIT_MAP[self._device.status.attributes[Attribute.temperature].unit]
|
||||||
|
|
||||||
def _determine_swing_modes(self) -> list[str]:
|
def _determine_swing_modes(self) -> list[str] | None:
|
||||||
"""Return the list of available swing modes."""
|
"""Return the list of available swing modes."""
|
||||||
|
supported_swings = None
|
||||||
supported_modes = self._device.status.attributes[
|
supported_modes = self._device.status.attributes[
|
||||||
Attribute.supported_fan_oscillation_modes
|
Attribute.supported_fan_oscillation_modes
|
||||||
][0]
|
][0]
|
||||||
supported_swings = [
|
if supported_modes is not None:
|
||||||
FAN_OSCILLATION_TO_SWING.get(m, SWING_OFF) for m in supported_modes
|
supported_swings = [
|
||||||
]
|
FAN_OSCILLATION_TO_SWING.get(m, SWING_OFF) for m in supported_modes
|
||||||
|
]
|
||||||
return supported_swings
|
return supported_swings
|
||||||
|
|
||||||
async def async_set_swing_mode(self, swing_mode: str) -> None:
|
async def async_set_swing_mode(self, swing_mode: str) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user