• 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.

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.
  • B Offline
    binderth
    last edited by Feb 14, 2017, 1:48 PM

    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?

    S 1 Reply Last reply Feb 14, 2017, 3:03 PM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @binderth
      last edited by Feb 14, 2017, 3:03 PM

      @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
      • B Offline
        binderth
        last edited by Feb 15, 2017, 10:14 AM

        @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
        1 / 1
        • First post
          3/3
          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