@bicolorbore586 no config option, just set cw to display:none in custom.css
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-CalendarExt3
-
RE: Head first developing MM module for extreme beginners
@Schmaniel ctrl-r to reload the screen
-
RE: MMM-ModulesGroupsRotation - simple alternative to MMM-pages
@plainbroke I’ve updated my fork of MMM-pages with the same function .
https://github.com/sdetweil/MMM-pagesonly they are called pages instead of slides
pageTimeout: [ {pageNumber:x, timeout:nnnnn},....]
-
RE: Help developing first module, displaying webscraped text.
@enderflop cool
key here is module name = foldername = filename = register name
and node_helper.js has to be in the same folder -
RE: MMM-EventHorizon
@swvalenti Wrong double quote characters. Type it from the keyboard, not cut/paste
-
RE: Config option with array of multiple values?
@UncleRoger said in Config option with array of multiple values?:
great conversation topic
validSenders: [ { "mom@example.com", "Mom", "#ff0000" }, { "dad@example.com", "Dad", "#00ff00" }, { "son@example.com", "Son", "#0000ff" }, ]
generally when you expand the number of items in an array to objects ({}) you start to get thinking about what happens if you decide to add another entry in the object…
so in javascript you can NAME the elements
validSenders: [ { name:"Mom", color:"#ff0000",url:"mom@example.com", }, { url"dad@example.com", name:"Dad", color:"#00ff00" }, { name:"Son", url:"son@example.com",color:"#0000ff" }, ]
that way the code is not sensitive to the order of the elements
validSenders.forEach(sender =>{ if (sender.name =="Dad") { do_something(sender.url) } })
you can also use the array.filter() function
let selected_sender = validSenders.filter(sender=>{ if(sender.url==mailObj.sender[0].address) return true else return false }) if(selected_sender.length>0){ // we found a matching sender }
the filter function passes each element array in turn to the function
if you want the element in the output array return true,
if not return falseon the combined statements you don’t need the backslash
if (that.config.validSenders.includes(mailObj.sender[0].address) && daysAgo >= 0 && daysAgo <= that.config.daysToDisplay) {
but this is THREE comparisons
- that.config.validSenders.includes(mailObj.sender[0].address)
- daysAgo >= 0
- daysAgo <= that.config.daysToDisplay
the last two CANNOT be true at the same time
maybe what you wanted was
if ( that.config.validSenders.includes(mailObj.sender[0].address) && (daysAgo >= 0 && daysAgo <= that.config.daysToDisplay) ) {
this is two outer compares (with one inner)
-
RE: MMM-euro2024
@0m4r the sample is missing the config:{} section
{ disabled: false, module: "MMM-euro2024", position: "bottom_center", defaults: { updateInterval: 60 * 1000, // one minute }, token: [YOUR_TOKEN] }
should be
{ disabled: false, module: "MMM-euro2024", position: "bottom_center", config:{ updateInterval: 60 * 1000, // one minute token: [YOUR_TOKEN] } }
your module passes this.config to the node_helper, but there is no config block, so only {} gets passed
this.sendSocketNotification(this.name + 'CONFIG', this.config);
-
RE: How difficult would it be to change the data an existing module receives?
@Tippon you can clone (fork) the module and add on what you want…
there are two parts of the module… the browser/ui part MMM-Fitbit2.js
and the helper, node_helper.jsthe MMM-Fitbit2.js cannot access hardware or files directly, so it has to call the helper
so, you could add on access to the spreadsheet (csv)
and send that data back as part of the response… the front end would never knowone of my modules uses a csv
in the node_helper
(you have to npm install csvtojson in the module folder to be able to use it)const cvt = require("csvtojson");
and then
cvt().fromFile(payload.tmpfile) // input xls // changed to tmpfile .subscribe((jsonObj, index) => { // handle each row })
-
RE: write access to git repository
YOU cannot push to the core repo… you can create a fork (under YOUR github userid), and then clone/push to THAT repo…
you can then propose changes to the master repo, by submitting a pull request, for your branch back to the master (and some branch, usually dev) … and the master owner can accept it , or not… and then merge it with the master branch whenever…
-
RE: MMM-voice ugly hdmi banner
@dazza120 right. That makes my script executable, so motion can execute it
Now u will see files appear in the MMM-SleepWake/motion folder
When the motion module detects motion, and when it ends.
My module uses those files