Add Zendure Smart Meter P1 integration#171027
Draft
NextNebula wants to merge 20 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the new zendure_p1 Home Assistant integration (Zendure Smart Meter P1) with config flow + coordinator-driven sensor entities, plus test coverage and required metadata/requirements.
Changes:
- Introduces the
zendure_p1integration (config flow, coordinator, base entity, sensors, translations, manifest, quality scale) - Adds comprehensive pytest coverage + snapshots for config flow, init/unload, entities, and sensor values
- Registers the integration in generated registries, requirements files, and CODEOWNERS
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| homeassistant/components/zendure_p1/init.py | Sets up config entry, coordinator, unload/reload wiring |
| homeassistant/components/zendure_p1/config_flow.py | Implements user config flow and host validation |
| homeassistant/components/zendure_p1/coordinator.py | Polling coordinator and error translation mapping |
| homeassistant/components/zendure_p1/sensor.py | Coordinator-backed sensor entities and descriptions |
| homeassistant/components/zendure_p1/entity.py | Base CoordinatorEntity + DeviceInfo |
| homeassistant/components/zendure_p1/const.py | Defines domain/platforms + polling interval |
| homeassistant/components/zendure_p1/strings.json | UI strings, entity names, exception translations |
| homeassistant/components/zendure_p1/manifest.json | Integration metadata + dependency pin |
| homeassistant/components/zendure_p1/quality_scale.yaml | Declares quality scale rule status |
| tests/components/zendure_p1/conftest.py | Shared fixtures/mocks for integration tests |
| tests/components/zendure_p1/test_config_flow.py | Config flow success/abort/error handling tests |
| tests/components/zendure_p1/test_init.py | Setup/unload and setup-retry tests |
| tests/components/zendure_p1/test_entity.py | Device registry association test |
| tests/components/zendure_p1/test_sensor.py | Snapshot + coordinator refresh value assertions |
| tests/components/zendure_p1/snapshots/test_sensor.ambr | Sensor entity/state snapshots |
| homeassistant/generated/integrations.json | Registers integration metadata |
| homeassistant/generated/config_flows.py | Registers config flow domain |
| requirements_all.txt | Adds runtime dependency for integration |
| requirements_test_all.txt | Adds test dependency for integration |
| CODEOWNERS | Adds code ownership for integration + tests |
| ZendureP1TimeoutError, | ||
| ) as err: | ||
| LOGGER.debug("Cannot connect to Zendure P1: %s", err) | ||
| errors["base"] = "cannot_connect" |
| self._attr_device_info = DeviceInfo( | ||
| identifiers={(DOMAIN, coordinator.data.device_id)}, | ||
| manufacturer="Zendure", | ||
| name="Smart Meter P1", |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR adds a new integration for the Zendure Smart Meter P1, a local P1 smart meter dongle that reads energy data from a smart meter and exposes it via a local HTTP API. The integration uses a
DataUpdateCoordinatorto poll the device and exposes the reported values as sensor entities. It communicates with devices on the local network using thezendure-p1library.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: