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

Do not ping disabled devices at start #23061

Closed
wants to merge 1 commit into from

Conversation

ghoz
Copy link
Contributor

@ghoz ghoz commented Jun 14, 2024

When devices have not been seen / not available at start, we ping them.
We should skip disabled devices, because they are well... disabled.

When devices have not been seen / not available at start, we ping them.
We should skip disabled devices, because they are well... disabled.
@ghoz
Copy link
Contributor Author

ghoz commented Jun 14, 2024

the test

it('Should not ping disabled devices', async () => {
is not working corectly it seems.

when trying to add some logging to it,
The extensions starts 2 times, I guess on test start and when reset.
1st time all active devices with old timestamps are pinged, including the disabled ones
after resetExtension the timestamp has been updated so we don't ping it at start and the test passes

I tried changing the order of the reset extension and playing with the MQTT mock Clear, but I'm still not able to make the test fail even tough I do see the ping been called...
grumble.

@Nerivec
Copy link
Collaborator

Nerivec commented Jun 15, 2024

I think the source of the issue may be around here rather:

function isAvailabilityEnabledForEntity(entity: Device | Group, settings: Settings): boolean {

disabled looks to not be given a high enough priority in the various ifs, in some cases?

@Koenkk
Copy link
Owner

Koenkk commented Jun 15, 2024

It should indeed be fixed in isAvailabilityEnabledForEntity

Can you try to move if (entity.isDevice() && entity.options.disabled) return false; to the top and see if that fixes your issue?

@ghoz
Copy link
Contributor Author

ghoz commented Jun 15, 2024

superseded by #23065

@ghoz ghoz closed this Jun 15, 2024
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.

3 participants