-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
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
Allow multiple Airzone entries with different System IDs #135397
Allow multiple Airzone entries with different System IDs #135397
Conversation
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Not sure why this fails on Github CI and is needed locally... Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
I wonder if we could update the integration to allow the user to specify multiple system IDs and have the integration make multiple API requests (one for each ID), instead of having separate configs? |
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.
(whoops, didn't submit my review)
if entry.version == 1: | ||
# Add missing CONF_ID | ||
system_id = entry.data.get(CONF_ID, DEFAULT_SYSTEM_ID) | ||
new_data = entry.data.copy() | ||
new_data[CONF_ID] = system_id | ||
hass.config_entries.async_update_entry( | ||
entry, | ||
data=new_data, | ||
version=2, | ||
) | ||
|
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.
Let's only do a minor version migration because the new config entry is still able to work with the old one. This way the user can restore to a previous version
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.
Done in 876dbf9
Thanks for the info, I hadn't realized we had that functionality!
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
You mean currently it's 1 system id == 1 config entry, and you want to move it to what? |
We could do that, but that would require more work on both the integration and the library, and honestly I don't think it's worth it since the issue I'm trying to fix here only affects a limited number of legacy devices. |
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Oh that is a good question, how many users are we talking? |
I'd say is very limited, because in order to have such cases I believe that two independent HVAC systems should be connected to the same Airzone WebServer, and that WebServer should be old enough to not allow |
@joostlek codecov/project failure isn't related to changes. |
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.
We should also add the system ID on the entry title on config_flow.py:90 (but only for ID != 0)
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Done in 55ec0f6 |
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.
Thanks!
Proposed change
System ID 0 isn't supported on some older Airzone devices and we need to allow creating multiple config entries with the same IP address and port, but different System IDs.
For reference: devices that support System ID 0 allow listing all systems on one API call. However, on devices where System ID 0 isn't supported, the API will only return the data of 1 system at a time and there's no way of knowing which System IDs are valid, so user input is used.
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: