Skip to content

Commit

Permalink
fix: Fix for code smells in thermostat_service.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Mulliken committed Jul 2, 2021
1 parent 8ae07c4 commit bf73dc0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/wyzeapy/services/thermostat_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ def __init__(self, dictionary: Dict[Any, Any]):

class ThermostatService(BaseService):
async def update(self, thermostat: Thermostat) -> Thermostat:
if DeviceTypes(thermostat.product_type) not in [
DeviceTypes.THERMOSTAT
]:
raise ActionNotSupported(thermostat.product_type)

properties = (await self._thermostat_get_iot_prop(thermostat))['data']['props']

device_props = []
Expand Down Expand Up @@ -98,7 +93,7 @@ async def update(self, thermostat: Thermostat) -> Thermostat:
elif prop == ThermostatProps.TEMPERATURE:
thermostat.temperature = float(value)
elif prop == ThermostatProps.IOT_STATE:
thermostat.available = False if not value == 'connected' else True # pylint: disable=R1719
thermostat.available = value == 'connected'
elif prop == ThermostatProps.HUMIDITY:
thermostat.humidity = int(value)
elif prop == ThermostatProps.WORKING_STATE:
Expand Down

0 comments on commit bf73dc0

Please sign in to comment.