Read the statement by Michael Teeuw here.
start() vs receiving waiting for MODULE_DOM_CREATED notification?
-
i was having trouble with a module reliably starting (might be my underpowered RasPi), and i thought maybe it was trying to load before the system was ready. so i moved some startup code from the start() function to a custom function that gets called after the module receives its MODULE_DOM_CREATED notification.
is this a bad idea, just useless, or might it actually do some good?
-
@dathbe you could try waiting til ALL_MODULES_STARTED or
DOM_OBJECTS_CREATED, per the doc
https://docs.magicmirror.builders/development/notifications.html#system-notificationsMODULE_DOM_CREATED is in response to getDom() returning the dom object so it might be quite late
-
@sdetweil I’d rather have late and working consistently than early and missed because of lag. I suspect most people boot their mirror at most once a day, so waiting an extra 30 seconds for the module to show content doesn’t seem like that big of a deal.
But I’ll try DOM_OBJECTS_CREATED.