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

Reduce number of followup commands for area on/off events. #42

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

mag1024
Copy link
Owner

@mag1024 mag1024 commented Sep 17, 2024

Hopefully this will also reduce the probability of triggering dropped commands.

  1. Only fetch the history if it is empty.
    This is not 100% correct, because it is possible that though the initial load didn't happen because the panel was armed, some history were delivered via the subscription. However, it seems we already don't handle that, because the inserted history event will cause last_event_id to be current.

  2. Drop load_faults on area on/off.
    Thinking about this more, it is not actually necessary. Even if the history could not be fetched at startup, the faults should've been. If there were any history events since, those would already have been followed up.

  3. Delay the history fetch.
    Sleeps are gross, but it does seem that the panels are somehow more prone to losing commands immediately after disarm.

Hopefully this will also reduce the probability of triggering dropped
commands.

1) Only fetch the history if it is empty.
This is not 100% correct, because it is possible that though the initial
load didn't happen because the panel was armed, some history were
delivered via the subscription. However, it seems we already don't
handle that, because the inserted history event will cause last_event_id
to be current.

2) Drop load_faults on area on/off.
Thinking about this more, it is not actually necessary.
Even if the history could not be fetched at startup, the faults
should've been. If there were any history events since, those would
already have been followed up.

3) Delay the history fetch.
Sleeps are gross, but it does seem that the panels are somehow more
prone to losing commands immediately after disarm.
Copy link
Collaborator

@sanjay900 sanjay900 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me

@mag1024 mag1024 merged commit e92cd73 into master Sep 17, 2024
@mag1024 mag1024 deleted the fix/disarm_followups branch September 17, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants