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

Adding availability support to Commercial Electric Downlight #2922

Merged
merged 1 commit into from
Feb 8, 2020

Conversation

visnaut
Copy link
Contributor

@visnaut visnaut commented Feb 8, 2020

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.

@visnaut visnaut requested a review from Koenkk February 8, 2020 22:19
@Koenkk Koenkk changed the base branch from master to dev February 8, 2020 22:21
@Koenkk
Copy link
Owner

Koenkk commented Feb 8, 2020

Looks good, thanks!

@Koenkk Koenkk merged commit fb7c3a3 into Koenkk:dev Feb 8, 2020
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