platypush.backend.button.flic

class platypush.backend.button.flic.ButtonFlicBackend(server='localhost', long_press_timeout=0.3, btn_timeout=0.5, **kwargs)[source]

Backend that listen for events from the Flic (https://flic.io/) bluetooth smart buttons.

Triggers:

Requires:

  • fliclib (https://github.com/50ButtonsEach/fliclib-linux-hci). For the backend to work properly you need to have the flicd daemon from the fliclib running, and you have to first pair the buttons with your device using any of the scanners provided by the library.
__init__(server='localhost', long_press_timeout=0.3, btn_timeout=0.5, **kwargs)[source]
Parameters:
  • server (str) – flicd server host (default: localhost)
  • long_press_timeout (float) – How long you should press a button for a press action to be considered “long press” (default: 0.3 secohds)
  • btn_timeout (float) – How long since the last button release before considering the user interaction completed (default: 0.5 seconds)
run()[source]

Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.