Read the statement by Michael Teeuw here.
remoteFile in compliments module
-
@bhepler said in remoteFile in compliments module:
I’m going to work on this a bit and hopefully the next release of the MirrorMirror software will be a bit more friendly. As an aside, I’ve noticed that the weather integration technique continually adds to the arrays. So the memory usage will grow and grow at whatever frequency you set the compliment refresh. This isn’t terrible, as straight text doesn’t take a whole lot of memory. But it may have unintended effects if you leave your mirror running for months at a time or if you are expecting a true randomization of the compliments you enter.
Hi, when I worked in this feature I remember was a flashing about this.
If you can help how improved this is welcome :)
-
Hi! I’m using a separate compliments file (for each user). I’ve noticed that when I use non english characters they are not shown correctly.
The complement in the picture should say: “Tänk positivt”.
Now it says:
If I don’t use a compliments file and put the compliments directly in the config, it works fine.
What to do? :)
Best regards Snille
-
@Snille did you save the compliments file as utf8 encoded?
-
@strawberry-3.141 I had not, now I did and it works! :)
Thank you! -
@roramirez Is there already a solution for the memory ‘bug’?
-
-
@roramirez I meant this comment:
“As an aside, I’ve noticed that the weather integration technique continually adds to the arrays. So the memory usage will grow and grow at whatever frequency you set the compliment refresh. This isn’t terrible, as straight text doesn’t take a whole lot of memory. But it may have unintended effects”
I don’t know whether to call this a bug, but you get my point ;) I’m not an experienced coder whatsoever, so I doubt I might be of help, but I am always willing to test / assist.
-
@jm I can’t see that this is still happening on the current code base. Every time it tries to update an array will be generated with all possible values, after that the garbage collector will do his job and delete the array after usage.
-
Here is how I got the remote file compliments to work:
- The config.js settings must name the remote file with no path:
{ module: 'compliments', position: 'bottom_bar', config: { remoteFile: 'compliments.json' } },
IMO it would be great if it were possible to put a full path the the remote file so it can be stored in the config directory.
- Create a compliments.json file and be sure to put
double quotes
around the array names like so:
{ "morning" : [ "You're good enough, you're smart enough and doggone it, people like you!" ], "afternoon" : [ "Yes those jeans make you look fat." ], "evening" : [ "Please put on some pants." ] }
-
Put the remote file (compliments.json) into the
~/MagicMirror/modules/default/compliments
directory. -
Restart MM. It will show the default compliment (usually “Hi Sexy”) for the first interval and then will start showing compliments from the external file.
Hope this helps
-
Guys where can be mistake:
config.js looks like:
{
module: “compliments”,
position: “lower_third”,
config: {
remoteFile: “compliments.json”
}
},
Remote file placed in ~/MagicMirror/modules/default/compliments
but it still does not work.
I made all following above written steps and nothing - still oryginal compliments are one the mirror.
I have no idea what is wrong.