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
1 changed files with 6 additions and 4 deletions
|
@ -497,14 +497,16 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity):
|
|||
"""Return the unit of measurement."""
|
||||
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."""
|
||||
supported_swings = None
|
||||
supported_modes = self._device.status.attributes[
|
||||
Attribute.supported_fan_oscillation_modes
|
||||
][0]
|
||||
supported_swings = [
|
||||
FAN_OSCILLATION_TO_SWING.get(m, SWING_OFF) for m in supported_modes
|
||||
]
|
||||
if supported_modes is not None:
|
||||
supported_swings = [
|
||||
FAN_OSCILLATION_TO_SWING.get(m, SWING_OFF) for m in supported_modes
|
||||
]
|
||||
return supported_swings
|
||||
|
||||
async def async_set_swing_mode(self, swing_mode: str) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue