Read the statement by Michael Teeuw here.
remoteFile in compliments module
-
@jcorraliza yeah… the only reason why i would use the remote file is the weather stuff, and obviously this feature has a bug, or we are to weak in coding ^^
-
Okay, I have the weather integration working. I’ll spare you the process I went through to figure it out, but the short version is that I am a worse developer than I originally suspected. The remoteFile capability works by replacing the three compliment arrays (morning, afternoon & evening). The weather integration works (sensibly, IMHO) by adding weather-specific compliments to the existing arrays.
So in order to get them both working, you need to specify both the original arrays and the weather-specific arrays. You can delete any weather-specific arrays you wish, but you must have the morning, afternoon & evening arrays. Copy & paste this
compliments.json
file to your mirror and then modify accordingly.{ "morning": ["Morning compliment"], "afternoon": ["Afternoon compliment"], "evening": ["Evening compliment"], "day_sunny" : [ "Day Sunny Compliment 1", "Day Sunny Compliment 2" ], "day_cloudy" : [ "Day Cloudy Compliment 1", "Day Cloudy Compliment 2" ], "cloudy" : ["Cloud 1"], "cloudy_windy" : ["Cloud windy"], "showers" : ["Showers"], "rain" : ["Rain"], "thunderstorm" : ["Thunderstorm"], "snow" : ["Snow"], "fog" : ["Fog"], "night_clear" : ["Night clear"], "night_cloudy" : ["Night Cloudy"], "night_showers" : ["Night showers"], "night_rain" : ["Night Rain"], "night_thunderstorm" : ["Night thunderstorm"], "night_snow" : ["Night Snow"], "night_alt_cloudy_wind": ["Night Cloudy Winds"] }
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.
-
-
@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.