TeraTech / MMM-WiFiPassword

Magic Mirror Module that displays your WiFi network, password with QRCode
MIT License
99 stars 19 forks source link

Notification name seems to have changed from DOM_OBJECTS_CREATED to MODULE_DOM_CREATED #17

Closed daniel-s-w closed 1 year ago

daniel-s-w commented 2 years ago

https://github.com/TeraTech/MMM-WiFiPassword/blob/343b91b322dd96788fba3900bbb22f0b790800db/MMM-WiFiPassword.js#L113

After updating the MMM from v2.10.1 to v2.17.1 the QR Code did not show up any further. After some tests, I found, that there is no notification "DOM_OBJECTS_CREATED" send to the referenced function - thus the QR code creation does not take place. Instead the notification is named "MODULE_DOM_CREATED". Adjusting the switch statement seems to fix this issue, but should be checked further. My fix is as follows:

...
switch(notification) {
  case "MODULE_DOM_CREATED":
...
Sousanator commented 2 years ago

Thanks for this, it solved my issue.

I did notice on the web browser the QR code did show up before this change, just couldn't get it to work on the display.

CFenner commented 2 years ago

Maybe creating a PR can solve this for all of us.

chadvidovcich commented 1 year ago

Checking the docs for Magic Mirror, the notificationReceived method should send the "MODULE_DOM_CREATED" notification when the module's dom has been fully loaded.

By using "DOM_OBJECTS_CREATED", we are only waiting for the objects to be created, but not yet fully loaded.

https://docs.magicmirror.builders/development/core-module-file.html#notificationreceived-notification-payload-sender