Trig all sub chargers on installation trigger#226
Trig all sub chargers on installation trigger#226sveinse merged 4 commits intocustom-components:masterfrom
Conversation
steinmn
left a comment
There was a problem hiding this comment.
One issue here is that the child chargers will be polled with the installation trigger delays (ie without the last trigger after 15 seconds)
Wouldn't it be better to have trigger_poll (no leading underscore) call the trigger_poll-functions of the respective coordinators after setting up the background task? Then we also avoid potentially having both the installation-coordinator and the charger-coordinator running a polling task for the same charger if the user has changed something on both the charger and the installation within the 15second timeperiod.
|
Yes, I saw the same thing with the 15 second delay missing. You're right. It's better to trigger them the other way. I'll fix it. Thanks. |
* When installation is triggered, also trigger the chargers connected to it * Remove the argument from trigger_poll
custom_components/zaptec/__init__.py
Outdated
| # Trigger the poll for the children coordinators | ||
| for coord in children_coordinators: | ||
| await coord.trigger_poll() |
There was a problem hiding this comment.
This is inside the for loop, so charger(s) will now trigger 4 times: 4, 9, 14 and 22 seconds after the triggering event. This is because the first round of polling is interrupted by a new trigger from the installation poller
There was a problem hiding this comment.
Yes, I didn't catch this. I'll fix this as soon as I'm done with the PR I'm working on.
|
@steinmn This is ready as well. Thanks for reviewing. |
This PR ensures that chargers also gets triggered when a command is issued to installation. The typical use case is if the available current in the charger has changed, this might affect the current in the individual chargers.
Fixes #220