Skip to content

Accessing "missing" DPs #373

Answered by uzlonewolf
hazzabeee asked this question in Q&A
Jun 26, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Some DPs are not sent in status requests, they're only sent asynchronously when the value changes. Try running this:

import time
import tinytuya

d = tinytuya.Device( 'your_device_id_here', persist=True )

print( 'Found:', d )
print( 'Status:',  d.status() )

print(" > Begin Monitor Loop <")
pingtime = time.time() + 9

while(True):
    if( pingtime <= time.time() ):
        payload = d.generate_payload(tinytuya.HEART_BEAT)
        data = d.send(payload)
        pingtime = time.time() + 9
        if data:
            print( time.time(), data )

    data = d.receive()
    if data:
        print( time.time(), data )

and while that's running make a change to the schedule in the app.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hazzabeee
Comment options

Answer selected by hazzabeee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants