Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Cloud log start/end times, and update documentation #229

Merged
merged 2 commits into from
Dec 3, 2022

Conversation

uzlonewolf
Copy link
Collaborator

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.

@jasonacox jasonacox merged commit 9b61c74 into jasonacox:master Dec 3, 2022
@jasonacox
Copy link
Owner

Thanks @uzlonewolf ! I'm going to work on a PyPI release.

@jasonacox
Copy link
Owner

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)

jasonacox added a commit that referenced this pull request Dec 3, 2022
@uzlonewolf
Copy link
Collaborator Author

Ah, oops, I had intended to delete that line but it would seem I forgot. Thanks for the catch and fix.

@uzlonewolf uzlonewolf deleted the cloud-logs branch December 4, 2022 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants