Skip to content
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 quirk builder docs #3480

Merged
merged 21 commits into from
Dec 9, 2024

Conversation

prairiesnpr
Copy link
Collaborator

@prairiesnpr prairiesnpr commented Nov 3, 2024

Proposed change

This adds initial documentation for using the TuyaQuirkBuilder. We have a few examples, but nothing as far as documentation. We also don't have documentation for the V2 QuirkBuilder, may need that prior to adding this.

Formatted Version

Additional information

As plainly evident, technical documentation is not one of my strongpoints, any suggestions would be welcome.

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

Copy link

codecov bot commented Nov 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.79%. Comparing base (728ee42) to head (b4fc995).
Report is 38 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3480      +/-   ##
==========================================
+ Coverage   89.44%   89.79%   +0.34%     
==========================================
  Files         311      323      +12     
  Lines       10033    10414     +381     
==========================================
+ Hits         8974     9351     +377     
- Misses       1059     1063       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Nov 3, 2024
@prairiesnpr prairiesnpr changed the title [WIP] Tuya quirk builder docs Add Tuya quirk builder docs Nov 3, 2024
@TheJulianJES TheJulianJES added the needs review This PR should be reviewed soon, as it generally looks good. label Nov 24, 2024
Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I've made some minor changes that I'll commit in a second.
I'll take another look at the finished text then.

README.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
tuya.md Outdated Show resolved Hide resolved
Comment on lines +3 to +4
> [!IMPORTANT]
> The following should work for most Tuya devices. Some devices may require additional reverse engineering to unlock all functions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, now that I actually look at it, maybe we don't really need the fancy markdown here.
Preview: https://github.com/zigpy/zha-device-handlers/blob/b4fc995f9833a0a173c6aac9310815f0fcf860aa/tuya.md

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh, but maybe it's fine 😄

@TheJulianJES TheJulianJES merged commit 9d34934 into zigpy:dev Dec 9, 2024
9 checks passed
@inigortega
Copy link

inigortega commented Dec 10, 2024

Thanks! This merge will be pull requested to official zha quirks tree? It includes tuya rain sensor quirk?

@prairiesnpr
Copy link
Collaborator Author

Thanks! This merge will be pull requested to official zha quirks tree? It includes tuya rain sensor quirk?

This is just a doc PR, never heard any feedback on the rain sensor, if you want to test and let me know, I can PR it.

@inigortega
Copy link

inigortega commented Dec 10, 2024

Yes, I want to test tuya rain sensor quirk.
ts0207.py

@prairiesnpr
Copy link
Collaborator Author

Yes, I want to test tuya rain sensor quirk. ts0207.py

Please move conversation to #3475

There is a quirk in the comments section you can try.

@prairiesnpr prairiesnpr deleted the Tuya-Quirk-Builder-Docs branch December 27, 2024 02:44
@@ -9,6 +9,9 @@ ZHA device handlers bridge the functionality gap created when manufacturers devi

Custom quirks implementations for zigpy implemented as ZHA Device Handlers are a similar concept to that of [Hub-connected Device Handlers for the SmartThings Classics platform](https://stdavedemo.readthedocs.io/en/latest/device-type-developers-guide/) as well that of [Zigbee-Herdsman Converters (formerly Zigbee-Shepherd Converters) as used by Zigbee2mqtt](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html), meaning they are virtual representation of a physical device that expose additional functionality that is not provided out-of-the-box by the existing integration between these platforms. See [Device Specifics](#Device-Specifics) for details.


For supporting Tuya devices, see [using the TuyaQuirkBuilder](/tuya.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor, but just realized this link isn't clickable on PyPi now, as it leads to https://pypi.org/tuya.md then.
We may want to use the full link here? Or at least see what (our) other repos do. Probably doesn't really matter though 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't even consider PyPi when I did that. Once we get this latest batch of PRs through, I need to add the new convenience methods to the docs and will change this to the full link on that PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't think anybody reads the docs there, but.. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review This PR should be reviewed soon, as it generally looks good. Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants