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.

    ALERT: setting the display time individually

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    3 Posts 2 Posters 2.3k Views 3 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.
    • binderthB Offline
      binderth
      last edited by

      If there’s a alert, I’d like to be able to tell how long the alert should stay. At present I understand this is a global variable in the config.js (display_time). It would be nice, if this global variable could be overwritten, if I call the function.
      I tried:
      this.sendNotification("SHOW_ALERT", {type: "notification", display_time: "10000", title: "Title", message: "Message"});

      But still, the global display_time was used. Did I miss something?

      strawberry 3.141S 1 Reply Last reply Reply Quote 0
      • strawberry 3.141S Offline
        strawberry 3.141 Project Sponsor Module Developer @binderth
        last edited by

        @binderth a notification display time cannot be set in a notification itself, it’s up to the user to define the notification time for the alert module.

        {
          module: 'alert',
          config: {
            display_time: 10000
          }
        }
        

        if you want to set the duration you have to use an alert instead of notification:

        this.sendNotification("SHOW_ALERT", {timer: 10000, title: "Title", message: "Message"});

        Please create a github issue if you need help, so I can keep track

        1 Reply Last reply Reply Quote 1
        • binderthB Offline
          binderth
          last edited by

          @strawberry-3.141 said in ALERT: setting the display time individually:

          if you want to set the duration you have to use an alert instead of notification:
          this.sendNotification(“SHOW_ALERT”, {timer: 10000, title: “Title”, message: “Message”});

          ok, that did it. The Alerts are now shown as given in the “timer”-argument.
          Nevertheless my usecase would be to have also multiple notifications staying on top like “washing machine ready” and “dryer ready” or something which needs some action done.

          So it would be nice to have either notification also displayed “on event” and not globally or to have notifications smoothed out, if the item action is done. As I can see, the alert-module doesn’t allow fading the notifications on a action?

          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