Read the statement by Michael Teeuw here.
Compliments module | Can you specify a specific date in an external .json file?
-
I recently started setting up my first MagicMirror and moved my compliments to an external compliments.json file. In doing so, I found that it works only if I remove any of the date specific messages that I had specified. For example:
... ], "evening": [ "Ready for bed?" ], "....-12-24": ["It's a holiday!"] }
When a file with these date specific compliments is included, the file doesn’t load and the module defaults to the standard list of compliments.
In looking around online I found some instances where people seemed to indicate that it was possible, but the vast majority of examples don’t mention doing this.
Is what I am attempting possible?
-
@morangen yes, are you forming file correctly
{ "anytime": [....], "morning":[...], "....mmdd": [....] }
note that the quote marks must be vertical, and not tilted/curved , as the latter is a word processing symbol which javascript does not understand
the file contents must be in JSON format, which requires quote marks around all text elements
this is different than what you would do in config.js
from the doc
-
@sdetweil Thanks for the clarification there. I run my MagicMirror on a Synology NAS, and it looks like the editor I am using might be adding the wrong quote characters or something that causes the json validation to fail for some reason.
I was able to get this working by copying the initial date line that worked. For some reason typing them out was causing the file to not validate and therefore not get loaded.
Much appreciated.
-
-
@morangen cool, glad you got it working