Skip to content

am i doing smth wrong? #203

Answered by uzlonewolf
loneymist asked this question in Q&A
Oct 25, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

set_colour() is only available with BulbDevice, not OutletDevice, so change d = tinytuya.OutletDevice('abc', 'abc', 'abc') to d = tinytuya.BulbDevice('abc', 'abc', 'abc'). As that is a "Type B" bulb device, it uses DPS 20 for on/off control instead of the default DPS 1; you need to either make the above OutletDevice -> BulbDevice change (since BulbDevice handles this for you) or pass switch=20 to turn_on/turn_off with d.turn_off(switch=20)

Replies: 1 comment 1 reply

Comment options

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

Answer selected by loneymist
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