-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Add Satel Integra config flow #138946
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
base: dev
Are you sure you want to change the base?
Add Satel Integra config flow #138946
Conversation
Can you give an example current YAML configuration? I need a little more information to be able to review this :) |
Sure, here is the YAML config for my existing installation:
I only have a basic installation with contact sensors and 1 partition (monitored location), the code should also work with the outputs (sirens, door latches etc) and multiple partitions but I haven't been able to test that on my actual system. |
How do you now map zones and partitions to HA? |
Each partition maps to a control panel, zones and outputs maps to individual binary sensors. Switchable outputs map to switches. I'm using the Options flow to allow users to set up each entry 1 by 1 |
Right, because currently we now also have config sub entries, which can create "sub" children, and I think that could work here |
I think I looked at config sub entries when I was working on this, but back then it was just added to HA. Are there are example integrations that can be set up like that already so I can take a look at how they work? |
I know ntfy uses it, and mqtt but mqtt probably isn't a good example for this |
Marking as draft again for now until I've been able to fully test at home and adjusted tests |
I'm not sure we want to change the title so it also reflects the entry type (partition, zone etc) and it's mapped number on the Satel system, that might help with knowing which entry is which later on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a full UI config flow for the Satel Integra integration, migrating from YAML-only configuration to Home Assistant’s config entries with subentries for partitions, zones, outputs, and switchable outputs. Key changes include:
- Moving hardcoded values into
const.py
, implementingConfigFlow
andConfigSubentryFlow
inconfig_flow.py
- Updating platform modules (
binary_sensor.py
,switch.py
,alarm_control_panel.py
) to useasync_setup_entry
and subentries - Adding YAML import support with deprecation issue warnings and tests for the config flow
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/components/satel_integra/test_config_flow.py | New tests covering user/import/option/subentry flows |
homeassistant/components/satel_integra/const.py | Centralized new constants and dataclass definitions |
homeassistant/components/satel_integra/config_flow.py | Added main config flow, import, options, subentries |
homeassistant/components/satel_integra/switch.py | Migrated switch platform to async_setup_entry |
homeassistant/components/satel_integra/binary_sensor.py | Migrated binary sensor platform to async_setup_entry |
homeassistant/components/satel_integra/alarm_control_panel.py | Migrated alarm panel platform to async_setup_entry |
homeassistant/components/satel_integra/init.py | Added YAML import task and entry setup/unload logic |
homeassistant/components/satel_integra/strings.json | New translation keys for config/subentries/issues |
homeassistant/components/satel_integra/manifest.json | Updated manifest with codeowners, config_flow, single config entry |
requirements_test_all.txt | Added satel-integra==0.3.7 for test environment |
Comments suppressed due to low confidence (5)
homeassistant/components/satel_integra/binary_sensor.py:66
- Typo in variable name 'ouput_type'; rename to 'output_type' for clarity and consistency.
ouput_type = subentry.data[CONF_ZONE_TYPE]
homeassistant/components/satel_integra/alarm_control_panel.py:49
- [nitpick] Variable 'zone_name' is misleading in this context since it represents a partition name; consider renaming to 'partition_name' for clarity.
zone_name = subentry.data[CONF_NAME]
homeassistant/components/satel_integra/config_flow.py:222
- [nitpick] Consider using a consistent error key such as 'cannot_connect' for abort reasons to align with other flow errors and translation keys.
return self.async_abort(reason="Failed to connect")
homeassistant/components/satel_integra/strings.json:150
- Add a translation entry for the 'deprecated_yaml' translation_key under 'issues' so the deprecation warning has a matching title and description.
"issues": {
homeassistant/components/satel_integra/switch.py:24
- [nitpick] No tests cover the switch platform setup; consider adding tests to verify entities are created correctly for switchable outputs.
async def async_setup_entry(
Breaking change
Adds Config flow to the Satel Integra integration, existing YAML config is imported.
Proposed change
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: