button.flic
#
- class platypush.backend.button.flic.ButtonFlicBackend(server='localhost', long_press_timeout=0.3, btn_timeout=0.5, **kwargs)[source]#
Bases:
Backend
Backend that listen for events from the Flic (https://flic.io/) bluetooth smart buttons.
Triggers:
platypush.message.event.button.flic.FlicButtonEvent
when a button is pressed.The event will also contain the press sequence (e.g.
["ShortPressEvent", "LongPressEvent", "ShortPressEvent"]
)
Requires:
fliclib (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)