Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Scan for new buttons and connect to HUB over SDK

    Flic Hub SDK
    flic hub scan button
    2
    3
    1010
    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.
    • sasha.milic
      sasha.milic last edited by sasha.milic

      I have hub with enabled SDK. Successfully login to https://hubsdk.flic.io/

      Also I have fresh new button that is not connected to anything (aether HUB or the phone).

      When I use COMMAND PROMPT (scan) to scan for single button, it's not showing the anything. It's just scanning until I issue command (stopScan). No buttons are found.

      1. What is procedure (and/or code example) for adding fresh new buttons to HUB..?
      2. Do I need first to add button to hub over phone Flic app, or that is possible over the javascript?
      3. In the MDM solution (https://dm.flic.io/) in field "Buttons - Button pairings JSON" what structure I should add. (some example is will be very much helpful)?

      Screenshot 2021-08-11 at 12.14.38.png

      Thank you very much in advance..!!!

      1 Reply Last reply Reply Quote 0
      • sasha.milic
        sasha.milic @Emil last edited by

        @Emil Thanks for explanation.
        Works now...
        I also managed to figure out what JSON structure is going for MDM under point 3.
        Basically I export pairings from dev hub and if we use those buttons on managed hub I just paste "buttons pairings" json in to the field.

        1 Reply Last reply Reply Quote 0
        • Emil
          Emil FlicTeam last edited by

          1. Just use the scan wizard as you do (call startScanWizard() on the buttons module). What I think you forget is that you must hold down the button for at least 1.5 or 6 seconds depending on if it's brand new or has been paired before. Otherwise it won't be discovered.
          2. No you don't need to pair with phone first.
          3. See https://hubsdk.flic.io/static/documentation/ under importFlic2Pairings. The "pairings" structure is what you should write. Oskar should have given you the info you need for this.
          sasha.milic 1 Reply Last reply Reply Quote 0
          • First post
            Last post