Skip to content

Implement battery group mode in HomeWizard #146770

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

Merged
merged 13 commits into from
Jun 20, 2025

Conversation

DCSBL
Copy link
Contributor

@DCSBL DCSBL commented Jun 13, 2025

Proposed change

Add support for Battery Group Mode. This feature allows switching between different control modes. The P1 Meter controls the group of batteries (or a battery), so the select is implemented for the P1 Meter.

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

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.

To help with the load of incoming pull requests:

Comment on lines +44 to +48
except UnauthorizedError as ex:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="api_unauthorized",
) from ex
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actual handing of this case is done by coordinator (raises a repair)

}
},
"exceptions": {
"api_disabled": {
"message": "The local API is disabled."
},
"api_unauthorized": {
"message": "The local API is unauthorized. Restore API access by following the instructions in the repair issue."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we have a better refer?

@DCSBL DCSBL marked this pull request as ready for review June 13, 2025 19:44
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft June 16, 2025 20:18
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
@DCSBL DCSBL marked this pull request as ready for review June 17, 2025 08:02
@home-assistant home-assistant bot requested a review from joostlek June 17, 2025 08:02
Copy link
Contributor Author

@DCSBL DCSBL left a comment

Choose a reason for hiding this comment

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

Updated the translation to match what we use in the HomeWizard Energy app

@DCSBL
Copy link
Contributor Author

DCSBL commented Jun 19, 2025

@joostlek, I think this PR is ready for another review, but first, can you see why the check fails?

@joostlek joostlek changed the title Implement battery group mode Implement battery group mode in HomeWizard Jun 20, 2025
@joostlek joostlek merged commit a493bdc into home-assistant:dev Jun 20, 2025
34 checks passed
hanwg pushed a commit to hanwg/core that referenced this pull request Jun 21, 2025
* Implement battery group mode for HomeWizard P1

* Clean up test

* Disable 'entity_registry_enabled_default'

* Fix failing tests because of 'entity_registry_enabled_default'

* Proof entities are disabled by default

* Undo dev change

* Update homeassistant/components/homewizard/select.py

* Update homeassistant/components/homewizard/select.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/homewizard/strings.json

* Apply suggestions from code review

* Update tests due to updated translations

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 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.

4 participants