• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

read csv-data and put it in an array

Scheduled Pinned Locked Moved Utilities
313 Posts 3 Posters 421.6k Views 4 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.
  • S Offline
    sdetweil
    last edited by sdetweil May 2, 2020, 2:29 AM May 2, 2020, 2:03 AM

    no… it will do the thig every time a notifcation comes in, only want it when the module sends down a message (say it is alive)

    in node_help you are sending this “HAVEDATA”
    and in module you are looking for this if(notification === “HAVEDATE”){

    add a var self = this to start of socketNotificationReceived() and getDom()

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • S Offline
      sdetweil @Perlchamp
      last edited by May 2, 2020, 2:04 AM

      @Perlchamp said in read csv-data and put it in an array:

      if(birth_date.startOf(‘day’)

      also should be

      if(birth_date_moment.startOf('day')
      

      comparing moments, not strings! oops

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • P Offline
        Perlchamp
        last edited by May 2, 2020, 2:12 AM

        only the header i see, BUT now i see the terminal-message “HAVEDATA” but an error, too:
        picture

        S 1 Reply Last reply May 2, 2020, 2:17 AM Reply Quote 0
        • S Offline
          sdetweil @Perlchamp
          last edited by May 2, 2020, 2:17 AM

          @Perlchamp open the developers window, ctrl-shift-i on the mirror screen,
          select console tab,
          put perl in the filter field

          select the sources tab, navigate the left nav tree,. to modules/perlchamp/perlcmap.js

          find the socketnotificationreceived

          click the number in the left column, hit f5 (refresh) on keyboard

          code should stop at the line you clicked

          in the right pane, top there is a blue arrow (resume executing) and a top half of a globe, stop on next )instruction)

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • P Offline
            Perlchamp
            last edited by May 2, 2020, 2:23 AM

            before looking in dev: i saw the following:

            var birth_date_moment = moment(birth_date + now.getYear(),"DD.MMYYYY");
            

            change to DD.MM.YYYY (point between MM and YYYY) ?

            S 1 Reply Last reply May 2, 2020, 2:24 AM Reply Quote 0
            • S Offline
              sdetweil @Perlchamp
              last edited by sdetweil May 2, 2020, 2:25 AM May 2, 2020, 2:24 AM

              @Perlchamp no, cause we extract dd.mm from the info provided in file…

              oh, the substring should be 0,5, not 0,4

              var birth_date = birthday.birth.substring(0,5);
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • P Offline
                Perlchamp
                last edited by May 2, 2020, 2:37 AM

                error => now.getYear() is not a function

                S 1 Reply Last reply May 2, 2020, 2:38 AM Reply Quote 0
                • S Offline
                  sdetweil @Perlchamp
                  last edited by May 2, 2020, 2:38 AM

                  @Perlchamp yeh, sorry, rememeber just off the top of my head…
                  date uses that …
                  moment its just year()

                  var birth_date_moment = moment(birth_date + now.year(),“DD.MMYYYY”);

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Perlchamp
                    last edited by May 2, 2020, 2:48 AM

                    nothing changed. but now i see the HAVEDATA notification again. could it be, that the Dom-update (from notification) not really goes ?
                    i mean i saw in the dev, that the birthday-data are right. it was the first entry of this data-string (or jsonObj) …
                    only the header i can see …

                    S 1 Reply Last reply May 2, 2020, 2:51 AM Reply Quote 0
                    • S Offline
                      sdetweil @Perlchamp
                      last edited by May 2, 2020, 2:51 AM

                      @Perlchamp put a stop on the statement self.updateDom()

                      hit refresh, the code should stop there, then mouse over the this.active_birthdays a few lines up,
                      the debugger will surface the values

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 28
                      • 29
                      • 30
                      • 31
                      • 32
                      • 31 / 32
                      31 / 32
                      • First post
                        116/313
                        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