@sdetweil You were faster sam!
Read the statement by Michael Teeuw here.
Posts
-
RE: Help with updateDom()
@lavolp3 NOw I have the error, I think!
the
thisin the interval might refer to another this and not to the original module-this
So you need to do the following in start:start : function(){ var self = this; setInterval(function() {self.updateDom()}, 1000); }, -
RE: Help with updateDom()
@lavolp3 are you sure the image url is correct?
I would always for debugging purposes print that out once.console.log('url(' + this.config.loc[i] + ')'); console.log(this.count)Or check the dev console for errors not finding the pictures.
-
RE: Help with updateDom()
@UjwalReddy267
I would do this:
the count variable out of defaults and intothis. Then count it up in getdom.Module.register("MMM-Test",{ default: {loc: ["modules/MMM-Test/test1.jpg","modules/MMM-Test/test.jpg"]}, count: 0, start : function(){ setInterval(function() {this.updateDom()}, 1000); }, getDom : function (){ var wrapper = document.createElement('div') wrapper.id = 'FULL' var img = document.createElement('div') var i = this.count img.style.backgroundImage = 'url(' + this.config.loc[i] + ')' img.id = 'photo' var blr = document.createElement('div') blr.id = 'backgrnd' blr.style.backgroundImage = 'url(' + this.config.loc[i] + ')' wrapper.appendChild(blr) wrapper.appendChild(img) this.count = (this.count + 1) % 2 return wrapper }, getStyles : function (){ return ['MMM-Test.css'] } }) `` -
RE: Help with updateDom()
@CreepinJesus said in Help with updateDom():
I think (may be wrong) the config is read only inside the module,
that’s not true. The config values can be manipulated.
-
RE: weatherforecast showing only two days.
@erik-voznak have you tried
maxNumberOfDays: 7needs to be a number instead of a string.
fadePoint as well.
You need to be careful with the format of the values.
Look into the readme what format is expected.
https://docs.magicmirror.builders/modules/weatherforecast.html#configuration-options -
RE: BG Animation with CSS
Great idea. I would set the animation duration much longer but it looks great.
If I were you I would include all of this onto the MMM-fast-css module.
I would also add possibilities for arrangement of the modules.
Another user has posted an example of the modules in grid display. Could also be implemented as an option in the module couldn’t it? -
RE: Clock Clock 24
@cmgp looks good. Have fun programming it :-D
Seriously, the mirror has proven not to be very strong with animations. You could think about leaving the animations out.
I think that would miss the fun part. -
RE: Why Is MMM-Yeelight is not working
@Osker that is not an error.
It just says that it received a socket notification and does not do anything with it.
There must be something else that is not working.EDIT: Looking at the source code, it seems that the module sends EVERY notification received to its node_helper for processing it. That’s not a good behaviour from my point of view. It’s 2 years old, so possible it does not work anymore as expected.
You should open an issue on github. -
RE: MMM-NowPlayingOnSpotify, installed but nothing appears on MM
@RIKKO14 Tell me Rikko what module are you using for the map and what module for the beautiful weather forecast?
-
RE: Send existing Notifications from a script
@sdetweil sorry read thorugh it too fast
-
RE: Send existing Notifications from a script
@thetobyde I think you should avoid the node_helper and directly send a broadcast notification via
self.sendNotification()to to the MMM-pages module.button.addEventListener("click", function() { self.sendNotification("PAGE_CHANGED", i); }); -
RE: Send existing Notifications from a script
@thetobyde if you haven’t figured it out yet, have a look at my module https://github.com/lavolp3/MMM-NavigationBar which kind of does what you want. This one is using MMM-pages as well.
ALl that I needed for this to work out is this:
getDom: function() { var container = document.createElement("div"); container.className = "naviContainer"; self = this; for (var i = 0; i < this.config.sections.length; i++) { var buttonDiv = document.createElement("div"); buttonDiv.className = "naviButton fas fa-"+this.config.sectionIcons[this.config.sections[i]]; buttonDiv.style.fontSize = this.config.iconSize + "px"; button.addEventListener("click", function() { self.sendNotification("PAGE_CHANGED", i); }); //this.log(buttonDiv.className); container.appendChild(buttonDiv); } return container; }, -
RE: MMM-DWD-WarnWeather
- update the module
if it still doesn’t work, - as @Stoffbeuteluwe said, check the name of your area or use the warnCellID (starts with an 8 ) if possible.
- update the module
-
RE: MMM-Strava only shows achievements, nothing else?
@nakulbende the worst thing is that they have removed some functions in the api even for paid subscriptions. Club activities endpoint unusable. Current segment leaderboard entries not available to anyone. It’s a mess.
-
RE: MMM-Strava only shows achievements, nothing else?
@karsten13 Great contribution!
I might need to “borrow” some of that for my module :-) -
RE: MMM-Strava only shows achievements, nothing else?
@karsten13 @nakulbende The Strava API is becoming more and more useless on several endpoints.
You have to think about it. With this endpoint, you can only draw YOUR OWN data (the data of the authenticated athlete), not of any other athlete, but it does NOT include private data.
Does not make any sense at all.I’m still working on a bigger Strava module (which takes some more time after I needed to amend to further destructive API changes).
The data could also be gathered from the “getActivities” endpoint, which includes private activities. Maybe the stats need to be created from that in future.
This API call is however not included in MMM-Strava. -
RE: Impossible d'installer le Git de MMM-Bring
@RIKKO14 it seems you have installed the magicmirror with sudo privilege? Is that possible?
That is not advisable. You would need sudo for anything you do afterwards.