Adding availability support to Commercial Electric Downlight #2922
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I own several of these Commercial Electric Downlights, which work well with zigbee2mqtt.
However, despite being mains-powered, they do not report as such (they return 'Unknown'), and are EndDevices, so they are not periodically pinged for device availability checks. (Totally devastated to find out after all these years that these things aren't routers either 😭)
I tried adding this model to
lib/extension/deviceAvailability.js
in the same way availability support for the Sengled E11-G13 bulbs was added, tested with all my bulbs, and lo and behold, the availability checks work as desired. The correct availability status now appears in these bulbs' topics, and I'm observing what I'd expect to in the logs.Accounting for the addition of multiple devices here, I've made it so that the herdsman device list is only iterated over once, as opposed to duplicating line 10, which would iterate through that list for each model.
I based my branch off of 1.10, but 2 suites and 4 tests are failing locally before I even add in my changes. Not sure if that's an issue on my end or not. I also noticed that the test that was submitted with the Sengled PR is no longer there, so I've omitted one for this model, but happy to correct that if you feel I should.