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

Refactor AlarmCoordinator so that it's not a polling coordinator #76

Open
palazzem opened this issue Oct 11, 2023 · 1 comment
Open

Comments

@palazzem
Copy link
Owner

Is your feature request related to a problem? Please describe.

AlarmCoordinator introduced in #74 is a polling integration built on top of a long-polling API. The combination of both means that you poll every 5 seconds, then you are stuck for at most 15 seconds, to then poll again. This introduces unneeded latency as you don't need to wait for the next poll, but you can:

  1. Poll
  2. If not changed, poll again
  3. If changed, update
  4. Poll again

Describe the solution you'd like

The long-polling triggers a signal to notify the integration that an update is needed, so we can simply poll and when there is a change, retrieve the data and publish it through async_set_updated_data().

We can still keep AlarmDevice in place, with no need of changing how entities get updated. That could be a further step.

Describe alternatives you've considered

Keep everything as it is, even though it introduces 5 seconds latency if you wait for the next poll to happen.

Additional context

The polling mechanism must be configurable, as it's needed by some customers that don't want to keep the connection always opened with the cloud.

@xtimmy86x
Copy link
Contributor

xtimmy86x commented Oct 24, 2023

Check this strange thing:
I decided to update the firmware of the central unit, and, naturally, during the update, it disconnected from eConnect and then reconnected.
Since then, the integration is no longer available.
I tried polling directly with econnect-python from my environment and everything responds.
So, it's something related to Home Assistant logic.

I restarted the integration and everything started working correctly again

This is the log that repeats since it disconnected/reconnected

Screenshot 2023-10-24 154854

@palazzem palazzem added this to the 2.2.0 milestone Oct 24, 2023
@palazzem palazzem self-assigned this Oct 24, 2023
@palazzem palazzem modified the milestones: 2.2.0, 2.3.0 Dec 1, 2023
@palazzem palazzem removed this from the 2.3.0 milestone Feb 1, 2024
@palazzem palazzem removed their assignment Feb 1, 2024
@palazzem palazzem added this to the 2.4.0 milestone Feb 20, 2024
@palazzem palazzem self-assigned this Feb 21, 2024
@palazzem palazzem removed their assignment Mar 1, 2024
@palazzem palazzem removed this from the 2.4.0 milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants