Read the statement by Michael Teeuw here.
Compliments module external file
-
if the file upload fails, the defaults are used…
open the developers window, ctrl-shift-i on the pi keyboard,
select the console tab, and scroll up, or enter some unique part of the module name in the filter field
to slim down messages to the modulemake sure the name is exact…
-
Oh perfect, thanks ! He needs the extension of the file
-
@hanao00 said in Compliments module external file:
He needs the extension of the file
yes, exact name
and for this module, the extension MUST be .json
-
@sdetweil Thank you
-
May I ask a follow on question? Is the source of the core compliments editable? Meaning, not the source code, but the source of the sayings that appear on the screen. I like the existing compliments but would like to customize what actually appears on the screen.
-
@cheapdad you should not edit THAT content
you can copy into your own file and edit from there, OR add it to the config.js
general rule… unless there is bug u are fixing short term, or a feature u are adding,
do NOT edit the module content (any file) in the defaults folder…and overall should never edit the installed module files at all…
config.js is designed to allow to override the settings defined by the modules
-
Understood, but the entry in my config.js for just the line that says “compliments.” There’s no indication in config.js where that pulls from. The add-on compliments modules have extra lines with a website address, etc., but I don’t see where the core module is getting what it puts on the screen.
-
in the core compliments.js file is the default setting
defaults: { compliments: { anytime: ["Hey there sexy!"], morning: ["Good morning, handsome!", "Enjoy your day!", "How was your sleep?"], afternoon: ["Hello, beauty!", "You look sexy!", "Looking good today!"], evening: ["Wow, you look hot!", "You look nice!", "Hi, sexy!"], "....-01-01": ["Happy new year!"] },
-
@sdetweil Thanks, that’s very helpful. I imagine I can simply edit that compliments.js file, since I can always download another one if I want to return to default.
Alternatively, I could copy/paste a second set of those lines, edit them, and “no comment” the defaults. (I think that’s the correct term.) However, that would add/leave in unnecessary lines of code, which strikes me as inefficient.
-
@cheapdad i don’t understand
in config.js
{ module:"compliments", position:".....", config: { compliments: { anytime: ["Hey there sexy!"], morning: ["Good morning, handsome!", "Enjoy your day!", "How was your sleep?"], afternoon: ["Hello, beauty!", "You look sexy!", "Looking good today!"], evening: ["Wow, you look hot!", "You look nice!", "Hi, sexy!"], "....-01-01": ["Happy new year!"] }, } }
edit away
never touch the source file…
this is the MM model,
what ever is in a modules defaults:{} section
can be overridden in config.js
usually that is all in the module README.md file as part of the instructions