flic#

class platypush.message.event.flic.FlicButtonEvent(btn_addr: str, sequence: Sequence[str], *_, **kwargs)[source]#

Bases: Event

Event triggered when a sequence of user short/long presses is detected on a Flic button.

__init__(btn_addr: str, sequence: Sequence[str], *_, **kwargs)[source]#
Parameters:
  • btn_addr – Physical address of the button that originated the event.

  • sequence – Detected sequence, as a list of Flic button event types (either ShortPressEvent or LongPressEvent).

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)[source]#
Parameters:

condition – Condition to be checked against, as a sequence of button presses (ShortPressEvent and LongPressEvent).

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object