TradeFace / tuyaface

Python Tuya client that allows you to locally communicate with tuya devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sending ping at the wrong moment

jkerdreux-imt opened this issue · comments

Devices are really tedious to works with. Look at this one :

2020-05-27 23:08:24 i7 tuyaface[98800] DEBUG (192.168.1.66) received msg (seq 0): [8:STATUS] rc: [0] payload: [{"devId":"42361312d8f15bd5a25a","dps":{"19":122},"t":1590613704}]
{'devId': '42361312d8f15bd5a25a', 'dps': {'19': 122}, 't': 1590613704}
2020-05-27 23:08:24 i7 tuyaface.tuyaclient[98800] DEBUG (192.168.1.66) PING
2020-05-27 23:08:24 i7 tuyaface[98800] DEBUG (192.168.1.66) sending msg (seq 18): [9:HEART_BEAT] payload: [None]
2020-05-27 23:08:24 i7 tuyaface.tuyaclient[98800] ERROR (192.168.1.66) exception when reading from socket

Every time it's send a status update (outlet w/ power-rmeter tends to send status frequently), you must wait a bit before sending a PING, if not .. you will receive a connection reset.

Yeah strange stuff. You would expect the hand out a SDK to the people that implement their stuff in devices. Maybe they work with a rough spec. :)