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 source virtual integration to config flow context #24553

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

zweckj
Copy link
Member

@zweckj zweckj commented Mar 7, 2025

Breaking change

Proposed change

Add the original virtual integration to the config flow context, to be used for branding (later) or different config flow actions.

Core PR: home-assistant/core#132471
Arch discussion: home-assistant/architecture#1160

Type of change

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

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

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

Copy link
Contributor

@silamon silamon left a comment

Choose a reason for hiding this comment

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

Run prettier to get CI green.

@bramkragten
Copy link
Member

We will now have the context for some cases but not all, for example, a discovered device, or adding a config entry on the integration page, will not have this context. Not sure how we are planning to use this, but feels a bit half now?

@zweckj
Copy link
Member Author

zweckj commented Mar 10, 2025

We will now have the context for some cases but not all, for example, a discovered device, or adding a config entry on the integration page, will not have this context. Not sure how we are planning to use this, but feels a bit half now?

Then I just missed some places, never touched anything in the frontend before. I think I know where the integration page thing is. Discovery should not be relevant atm, as virtual integrations can’t discover (as their virtual part) I believe.

@bramkragten
Copy link
Member

We will now have the context for some cases but not all, for example, a discovered device, or adding a config entry on the integration page, will not have this context. Not sure how we are planning to use this, but feels a bit half now?

Then I just missed some places, never touched anything in the frontend before. I think I know where the integration page thing is. Discovery should not be relevant atm, as virtual integrations can’t discover (as their virtual part) I believe.

Not sure if they are missed, the places I mention do not have a notion of virtual integrations, as they are now only used for findability, but it sounds like these PRs trying to change that. So I wonder what it will be used for, like branding is nice, but it is weird if some things will be branded correctly and others are not.

@zweckj
Copy link
Member Author

zweckj commented Mar 10, 2025

Not sure if they are missed, the places I mention do not have a notion of virtual integrations, as they are now only used for findability, but it sounds like these PRs trying to change that. So I wonder what it will be used for, like branding is nice, but it is weird if some things will be branded correctly and others are not.

I meant this other place https://github.com/home-assistant/frontend/blob/dev/src/panels/config/integrations/ha-config-integrations-dashboard.ts#L885-L921, here we do know about virtual integration apparently (but I'm not really sure what it's used for tbh). Branding would be a second step anyway. First step is to allow the config flow to react on that info, when we are configuring a virtual integration.

@bramkragten
Copy link
Member

bramkragten commented Mar 10, 2025

The code you linked is what is used when you add an integration with a my.home-assistant.io link, so yes, that needs to be handled.

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.

3 participants