Closed uzlonewolf closed 1 year ago
Thanks @uzlonewolf ! I'm going to work on a PyPI release.
I released this as v1.9.0 - Thanks @uzlonewolf!
One minor issue I see... During my testing, I'm seeing a random "0" show up during wizard
:
TinyTuya Setup Wizard [1.9.0]
Existing settings:
API Key=abcdefghijklmnopqrstuv
Secret=1234567890abcdef1234567890abcdef1
DeviceID=123abc4567890abcdef12
Region=us
Use existing credentials (Y/n):
0
Device Listing
The culprit is the Cloud init call due to _gettoken()
:
log.warning(self.server_time_offset)
Since it is a warning, it is showing up under normal conditions so I'll drop it to debug
:
log.debug("server_time_offset: %r", self.server_time_offset)
Ah, oops, I had intended to delete that line but it would seem I forgot. Thanks for the catch and fix.
I noticed the Cloud documentation calls for 13-digit timestamps, however I was sending 10-digit UNIX timestamps. It seemed to work fine, but I decided it would be better to match the official documentation. So it now sends a 13-digit
int(time.time() * 1000)
. I also reworked it so you can pass a negative number for that many days ago (i.e. -2 means 2 days ago) and added automatic server time offset compensation.Documentation for the above as well as the Zigbee Gateway example were added.