-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
notes on refresh() #460
Comments
Thanks for investigating this. Are you recommending that something be changed, or just posting your findings?
Absolutely. But
is also potentially only supporting a small subset. :) |
Yes also my finding was that devices even my react strange up to "reboot themself" when being queried for the wrong data via refresh method. So be careful I have better results for "Other" fileds then the hard defined "refresh" ones with the "query via "set null"" way |
Codetheweb, Apollon77: Suggestion? yes: simplify. To handle the tuya devices I make some radical choices:
In that contest, I pose to tuya experts the question:
More general:
It's a challenge: Tuya strives to make things complicated ... and we react. Best Regards |
The topic is in my eyes if the library is there to offer conventient functionalities for the library users or if it offers pure "tech functionality". In second case any developer that want to use the libra yneeds to dive very deep into the prtocol and limitations and specialities and need to implement things (like "do the DP support refresh or set(Null) or is normally pushed" is a good example. |
I like this idea, but it's just not really compatible with the way TuyAPI works now.
Yes and no. The fallbacks need to be in place for the different types of devices. As @Apollon77 mentions above, the goal of this project is to provide a bit of a middle ground between implementing everything from scratch and having everything handled for you. Longer answer in the README. |
I have a device (a AC power meter), protocol 3.3, who accepts
refresh()
, so I done some tests (see also ISSUE#54 ISSUE#56).Tuya
refresh
objectifsOn Tuya ecosystem the
refresh
is used to optimize the data update when a faster rate is required to enhance the user experience.To reduce resource use, the fast refresh is limited only when required: for example, smartLife uses a rate of 5 sec. only when the user interface is visible.
refresh()
in tuyapi 7.1.0Are possible 3 different call of refresh():
tuya.refresh();
called also 'refresh'tuya.refresh({dps: 2});
called also 'dp-refresh'test
I made many tests with my device, also at very fast rate (1 s). example:
RFR 20 {"operation":"RFR", "dps":"20"} repeat every 1 sec:
For my device is valid the following:
This rule is coherent with Tuya refresh objectives and minimizes the bandwidth use.
more notes
index.js
code. I changed it, I eliminate the 20 dp, I make the arrays empty: nothing changed in my device behavior, always RULE1.conclusions
We know: any tuya device can have its own behavior: tuya devices use a poll of common code, but they are designed by different manufacturers, with objectives and exigences very different. (e.g.: some manufacturers try to promote their apps, reducing the performance of their products in Tuya environment).
Usually is very dangerous to do generalizations based on few cases. With tuya devices, impossible.
Best Regards
m.s.
The text was updated successfully, but these errors were encountered: