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

Remove defaulting of translation_key #251

Merged

Conversation

TheJulianJES
Copy link
Contributor

@TheJulianJES TheJulianJES commented Oct 21, 2024

Part 2 of changes related to: zigpy/zigpy#1488

Proposed change

translation_key no longer defaults to attribute_name or command_name.
There's more information in the linked zigpy PR below on why this should be the case.

Additional information

Somewhat requires this zigpy PR to ensure translation_key or device_class is provided for a proper name:

Requires for tests to pass:

I wanted to keep these changes separate from #252, as the changes are only semi-related.

`translation_key` no longer defaults to `attribute_name` or `command_name`.
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.31%. Comparing base (c6c1888) to head (b41f15c).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #251      +/-   ##
==========================================
+ Coverage   96.27%   96.31%   +0.04%     
==========================================
  Files          61       61              
  Lines        9367     9363       -4     
==========================================
  Hits         9018     9018              
+ Misses        349      345       -4     

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

@TheJulianJES TheJulianJES marked this pull request as ready for review October 21, 2024 17:36
@puddly
Copy link
Contributor

puddly commented Oct 21, 2024

Will this require any changes in quirks, to manually add the defaults?

@TheJulianJES
Copy link
Contributor Author

TheJulianJES commented Oct 21, 2024

Somewhat. When zigpy is bumped in the quirks repo, quirks missing translation_key will fail to validate.
At the moment, the zha-quirks version used for ZHA doesn't contain any quirks v2 entities.
The next version of zha-quirks will contain quirks v2 entities, but in the quirks repo, a translation_key and fallback_name is already present for all of those. (only some tests were missing it: zigpy/zha-device-handlers#3449)

So, only custom quirks would need changes. But they'll throw a validation error with the next zigpy version if they're missing fallback_name or translation_key.

@TheJulianJES TheJulianJES merged commit 922f266 into zigpy:dev Oct 26, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants