-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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 support for whole apsystems ez1 series #123356
Add support for whole apsystems ez1 series #123356
Conversation
Hey there @SonnenladenGmbH, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
…put at setup to match the value by the inverter
cc0b7cd
to
a4a053f
Compare
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
We do have a coordinator right? You can move this to |
Okay, so I've now moved it into the coordinator |
max_power = (await self.api.get_device_info()).maxPower | ||
self.api.max_power = max_power |
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.
Why do we store this in self.api? Shouldn't we store this at the coordinator
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.
Because the api needs this as well, as it checks against that as well and why storing it in the api and the coordinator when the api needs it regardless of the coordinator?
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.
It sounds strange that the API requires it tbh, why do we receive the value to set it afterwards, why don't we call a function for the api to just set it themselves.
Also, can this raise? We should raise UpdateFailed in that case
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.
The reason is that the API shouldn't run any IO in the init function so that it can be initialized when the inverter is offline
Thanks! |
Proposed change
As there are more inverters of the ez1 series by apsystems with each having another max output, this PR queries the inverter on first setup and saves the max output which is then reused for the number entity. This PR depends on #123225 and would resolve #122979
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: