@sdetweil sorry i don’t uderstand what you mean ?
I think it works if afternoon is present but empty
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-compliment showing evening compliment anytime
-
RE: MMM-compliment showing evening compliment anytime
@sdetweil Yes ! Problem found…
Step by step, i’ve understandif (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); }
The JS need to have a “morning” and “afternoon” compliments define, else it choosing “evening” by default if define.
My problem was i don’t had afternoon compliment define…but i’ve evening one.
Thank you very much for your time and your time :) It was very helpful.
-
RE: MMM-compliment showing evening compliment anytime
@sdetweil Hi,
Ok great.
I be able to see the value of hour variable.
It seem to be correct because it’s 17.Condition of morning not verified.
Condition of afternoon verified, so the line is executed (because 17 is between 12 and 18)compliments = this.config.compliments.afternoon.slice(0);
I don’t know why evening compliments are displayed…it’s very strange
-
RE: MMM-compliment showing evening compliment anytime
@sdetweil
Ok, thank you for your test.
So maybe a problem on my system time. However it seem to be correct. Another solution to verify that ? (Other than timedatectl ?)Is it possible to have verbose log to see the how the module decide to display compliment ?
-
RE: MMM-compliment showing evening compliment anytime
@sdetweil Thank you for your time :)
The problem doesn’t concern “anytime” values, but “evening”.
Anytime is anytime and it’s normal that compliment in this section can be displayed at anytime…:)Compliments define in “evening” are displayed all the day, not only on the evening. This is my problem. The MM showing evening compliment at anytime…
With my exemple, the MM display “Bonne soirée” or “Bonne nuit…”, also the morning, or afternon. Like this compliment was positionned in “anytime”
-
RE: MMM-compliment showing evening compliment anytime
@sdetweil
Here’s :){ "anytime": [ "Comment ça va ?", "Bonjour" ], "morning": [ "Un petit café ?", "Bien dormi ?", "Bonne journée !" ], "evening": [ "Bonne soirée !", "Bonne nuit...", "Agréable soirée" ], "day_sunny": [ "Le temps est ensoleillé aujourd'hui !", "C'est une belle journée" ], "day_cloudy": [ "C'est nuageux aujourd'hui..." ], "snow": [ "Bataille de boules de neige !!!" ], "rain": [ "N'oublie pas ton parapluie...", "Et si on restait au sec aujourd'hui ?" ] }
With " as indicated on the readme when using remote file.
But, i had the problem before using remote file, i’ve do this hoping this would resolve the problem, but it’s dont.Is it possible to “remove/reinstall” default module like compliments ?
-
RE: MMM-compliment showing evening compliment anytime
@sdetweil Ok thank you.
Trying with no specific configuration -> MM say “goodnight” or “good evening” but it’s only 4 PM
Trying with specifig configuration with no gap, same result :({ module: 'compliments', position: 'lower_third', config: { morningStartTime:3, morningEndTime:12, afternoonStartTime:12, afternoonEndTime:18, remoteFile: 'compliments.json' } },
-
RE: MMM-compliment showing evening compliment anytime
@sdetweil Ok, but i’ve added this configuration because i had the problem with default configuration.
I can delete it. Normally we don’t need this, right ? -
RE: MMM-compliment showing evening compliment anytime
@sdetweil said in MMM-compliment showing evening compliment anytime:
@selyjohns ok, one thing
MMM-compliment means some external additional module
module: ‘compliments’,
means the one shipped with MagicMirror…Oh OK, not evident.
I speak about the module ‘compliments’, integrated with MM in default folder :) -
RE: MMM-compliment showing evening compliment anytime
@sdetweil No, nothing…
{ module: 'compliments', position: 'lower_third', config: { morningStartTime:3, morningEndTime:10, afternoonStartTime:13, afternoonEndTime:18, remoteFile: 'compliments.json' } },
compliments.json is stored in MagicMirror/modules/default/compliments/ :) This part is good.