Skip to content

Conversation

@Caius-Bonus
Copy link
Contributor

@Caius-Bonus Caius-Bonus commented Feb 1, 2024

Breaking Change

Unfortunately, the internal state will have to change from the current form (titles with spaces and the first letter, but sometimes multiple letters, being a capital; some are even CamelCase) to snake_case without any capitals or spaces. Automations that depend on this will seize to function, unless we come up with some mitigation.

Proposed change

Convert enums to lowercase snake_case in Sensor and Select entities.
Add translations for EnumSensor and EnumSelectEntity entities in zigpy/zha.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Some _attr_translation_keys in zigpy/zha needed to be changed, because of overlap.

Some enum value names were CamelCase (for compatibility, these haven't been changed).
Some enum values had multiple capitals (for compatibility, these haven't been changed).

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Feb 1, 2024

Hey there @dmulcahey, @Adminiuga, @puddly, @TheJulianJES, mind taking a look at this pull request as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zha can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign zha Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@Caius-Bonus Caius-Bonus marked this pull request as draft February 1, 2024 14:10
@Caius-Bonus Caius-Bonus changed the title Translate enums in EnumSensors and ZHAEnumSelectEntitys Translate enums in EnumSensor and ZHAEnumSelectEntity entities Feb 1, 2024
@Caius-Bonus Caius-Bonus changed the title Translate enums in EnumSensor and ZHAEnumSelectEntity entities Allow translations for enum values in EnumSensor and ZHAEnumSelectEntity entities Feb 1, 2024
@Caius-Bonus Caius-Bonus marked this pull request as ready for review June 20, 2024 15:05
@home-assistant home-assistant bot requested a review from TheJulianJES June 20, 2024 15:05
@Caius-Bonus Caius-Bonus marked this pull request as draft June 20, 2024 15:55
@dmulcahey
Copy link
Contributor

dmulcahey commented Jul 10, 2024

We have recently migrated the core of ZHA to its own library: https://github.com/zigpy/zha. This is going to have to be reworked to an extent. Sorry for the inconvenience and Thanks!

@Caius-Bonus
Copy link
Contributor Author

Thanks for the heads-up. I reworked it and made a complementary PR in zigpy/zha.

@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label Sep 16, 2024
@Caius-Bonus
Copy link
Contributor Author

If there is still interest in this getting merged, I am willing to continue to work on it.

@github-actions github-actions bot removed the stale label Sep 22, 2024
@emontnemery
Copy link
Contributor

@Caius-Bonus I think the zigpy/zha PR needs to be accepted and merged before this PR can move forward?

@Caius-Bonus
Copy link
Contributor Author

That is correct. But I haven't heard back yet from @puddly, so I don't know how to move forward yet.

@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label Dec 15, 2024
@Caius-Bonus
Copy link
Contributor Author

I still want to work on it, but I have been busy.

@github-actions github-actions bot removed the stale label Dec 17, 2024
@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label Feb 15, 2025
@github-actions github-actions bot closed this Feb 23, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants