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.

    Calendar: Cannot user ADD_CALENDAR socket notification to add a new calendar

    Scheduled Pinned Locked Moved Bug Hunt
    3 Posts 2 Posters 162 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.
    • S Offline
      SimoneMSR
      last edited by

      Hello,

      I would like to send a notification via a node_helper of another module, so that the intefarce included a new calendar. But when I execute this code, nothing happens.
      I tried to debug the calendar node_helper, and I see that the sole notification that arrives is FETCH_CALENDAR.

      this.io.of("calendar").emit("ADD_CALENDAR",payload);

      Could you suggest what’s going on?

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

        @SimoneMSR
        lots of issues
        the socket connection is only to your module, module y helper cannot interact with helper from module z

        add_calendar starts a data collector(fetcher) to inform the ui to use later

        but the controlling data is in the module, not in the helper. helper asynchronously sends back events for the url, calendar module uses url to find config for display, but it doesnt match any, so the data is tossed

        so you would have to extend calendar.js to accept an add_calender notification (not socket) to add another configuration, and trigger the add_calendar socket notification to its helper

        then YOUR helper would send YOUR module a socket notification to request IT to send the (not socket) notification to inform the calendar module

        note that sendNotification is a broadcast to all broswer side modules

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @sdetweil Thank you for the useful hints! I will soon work on them, and consider making a pull request to the community.

          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