GadgetReactor / pyHS100

Python Library to control TPLink Switch (HS100 / HS110)
Other
409 stars 128 forks source link

Check for errors also in the command payload #173

Closed rytilahti closed 5 years ago

rytilahti commented 5 years ago

For example, trying to set unsupported color temperature will cause such response. This gets ignored at the moment completely, so there is no indication at all why the command caused no effect on the device.

> (93) {"smartlife.iot.smartbulb.lightingservice": {"transition_light_state": {"color_temp": 6000}}}
< (125) {"smartlife.iot.smartbulb.lightingservice":{"transition_light_state":{"err_code":-10000,"err_msg":"Invalid input argument"}}}

In comparison, this is an error reported when unavailable module is being accessed:

DEBUG:pyHS100.protocol:> (28) {"time": {"get_time": null}}
DEBUG:pyHS100.protocol:< (58) {"time":{"err_code":-2001,"err_msg":"Module not support"}}
coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.1%) to 72.497% when pulling 34fca5298f308b0e335261572d84612deda2f10c on rytilahti:fix_error_reporting into 60add6fa66b9498f19f6bac31f1fdce53044ffcb on GadgetReactor:master.