-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
availability_whitelist #2387
availability_whitelist #2387
Conversation
This feature looks good to me, if you can add the missing tests than this can be merged, see https://github.com/Koenkk/zigbee2mqtt/blob/master/test/deviceAvailability.test.js#L207 for inspiration. |
If my Google-Fu is not terribly bad, the goal is to get |
Yes: |
I'll be damned! Tests passed! 💪 |
Also updated documentation Koenkk/zigbee2mqtt.io#165 |
I reshuffled the logic a bit, tests are still passing, is this OK for you? |
Wow... I really overthought this. ’return this.whitelist.includes(device.ieeeAddr);’ does return also false... So much cleaner now. How about those forcePinged devices, should those be checked before? |
Forced pinged devices is a list of end devices which can be pinged, however the whitelist does basically the same. It would be strange if a device is NOT in the whitelist but is still pinged. |
Makes sense. I’m happy with your changes since they make same as mine but just much more elegant way. |
Thanks! |
As requested at #2204
Tested with my environment
With
in configuration.yaml
I get this behaviour as wanted:
Hope I did not break anything else while at it.
Closes #2204