Skip to content
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

Add Config flow to ADS integration #130353

Draft
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

mrpasztoradam
Copy link
Contributor

@mrpasztoradam mrpasztoradam commented Nov 11, 2024

Proposed change

Add Config Flow to ADS integration, so from now on, the ADS hub can be set up from the frontend. YAML setup remains available.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@mrpasztoradam mrpasztoradam marked this pull request as ready for review November 12, 2024 14:32
Copy link
Contributor

@HarvsG HarvsG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review done.

I note from the documentation that ADS also supports other platforms such as light, switch, binary sensor, cover etc and that they usually require configuration in YAML, how will these be configured for users using ConfigFlow, is there an auto-discovery mechanism available?

homeassistant/components/ads/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/ads/config_flow.py Show resolved Hide resolved
homeassistant/components/ads/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/ads/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/ads/config_flow.py Show resolved Hide resolved
tests/components/ads/__init__.py Show resolved Hide resolved
homeassistant/components/ads/__init__.py Outdated Show resolved Hide resolved
@mrpasztoradam
Copy link
Contributor Author

Initial review done.

I note from the documentation that ADS also supports other platforms such as light, switch, binary sensor, cover etc and that they usually require configuration in YAML, how will these be configured for users using ConfigFlow, is there an auto-discovery mechanism available?

In the scope of this PR, only the Hub can be set up by the ConfigFlow. The possibility remains to add it through the configuration.yaml, alongside the other platforms.

I am working on the possibility to set up the lights, switches etc... through the config flow, in separate PRs.

Alternatively, there may be a way to auto discover devices, but i have to do a bit of testing. :)

@HarvsG
Copy link
Contributor

HarvsG commented Nov 14, 2024

I am working on the possibility to set up the lights, switches etc... through the config flow, in separate PRs.

Ok, so in the meantime the user would be expected to set the hub up in ConfigFlow and then any extra devices in YAML? That seems a little odd unless there is a use case by which a user would want to only have a hub configured?

Or is the plan to have all of these PRs merged in the same release cycle?

@mrpasztoradam
Copy link
Contributor Author

mrpasztoradam commented Nov 14, 2024

Ok, so in the meantime the user would be expected to set the hub up in ConfigFlow and then any extra devices in YAML? That seems a little odd unless there is a use case by which a user would want to only have a hub configured?

Yes, it is a bit odd, but this PR is already pretty large, so i don't want to include all the other work in here. Also the possibility to set up the hub by YAML remains.

Or is the plan to have all of these PRs merged in the same release cycle?

Yes, the plan is to mark each PR such as "Needs to be merged together with #...PR "

@HarvsG
Copy link
Contributor

HarvsG commented Nov 14, 2024

Yes, the plan is to mark each PR such as "Needs to be merged together with #...PR

In that case, please mark this as draft whilst work is ongoing. And think ahead about merge conflicts and so on.

@mrpasztoradam mrpasztoradam marked this pull request as draft November 18, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants