MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM Compliments

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    6 Posts 3 Posters 1.5k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • brobergB Offline
      broberg Project Sponsor
      last edited by broberg

      @Kollen

      You don’t use the " marks around the numbers.

      so :

      updateInterval: 90000,
      morningStartTime: 3,
      morningEndTime: 12,
      afternoonStartTime: 16,
      afternoonEndTime: 20,
      eveningStartTime: 20,
      eveningEndTime: 23,
      
      1 Reply Last reply Reply Quote 0
      • K Offline
        Kollen
        last edited by

        @broberg OMG I will try ASAP that it was so easy I would not have thought! Thank you for the quick help!

        1 Reply Last reply Reply Quote 0
        • K Offline
          Kollen
          last edited by

          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?

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @Kollen
            last edited by

            @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 present

            the 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 those

            what time was it when u tested?

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • brobergB Offline
              broberg Project Sponsor
              last edited by

              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 and morningStartTime is considered evening.
              Anything put in anytime-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",
                                                 ]
                                           }
                                     }
                              },
              
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy