Read the statement by Michael Teeuw here.
Change Compliments
-
Or, use a remote file (as per the compliments readme) so as not to encumber the config.js file with a lengthy entry.
-
OR just use another module…
-
@thestigh I’ll try this. It looks different then what is supplied by MM. I think i have the syntax wrong and haven’t learned yet how to do the coding. Thanks.
-
@dgregory19 As @Mykle1 stated, there is another way.
Personally, I prefer to have all custom configurations in one single file
config.js
and all custom css in thecustom.css
, by this I can add/remove/replicate configurations/modules installed from device to device. Makes it easy to backup :)Another tip;
Above each module inconfig.js
, you can adddisabled: false / true,
to temporarily make a module not load on MM. Like this:{ disabled: false, module: 'MMM-Remote-Control' },
If you need anymore help, please let me know.
-
Thanks everyone! Figured it out. Onto breaking something else…
-
My apologies for resurrecting a dead thread, but it seemed like keeping all similar questions to one thread might be useful to others.
I was happy with the default compliments, but wanted to customize them to the user. I copied the compliments entries from compliments.js and inserted them into my config.js. I don’t get any errors when I run config:check, but the compliments no longer appear on the screen. Here’s my code:
{ module: "compliments", position: "lower_third", config: { compliments: { anytime: ["Hey there Emma!"], morning: ["Good morning, Emma!", "Enjoy your day!", "How was your sleep?"], afternoon: ["Hello, Emma!", "You look beautiful!", "Looking good today!"], evening: ["Wow, you look great!", "You look nice!", "Hi, Emma!"], "....-01-01": ["Happy new year!"] } },
-
@cheapdad u should have gotten an error in the window where u start MM…
I do copying your stuff}, ^ SyntaxError: Unexpected token '}' at wrapSafe (internal/modules/cjs/loader.js:1060:16) at Module._compile (internal/modules/cjs/loader.js:1108:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) at Module.load (internal/modules/cjs/loader.js:992:32) at Module._load (internal/modules/cjs/loader.js:885:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12738) at loadApplicationPackage (/home/sam/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js:110:16) at Object.<anonymous> (/home/sam/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js:222:9) at Module._compile (internal/modules/cjs/loader.js:1152:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
and npm config:check says
(base) sam@sams:~/MagicMirror$ npm run config:check > magicmirror@2.15.0 config:check /home/sam/MagicMirror > node js/check_config.js [24.04.2021 15:25.20.258] [INFO] Checking file... /home/sam/MagicMirror/config/config.js [24.04.2021 15:25.20.270] [ERROR] Your configuration file contains syntax errors :( [24.04.2021 15:25.20.270] [ERROR] Line 56 column 7: Parsing error: Unexpected token {
shorter answer, u are missing a }
-
@sdetweil That’s the strange thing, I’m not getting any errors when I run npm run config:check.
Unfortunately, I had to rebuild my config.js since I installed a module, edited config.js and ended up with a blank screen that no commenting the config.js entries didn’t fix.
Here’s the new (old) compliments entries:
module: "compliments", position: "lower_third", config: { compliments: { anytime: ["Hey there Emma!"], morning: ["Good morning, Emma!", "Enjoy your day!", "How was your sleep?"], afternoon: ["Hello, Emma!", "You look beautiful!", "Looking good today!"], evening: ["Wow, you look great!", "You look nice!", "Hi, Emma!"], "....-01-01": ["Happy new year!"] } },
And my npm run config:check:
pi@emmasmagicmirror:~/MagicMirror $ npm run config:check > magicmirror@2.15.0 config:check /home/pi/MagicMirror > node js/check_config.js [24.04.2021 16:58.15.197] [INFO] Checking file... /home/pi/MagicMirror/config/config.js [24.04.2021 16:58.15.352] [INFO] Your configuration file doesn't contain syntax errors :) pi@emmasmagicmirror:~/MagicMirror $
-
the thing is
{ module:"name", position:"...", config: { compliments: { } //< ---- this brace is missing } } get bitvise ssh client, then u can have a file manager view from windows and use notepad++ to edit and see the brace, paren and bracket matching
-
Forgive me for pursuing this, but I see an opportunity to really learn here. When I look at my code, I have closed all of my braces:
}, module: "compliments", position: "lower_third", config: { \\ open compliments: { \\open anytime: ["Hey there Emma!"], morning: ["Good morning, Emma!", "Enjoy your day!", "How was your sleep?"], afternoon: ["Hello, Emma!", "You look beautiful!", "Looking good today!"], evening: ["Wow, you look great!", "You look nice!", "Hi, Emma!"], "....-01-01": ["Happy new year!"] } \\close }, \\close module: "weather",
If I add another closing brace, won’t I have an error because there is no opening brace?
On the suggestion for bitvise ssh, I’m working directly off the pi itself. I would love to run the entire MM configuration in a vm until it is right and then simply copy that over to the pi, but that’s a bit beyond my knowledge level.