Enable HomeWizard Battery group mode by default when device controls batteries#159493
Merged
joostlek merged 2 commits intohome-assistant:devfrom Dec 23, 2025
Merged
Conversation
Merged
8 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modifies the HomeWizard integration to enable the battery group mode select entity by default when the device has control over batteries (battery_count > 0), rather than always having it disabled by default. This improves user experience by making the battery control feature more discoverable for users with battery systems.
Key changes:
- Dynamic entity enablement based on battery_count in the device data
- Updated tests to verify the new default behavior for devices with and without batteries
- Added new test fixture for P1 device without batteries to test disabled-by-default scenario
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| homeassistant/components/homewizard/select.py | Added logic to check battery_count and set entity_registry_enabled_default dynamically based on whether device controls batteries |
| tests/components/homewizard/test_select.py | Removed entity_registry_enabled_by_default fixture from tests since entity is now enabled by default for devices with batteries; added new test for disabled-by-default behavior with HWE-P1-no-batteries fixture |
| tests/components/homewizard/fixtures/HWE-P1-no-batteries/device.json | New test fixture for P1 device without batteries |
| tests/components/homewizard/fixtures/HWE-P1-no-batteries/data.json | New test fixture with complete P1 meter data |
| tests/components/homewizard/fixtures/HWE-P1-no-batteries/batteries.json | New test fixture with battery_count=0 to represent device without battery control |
| tests/components/homewizard/fixtures/HWE-P1-no-batteries/system.json | New test fixture with system configuration |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
joostlek
approved these changes
Dec 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Battery group mode was always disabled by default, but with this PR we enable it by default when the P1 Meter / kWh Meter has control over batteries.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: