Add Elk E27 Alarm Engine integration#170241
Conversation
There was a problem hiding this comment.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
When adding new integrations, limit included platforms to a single platform. Please reduce this PR to a single platform. See the review process for more details.
There was a problem hiding this comment.
Pull request overview
Adds a new Home Assistant integration (elke27) to support the Elk Products E27 Alarm Engine via the elke27_lib client library, including config flow onboarding, a hub/coordinator runtime model, multiple entity platforms, diagnostics, and a comprehensive test suite.
Changes:
- Introduces the
elke27integration (manifest, config flow, hub + coordinator, entity platforms, services, translations/icons, diagnostics). - Adds unit tests (and opt-in live tests) covering setup, hub behavior, coordinator event handling, entities, and diagnostics.
- Adds integration docs and a quality scale tracking file.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/components/elke27/init.py | Test package marker for the integration tests. |
| tests/components/elke27/README.md | Documents unit vs. opt-in live test execution and env vars. |
| tests/components/elke27/test_alarm_control_panel.py | Tests area entity state mapping and arm/disarm behavior. |
| tests/components/elke27/test_binary_sensor.py | Tests zone entity creation, device class mapping, and edge cases. |
| tests/components/elke27/test_climate.py | Tests thermostat entity behavior and hub command delegation. |
| tests/components/elke27/test_coordinator.py | Tests coordinator subscriptions, debouncing, and event-driven refreshes. |
| tests/components/elke27/test_diagnostics.py | Tests diagnostics payload generation and redaction/serialization. |
| tests/components/elke27/test_entity.py | Tests shared entity helpers (unique base, device info, panel fields). |
| tests/components/elke27/test_hub.py | Tests hub lifecycle, reconnect logic, and command methods. |
| tests/components/elke27/test_identity.py | Tests integration-serial generation and MAC/source-IP lookup behavior. |
| tests/components/elke27/test_init.py | Tests integration setup/unload, unique-id migration, and service behavior. |
| tests/components/elke27/test_light.py | Tests light entity behavior including brightness mapping. |
| tests/components/elke27/test_live.py | Adds opt-in live tests gated by env vars/markers. |
| tests/components/elke27/test_lock.py | Tests lock entities and hub command delegation. |
| tests/components/elke27/test_sensor.py | Tests diagnostic sensors reflecting coordinator/hub state. |
| tests/components/elke27/test_switch.py | Tests output switches and hub delegation + PIN-required handling. |
| homeassistant/components/elke27/init.py | Sets up config entries, forwards platforms, registers alarm_arm_automatic service, migrates unique IDs. |
| homeassistant/components/elke27/alarm_control_panel.py | Implements area alarm control panel entities and state mapping. |
| homeassistant/components/elke27/binary_sensor.py | Implements zone binary sensor entities driven by snapshot + definitions. |
| homeassistant/components/elke27/climate.py | Implements thermostat entities with mode/fan/setpoint support. |
| homeassistant/components/elke27/config_flow.py | Implements discovery/manual onboarding and relink/reauth flow. |
| homeassistant/components/elke27/const.py | Defines integration constants and config keys. |
| homeassistant/components/elke27/coordinator.py | Coordinator for event-driven snapshot updates and domain refresh debouncing. |
| homeassistant/components/elke27/diagnostics.py | Generates diagnostics and normalizes/redacts snapshot data. |
| homeassistant/components/elke27/docs/Change-Order-Plan.md | Internal development plan for incremental integration milestones. |
| homeassistant/components/elke27/docs/integration-docs.md | Integration documentation (setup, behavior, troubleshooting). |
| homeassistant/components/elke27/entity.py | Shared helpers for unique IDs, device info, and snapshot field extraction. |
| homeassistant/components/elke27/hub.py | Hub wrapper around Elke27Client lifecycle, reconnect, and command helpers. |
| homeassistant/components/elke27/icons.json | Declares entity icon translations for the integration. |
| homeassistant/components/elke27/identity.py | Integration-serial generation and client identity helpers. |
| homeassistant/components/elke27/light.py | Implements light entities (incl. brightness mapping). |
| homeassistant/components/elke27/lock.py | Implements lock entities and state parsing. |
| homeassistant/components/elke27/manifest.json | Declares integration metadata and dependency on elke27==0.3.2. |
| homeassistant/components/elke27/models.py | Defines Elke27RuntimeData stored on the config entry. |
| homeassistant/components/elke27/quality_scale.yaml | Tracks quality scale rule completion/exemptions/todos. |
| homeassistant/components/elke27/sensor.py | Implements diagnostic sensors for panel name and connection state. |
| homeassistant/components/elke27/services.yaml | Declares the alarm_arm_automatic service schema/selector UI. |
| homeassistant/components/elke27/strings.json | Adds config flow + entity translations. |
| homeassistant/components/elke27/switch.py | Implements output switches and hub delegation. |
Comments suppressed due to low confidence (1)
homeassistant/components/elke27/services.yaml:22
- Mark the
codeselector as a password field (e.g.,text: { type: password }) so alarm codes aren’t shown in clear text in the UI/service call history.
code:
name: Code
description: Alarm code to arm the area.
required: true
selector:
text:
|
Follow-up cleanup from the review pass:
I also checked the library for panel-name support. The discovery result exposes Focused validation after merging current
All focused checks passed. |
|
Updated the PR to consume the library panel-name snapshot change:
Validation after merging current
All focused checks passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32e3cabe2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Proposed change
Add the Elk E27 Alarm Engine integration.
This initial PR intentionally keeps the Home Assistant platform scope to
alarm_control_panel, following the new integration review guidance to start with one platform. It supports:Additional E27 domains are being kept for follow-up PRs.
Type of change
Additional information
elke27==0.3.7elke27==0.3.7provides the local E27 client, linking support, the public Home Assistant-facing client API, zone area metadata used by custom bypass, and runtime panel-name metadata used for device registry naming.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:
python3 -m script.hassfest.requirements_all.txt. Updated by runningpython3 -m script.gen_requirements_all.To help with the load of incoming pull requests: