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

Profile switching API

Scheduled Pinned Locked Moved Requests
13 Posts 5 Posters 8.1k 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.
  • M Offline
    MichMich Admin @00conman
    last edited by May 10, 2016, 12:14 PM

    @00conman it would be worth creating a module that has an API to switch “profiles”. It’s actually extremely doable. But I suggest you open a separate topic for this.

    1 Reply Last reply Reply Quote 0
    • 0 Offline
      00conman
      last edited by May 10, 2016, 2:01 PM

      Okay I’ll look into it.

      A 1 Reply Last reply Jun 26, 2016, 11:27 PM Reply Quote 0
      • A Offline
        ascension @00conman
        last edited by Jun 26, 2016, 11:27 PM

        @00conman
        Any progress on this? Facial recognition looks great, but I can’t get approval from my better half to put a camera in the bathroom mirror… Changing profiles using a physical button or a gesture would work perfectly.

        1 Reply Last reply Reply Quote 0
        • K Offline
          KirAsh4 Moderator
          last edited by Jun 27, 2016, 4:40 PM

          Just thinking out loud here, but you should be able to have a button that cycles through profiles. It might even be possible to use the current Button module (I forgot who wrote it), and use that. Set up a case switch to change profiles. Something sort of like this:

          // Warning, pseudo code, will not run as-is
          
          var buttonCount = 0;
          var availableProfiles = 2;
          
          if (detect_button_press()) {
            buttonCount++;
            if (buttonCount > availableProfiles) buttonCount = 0;
          
            switch (buttonCount) {
              case 0:
                // Display profile for user 0
                break;
              case 1:
                // Display profile for user 1
                break;
              case 2:
                // Display profile for user 2
                break;
              default:
                // Display default profile
            }
          }
          

          Now you can push the button all day long. The only issue here is that you are cycling through the profiles, and for a household that has several, that can become a bit tedious.

          Another possibility is to count button presses, so you would switch profiles based on how many times one pushed the button, but that too has its limitations. It works great for single-click, double-click, and possibly a long-press, but anything after that and it gets problematic again. Profile cycling is by far the easiest to implement.

          A Life? Cool! Where can I download one of those from?

          A 1 Reply Last reply Jun 27, 2016, 5:01 PM Reply Quote 0
          • A Offline
            ascension @KirAsh4
            last edited by Jun 27, 2016, 5:01 PM

            @KirAsh4
            Thanks for the quick response! I’ll take a look at the BUTTON module. Hopefully it’ll work the way I need it to. Fortunately, I only have 2 profiles I’ll need to cycle thru.

            1 Reply Last reply Reply Quote 0
            • 1
            • 2
            • 2 / 2
            • 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