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 disabling HA discovery after device was discovered #5200

Merged
merged 2 commits into from
Dec 8, 2020

Conversation

nurikk
Copy link
Collaborator

@nurikk nurikk commented Dec 5, 2020

This fixes rare case when device was published in HA discovery, and then through configuration.yaml was set homeassistant: null (to disable this device discovery)

Here is workflow:

  1. I have discovered device
  2. I want to kick this device from hass discovery
  3. I set device specific config homeassistant: null
  4. Restart z2m
  5. Device was removed from discovery
0|zigbee2mqtt  | Zigbee2MQTT:error 2020-12-05 13:09:22: Failed to call 'HomeAssistant' 'onMQTTMessage' (TypeError: Cannot read property 'light' of null
0|zigbee2mqtt  |     at /home/nur/.nvm/versions/node/v12.18.3/lib/node_modules/zigbee2mqtt/lib/extension/homeassistant.js:616:77
0|zigbee2mqtt  |     at Array.forEach (<anonymous>)

@nurikk nurikk force-pushed the fix_discovery branch 4 times, most recently from 6ab8bcf to 768568d Compare December 7, 2020 10:15
@Koenkk Koenkk merged commit 743c701 into Koenkk:dev Dec 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