jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
923 stars 165 forks source link

Fix fan_run_time typo in Contrib/ThermostatDevice #326

Closed elockman closed 1 year ago

elockman commented 1 year ago

This is needed to update the fan runtime during fan cycle mode

elockman commented 1 year ago

Resolves the following error:

Requested key 'fan_runtime' not found!
Traceback (most recent call last):
  File "/home/user/projects/xeal/tuya/new_test/tinytuya/examples/test_stat.py", line 31, in <module>
    tstatdev.setFanRuntime( 15 )
  File "/home/user/.local/lib/python3.9/site-packages/tinytuya/Contrib/ThermostatDevice.py", line 350, in setFanRuntime
    return self.setValue( 'fan_runtime', int(rt) )
  File "/home/user/.local/lib/python3.9/site-packages/tinytuya/Contrib/ThermostatDevice.py", line 353, in setValue
    dps, val = self.parseValue( key, val )
TypeError: cannot unpack non-iterable bool object
uzlonewolf commented 1 year ago

Thanks @elockman !