pushbullet#

class platypush.message.event.pushbullet.PushbulletDismissalEvent(*args, package_name: str | None = None, **kwargs)[source]#

Bases: PushbulletEvent

Triggered when a notification is dismissed.

__init__(*args, package_name: str | None = None, **kwargs)[source]#
Parameters:
  • notification_id – Notification ID.

  • title – Notification title.

  • body – Notification body.

  • url – Notification URL.

  • source_device – Source device ID.

  • source_user – Source user ID.

  • target_device – Target device ID.

  • icon – Notification icon.

  • created – Notification creation timestamp.

  • modified – Notification modification timestamp.

  • kwargs – Additional attributes.

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)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

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

class platypush.message.event.pushbullet.PushbulletEvent(*args, notification_id: str, title: str | None = None, body: str | dict | list | None = None, url: str | None = None, source_device: str | None = None, source_user: str | None = None, target_device: str | None = None, icon: str | None = None, created: float, modified: float, **kwargs)[source]#

Bases: Event

Base PushBullet event.

__init__(*args, notification_id: str, title: str | None = None, body: str | dict | list | None = None, url: str | None = None, source_device: str | None = None, source_user: str | None = None, target_device: str | None = None, icon: str | None = None, created: float, modified: float, **kwargs)[source]#
Parameters:
  • notification_id – Notification ID.

  • title – Notification title.

  • body – Notification body.

  • url – Notification URL.

  • source_device – Source device ID.

  • source_user – Source user ID.

  • target_device – Target device ID.

  • icon – Notification icon.

  • created – Notification creation timestamp.

  • modified – Notification modification timestamp.

  • kwargs – Additional attributes.

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)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

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

class platypush.message.event.pushbullet.PushbulletFileEvent(*args, file_name: str, file_type: str, file_url: str, image_width: int | None = None, image_height: int | None = None, image_url: str | None = None, **kwargs)[source]#

Bases: PushbulletMessageEvent

Triggered when a push with a file is received.

__init__(*args, file_name: str, file_type: str, file_url: str, image_width: int | None = None, image_height: int | None = None, image_url: str | None = None, **kwargs)[source]#
Parameters:
  • notification_id – Notification ID.

  • title – Notification title.

  • body – Notification body.

  • url – Notification URL.

  • source_device – Source device ID.

  • source_user – Source user ID.

  • target_device – Target device ID.

  • icon – Notification icon.

  • created – Notification creation timestamp.

  • modified – Notification modification timestamp.

  • kwargs – Additional attributes.

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)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

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

class platypush.message.event.pushbullet.PushbulletLinkEvent(*args, sender_id: str | None = None, sender_email: str | None = None, sender_name: str | None = None, receiver_id: str | None = None, receiver_email: str | None = None, receiver_name: str | None = None, **kwargs)[source]#

Bases: PushbulletMessageEvent

Triggered when a push with a link is received.

__init__(*args, sender_id: str | None = None, sender_email: str | None = None, sender_name: str | None = None, receiver_id: str | None = None, receiver_email: str | None = None, receiver_name: str | None = None, **kwargs)#
Parameters:
  • notification_id – Notification ID.

  • title – Notification title.

  • body – Notification body.

  • url – Notification URL.

  • source_device – Source device ID.

  • source_user – Source user ID.

  • target_device – Target device ID.

  • icon – Notification icon.

  • created – Notification creation timestamp.

  • modified – Notification modification timestamp.

  • kwargs – Additional attributes.

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)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

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

class platypush.message.event.pushbullet.PushbulletMessageEvent(*args, sender_id: str | None = None, sender_email: str | None = None, sender_name: str | None = None, receiver_id: str | None = None, receiver_email: str | None = None, receiver_name: str | None = None, **kwargs)[source]#

Bases: PushbulletEvent

Triggered when a new message is received.

__init__(*args, sender_id: str | None = None, sender_email: str | None = None, sender_name: str | None = None, receiver_id: str | None = None, receiver_email: str | None = None, receiver_name: str | None = None, **kwargs)[source]#
Parameters:
  • notification_id – Notification ID.

  • title – Notification title.

  • body – Notification body.

  • url – Notification URL.

  • source_device – Source device ID.

  • source_user – Source user ID.

  • target_device – Target device ID.

  • icon – Notification icon.

  • created – Notification creation timestamp.

  • modified – Notification modification timestamp.

  • kwargs – Additional attributes.

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)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

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

class platypush.message.event.pushbullet.PushbulletNotificationEvent(*args, title: str, body: str, dismissible: bool, application_name: str | None = None, package_name: str | None = None, actions: dict | None = None, **kwargs)[source]#

Bases: PushbulletEvent

Triggered when a notification is mirrored from another device.

__init__(*args, title: str, body: str, dismissible: bool, application_name: str | None = None, package_name: str | None = None, actions: dict | None = None, **kwargs)[source]#
Parameters:
  • title – Mirror notification title.

  • body – Mirror notification body.

  • dismissible – True if the notification can be dismissed.

  • application_name – Application name.

  • package_name – Package name.

  • actions

    Actions associated to the notification. Example:

    [
      {
        "label": "previous",
        "trigger_key": "com.termux.api_0_6107998_previous"
      },
      {
        "label": "pause",
        "trigger_key": "com.termux.api_0_6107998_pause"
      },
      {
        "label": "play",
        "trigger_key": "com.termux.api_0_6107998_play"
      },
      {
        "label": "next",
        "trigger_key": "com.termux.api_0_6107998_next"
      }
    ]
    

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)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

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