-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Add config flow to compensation helper #147928
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?
Conversation
Hey there @Petro31, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Heads up, I overhauled a bit of the integration in a separate PR that just got merged. A bit of bad timing! Sorry |
If you want, I can assist with this cleanup. |
No worries, this PR doesn't work anyway as my intention was only to have a working solution for the config flow to start with (with the extension of the `ObjectSelector). I will clean it up once #147929 gets merged in. |
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.
A few quick comments on the strings
This comment was marked as duplicate.
This comment was marked as duplicate.
e1618f3
to
2f43b44
Compare
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 adds a UI-driven config flow to the Compensation integration, enabling multiple data point inputs via an ObjectSelector
, wiring up entry setup/unload, and updating the manifest.
- Extend
ObjectSelector
withserialize()
for voluptuous serialization - Implement
config_flow.py
withSchemaConfigFlowHandler
and options validation - Add
async_setup_entry
,async_unload_entry
, and update listener in__init__.py
andsensor.py
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
helpers/selector.py | Allow ObjectSelector to serialize nested Selector instances |
components/compensation/strings.json | Add translation strings for config and options steps |
components/compensation/config_flow.py | Define setup and options schemas and flow handler for UI configuration |
components/compensation/init.py | Refactor setup to support config entries (async_setup_entry ) |
components/compensation/sensor.py | Add async_setup_entry to create sensor from config entry |
components/compensation/manifest.json | Declare config_flow support and set integration_type |
components/compensation/const.py | Define PLATFORMS list for entry setup |
Comments suppressed due to low confidence (2)
homeassistant/components/compensation/config_flow.py:1
- Update the module docstring to reflect the Compensation integration rather than "statistics".
"""Config flow for statistics."""
homeassistant/helpers/selector.py:1137
- The name
Required
is not imported in this file, which will cause aNameError
. Addfrom typing import Required
(orfrom typing_extensions import Required
) at the top.
selector: Required[Selector | dict]
@Petro31 it should now be in a state where I appreciate if you give it a test run that it works as expected. |
Proposed change
Adds config flow to
compensation
now when we have a way to provide multiple sets of inputs (extension ofObjectSelector
)New attempt from feedback in #121857
Needs #147929
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: