MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. thetobyde
    3. Topics
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 1
    • Followers 0
    • Topics 4
    • Posts 10
    • Groups 0

    Topics

    • thetobydeT

      Change MMM-CalExt2´s code a bit

      Watching Ignoring Scheduled Pinned Locked Moved Requests
      1
      2
      0 Votes
      1 Posts
      246 Views
      thetobydeT
      Hey guys. I build my own “Apple” Mirror with MagicMirror. I love the MMM-CalendarExt2 module but he uses Icons from iconify for each calendar. Here is his module: https://github.com/MMM-CalendarExt2/MMM-CalendarExt2 The icons look like this: [image: 1594026243114-bildschirmfoto-2020-07-06-um-11.02.41-resized.png] My Request: Can you implement a option to use lokal pictures instead of icons from iconify? Then I could use these cute Memojis :) [image: 1594026417434-bildschirmfoto-2020-07-06-um-11.06.38.png] Thx Melli & Toby 😎😍
    • thetobydeT

      Send existing Notifications from a script

      Watching Ignoring Scheduled Pinned Locked Moved Development
      15
      1
      0 Votes
      15 Posts
      3k Views
      thetobydeT
      It‘s working! Thx u!!
    • thetobydeT

      Start/Stop a pm2 script with Notifications of a module?

      Watching Ignoring Scheduled Pinned Locked Moved Troubleshooting
      2
      0 Votes
      2 Posts
      388 Views
      bheplerB
      @thetobyde - I think you can accomplish this with MMM-NotificationTrigger. That module lets you process notification messages and execute commands in response. It should be pretty easy to execute pm2 commands with it.
    • thetobydeT

      Meross

      Watching Ignoring Scheduled Pinned Locked Moved Requests
      4
      1
      1 Votes
      4 Posts
      858 Views
      lavolp3L
      @thetobyde for the DOM I have created the following elements: var label = document.createElement("label"); label.className = "tasmota-switch"; label.id = "switch-" + topic; var input = document.createElement("input"); input.type = "checkbox"; input.id = "checkbox-" + topic; input.checked = this.setSwitch(topic); var span = document.createElement("span"); span.className = "slider round"; span.id = "slider-" + topic; span.onclick = function() { self.toggleSwitch(topic); }; label.appendChild(input); label.appendChild(span); there is a label (as wrapper), a (hidden) checkbox, and a span that is the actual slider. The onclick function for the slider looks like this: toggleSwitch: function(topic) { this.sendSocketNotification("TOGGLE_SWITCH", topic); console.log("Switch toggled: " + topic); }, So, rather generic. There you need to tell the api that you have toggled the switch. Also, at every DOM update you need to check the api for the switch state (see the this.setSwitch-function above). It may have been switched from another endpoint or app. The result sets the “checked” state of the hidden input. setSwitch: function(topic) { this.log("Setting switch for " + topic); var powerState = this.tasmotaData.tele[topic].STATE.POWER; return (powerState === "ON") ? true : false; }, The rest is css: /*** SWITCHES ***/ .MMM-Tasmota .tasmota-switch { float: right; position: relative; display: inline-block; width: 90px; height: 34px; } /* Hide default HTML checkbox */ .MMM-Tasmota .tasmota-switch input { opacity: 0; width: 0px; height: 0px; } /* The slider */ .MMM-Tasmota .slider { position: absolute; cursor: pointer; top: 0; left: 30px; right: 0; bottom: 0; background-color: #f00; border: 3px solid white; -webkit-transition: .2s; transition: .2s; } .MMM-Tasmota .slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 3px; bottom: 1px; background-color: white; -webkit-transition: .2s; transition: .2s; } .MMM-Tasmota input:checked + .slider { background-color: #0f0; } .MMM-Tasmota input:checked + .slider:before { -webkit-transform: translateX(24px); -ms-transform: translateX(24px); transform: translateX(24px); } /* Rounded sliders */ .MMM-Tasmota .slider.round { border-radius: 34px; } .MMM-Tasmota .slider.round:before { border-radius: 50%; } I will publish all of that with my MMM-Tasmota module.
    • 1 / 1