Read the statement by Michael Teeuw here.
MMM Compliments
-
Hello everybody,
my MagicMirror is running very well and now I wanted to adjust the compliments a bit.
I made compliments for different times of the day, but the times I have chosen are ignored. Where do I have to copy this that it works “right”? :-){ module: "compliments", position: "lower_third", config: { updateInterval: "90000", morningStartTime: "3", morningEndTime: "12", afternoonStartTime: "16", afternoonEndTime: "20", eveningStartTime: "20", eveningEndTime: "23", compliments: { anytime: [ "Hey there sexy!", "Beauty!", "20.09.2019 what a Day!", "On a scale from 1 to 10, you're an 15!", "You`re like sunshine on a rainy day", "You`re wonderful", "You, me -home!", "8000 Watt -immer großes Blatt!", "I could just hang here all day!", "Let me high five you \nIN THE FACE!", "Lorem ipsum" ], morning: [ "Good morning, handsome!", "Enjoy your day!", "How was your sleep?", "Start your day!", "Gude!", "Start your day with a \nsmile!", "Jetzt erstmal Kaffee!" ], afternoon: [ "Hello, beauty!", "You look sexy!", "Looking good today!", "Hard day at work, wasn`t it?", "Gude!", "Sit down for a sec", "Durchatmen Krone richten \n weiter machen!", "For every kiss you give me \nI will give you three!" ], evening: [ "Wow, you look hot!", "You look nice!", "Hi, sexy!", "Let the evening \nbe-GIN", "Gude!", "Time for some \nBunga Bunga!", "Night Owl!" ] } } },
-
You don’t use the
"
marks around the numbers.so :
updateInterval: 90000, morningStartTime: 3, morningEndTime: 12, afternoonStartTime: 16, afternoonEndTime: 20, eveningStartTime: 20, eveningEndTime: 23,
-
@broberg OMG I will try ASAP that it was so easy I would not have thought! Thank you for the quick help!
-
hmm i just changed it from " " to , after the numbers, after a reboot i got a message for afternoon, so it showed no changes.
Do I have to change anything? -
@Kollen the code says
if current hour is between morning start/end, then use from morning list
else if current hour is between afternoon start/end then use afternoon list,
else use evening list if presentthe default times are
morningStartTime: 3, morningEndTime: 12, afternoonStartTime: 12, afternoonEndTime: 17
if (hour >= this.config.morningStartTime && hour < this.config.morningEndTime && this.config.compliments.hasOwnProperty("morning")) { compliments = this.config.compliments.morning.slice(0); } else if (hour >= this.config.afternoonStartTime && hour < this.config.afternoonEndTime && this.config.compliments.hasOwnProperty("afternoon")) { compliments = this.config.compliments.afternoon.slice(0); } else if(this.config.compliments.hasOwnProperty("evening")) { compliments = this.config.compliments.evening.slice(0); }
it then adds the current weathertype
it then adds the anytime list
then takes a random selection of all thosewhat time was it when u tested?
-
Looking at the code you only have morning start and end, and afternoon start and end.
so eveningStartTime & eveningEndTime does nothing.
So basically the time between
afternoonEndTime
andmorningStartTime
is considered evening.
Anything put inanytime
-compliments will be shown regardless of time.So if you really want to test it then remove the compliments from anytime and just run 2 morning, 2 afternoon and 2 evening compliments (alter the times you see it change)
{ module: "compliments", position: "lower_third", config: { updateInterval: 90000, morningStartTime: 14, morningEndTime: 15, afternoonStartTime: 15, afternoonEndTime: 16, compliments: { anytime: [ "anytime", ], morning: [ "morning1", "morning2", ], afternoon: [ "afternoon1", "afternoon2", ], evening: [ "evening1", "evening2", ] } } },