-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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 configflow for the SPC integration #135894
base: dev
Are you sure you want to change the base?
Conversation
edb856a
to
c4a99c9
Compare
4293174
to
bd2c036
Compare
data_schema=vol.Schema( | ||
{ | ||
vol.Required(CONF_API_URL): str, | ||
vol.Required(CONF_WS_URL): str, | ||
} | ||
), | ||
errors=errors, |
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.
So looking at the docs, the websocket url is just the api url with /ws/spc
how does that work?
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.
Its the protocol that differs, the API is http(s) the websocket is ws(s).
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.
Yes but I mean, can they be hosted at different places? Is the websocket URL always just the normal URL with a different protocol and path?
The question is boiling down to "why do we need 2 URLs?"
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.
No idea what the original design constraint was. I do agree that we could just take "hostname" or "ip" as input and go from there, we'd have to modify the import code a little to allow for this.
Maybe best to do that as a separate change?
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.
Can we do our due diligence to make sure there are not models or reasons why someone want to deviate? Because at this point i would also be fine with just trying to see if the URLs are different and raise a special error message for the users. (Or maybe just try using the normal URL and if that fails raise an error)
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.
Would it make sense to make it smart? Just attempt the same credentials and if they fail ask for the correct ones?
I'm just trying to push a bit back to see if we can make this user friendly without having the need for users to dive into the manual
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.
I don't think it makes sense as part of this change, it would turn this into a breaking change, in its current state with just configflow and the import process existing users of the interaction would just seamlessly move over.
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.
Oh but I think that if we're going to add a config flow, that means we get an influx of new users using the integration, so ideally I use this PR to find out what the best way is for the config flow to work.
The question if the host of the websocket URL can be different is also still unanswered.
Like, fine that we don't ask that now, but we can get that info from the existing configuration and ask from now 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.
I'm not sure it makes for a better user experience.
We would be looking for hostname, port, optional get/put password(not supporting individual passwords for that given the pyspcwebgw project doesn't support them), and optional ws password.
We'd need to update the import code to attempt to parse the existing URLs for this information.
The paths and hostnames should always be the same as far as I can tell, unless somebody has done reverse proxy stuff in front of it for some reason, I'd imagine this is an unusual use.
We'd need to do a documentation update at https://www.home-assistant.io/integrations/spc/ as the parameters would no longer be the same.
We'd need the manufacturer to update their documentation too - they do state that authentication and encryption isn't supported but it does work 😅.
It feels like something that should be scoped to a different PR.
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.
optional get/put password(not supporting individual passwords for that given the pyspcwebgw project doesn't support them), and optional ws password.
How do you mean this one?
I think it would make sense for our project to disallow reverse proxy stuff. We implement with the device, not with the reverse proxy. We also don't want to be responsible for the extra maintenance running it behind a reverse proxy comes, so I think the config flow addition (a moment which already is a breaking change) is a good moment to re review this instead of doing it one after the other and having multiple versions in a row.
Let me write down what I understand is the situation and then we can agree on a path forward
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
81160d6
to
26d1f6a
Compare
b062fd3
to
76ff27e
Compare
Ugh, github auto assigned a bunch of reviewers due to a bad rebase with origin/dev, I've cleaned up the commits but don't have the permissions to drop the additional reviewers it added. Sorry for the noise 🙈 |
c441a32
to
e258e0b
Compare
e258e0b
to
0d431fb
Compare
Proposed change
This change introduces https://developers.home-assistant.io/docs/config_entries_config_flow_handler/ support for the SPC integration.
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: