Skip to content

Commit

Permalink
Fixed issue with thermostat parsing [Closes #6]
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun Tarves committed Apr 28, 2021
1 parent f8fd091 commit b79ebdc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wyze_sdk/models/devices/thermostats.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def fan_mode(self) -> ThermostatFanMode:

@fan_mode.setter
def fan_mode(self, value: Union[str, DeviceProp]):
if value is None:
return
if isinstance(value, str):
value = DeviceProp(definition=ThermostatProps.fan_mode, value=value)
self._fan_mode = ThermostatFanMode.parse(value.value)
Expand All @@ -229,6 +231,8 @@ def system_mode(self) -> ThermostatSystemMode:

@system_mode.setter
def system_mode(self, value: Union[str, DeviceProp]):
if value is None:
return
if isinstance(value, str):
value = DeviceProp(definition=ThermostatProps.system_mode, value=value)
self._system_mode = ThermostatSystemMode.parse(value.value)
Expand All @@ -239,6 +243,8 @@ def current_scenario(self) -> ThermostatScenarioType:

@current_scenario.setter
def current_scenario(self, value: Union[str, DeviceProp]):
if value is None:
return
if isinstance(value, str):
value = DeviceProp(definition=ThermostatProps.current_scenario, value=value)
self._current_scenario = ThermostatScenarioType.parse(value.value)
Expand Down

0 comments on commit b79ebdc

Please sign in to comment.