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

fix: availability checks not stopped on extension stop #20093

Merged
merged 5 commits into from
Dec 10, 2023

Conversation

protyposis
Copy link
Contributor

Clear the ping queue of the availability extension on stop, to prevent availability check (ping) cycles of unavailable devices continuing to run. This prevents the following issues:

  • In case of a "soft" restart (e.g., via UI), the restart of the extension created additional availability check cycles, leading to every availability check executing twice (and thrice after the next restart, etc.).
  • When a device is disabled, the UI asks for a restart. If that device is unavailable, and a check cycle therefore already running, the checks continue after the restart. To users, this looks like disabling of unavailable devices does not work.

Fixes #20021.

@protyposis
Copy link
Contributor Author

I guess you won't like the test since it's written in a completely different style, but I don't understand the architecture of the existing tests.

@Koenkk Koenkk merged commit 5aeec13 into Koenkk:master Dec 10, 2023
11 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Dec 10, 2023

Awesome, thanks for both reporting and fixing the issue! 😄

@protyposis protyposis deleted the feature/fix-availability-stop branch December 10, 2023 21:28
@dessfred
Copy link

dessfred commented Apr 7, 2024

Hi,

I have the same issue with the zigbee2mqtt add-on (version 1.36.1-1) for home assistant. How can I prevent ping of unavailable devices ? I don't find a file called 'availability.ts'.

Thank you.

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.

Disabled device unexpectedly pinged
3 participants