-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Cannot retrieve device status with .get #663
Comments
This allows me to make the .get work but if between two I do a .set the .get no longer works |
Possibly this if it's a 3.5 device #623 (comment) |
I solved my problem. I haven't had much time recently so I just spent an hour to figure out what I needed to use the Tuya API (GET and SET power), I don't know if it breaks anything else in the code and if it is compatible with other versions than my device (3.4). I'll give you the patches but use them with caution because I didn't bother to understand all the code but only a small part to solve my problem. (The lines to be added are the last lines of the two codes below, it might be a good idea to nest them in a condition for version 3.4) line '778' if (
(
packet.commandByte === CommandType.CONTROL ||
packet.commandByte === CommandType.CONTROL_NEW
) && packet.payload === false) {
delete this._resolvers[packet.sequenceN]; line '861' // Status response to SET command
if (
packet.commandByte === CommandType.STATUS &&
typeof this._setResolver === 'function'
) {
this._currentSequenceN++; |
Sorry but I do not understand how these changes help ... without a debug log this is very strange. Because just to increase sequence counter is strange ... and just deleting a resolver will not resolve anything ... |
@seb3x97 Try again with latest master and see if you still have the same issue. |
I can start and stop my smartplug but when i try to get the status with the "get" function, the code never ends and doesn't return anything.
This is my code :
The text was updated successfully, but these errors were encountered: