-
Notifications
You must be signed in to change notification settings - Fork 737
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
Add Tuya QUERY_DATA
command
#2888
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2888 +/- ##
=======================================
Coverage 87.56% 87.56%
=======================================
Files 293 293
Lines 8997 8998 +1
=======================================
+ Hits 7878 7879 +1
Misses 1119 1119 ☔ View full report in Codecov by Sentry. |
@@ -1488,6 +1489,9 @@ class TuyaNewManufCluster(CustomCluster): | |||
ep_attribute: str = "tuya_manufacturer" | |||
|
|||
server_commands = { | |||
TUYA_QUERY_DATA: foundation.ZCLCommandDef( | |||
"query_data", {}, False, is_manufacturer_specific=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no data
structure for this command?
Can you point us to any command message or use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are Tuya devices that will not start nor send information w/o DATA_QUERY messages. For these, a DATA_QUERY package has to be sent on startup and also later for polling: no information is sent except if a DATA_QUERY packet is sent.
See the forthcoming zha-quirk for an example of usage in ZHA. I followed the suggestion of TheJulianJES here.
See also the corresponding code in Z2MQTT here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Proposed change
Some tuya devices require a query_data to be responsive and provide data.
As suggested by tjj, this just provides this ability to quirks.
Additional information
Contributes to fixing #2565
EDIT:
Follow-up PR that adds the "Tuya query data spell":
Checklist
pre-commit
checks pass / the code has been formatted using BlackCouldn't find a significant test.