gps
#
- class platypush.message.event.gps.GPSDeviceEvent(path: str, *args, activated: datetime | None = None, native: bool = False, baudrate: int | None = None, parity: str | None = None, stopbits: int | None = None, cycle: float | None = None, driver: str | None = None, subtype: str | None = None, **kwargs)[source]#
Bases:
GPSEvent
Event triggered when a new GPS device is connected or reconfigured.
- __init__(path: str, *args, activated: datetime | None = None, native: bool = False, baudrate: int | None = None, parity: str | None = None, stopbits: int | None = None, cycle: float | None = None, driver: str | None = None, subtype: str | None = None, **kwargs)[source]#
- Parameters:
path – Device path.
activated – Device activation timestamp.
native – Device native status.
baudrate – Device baudrate.
parity – Device parity.
stopbits – Device stopbits.
cycle – Device cycle.
driver – Device driver.
subtype – Device subtype.
- 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.gps.GPSDisabledEvent(target=None, origin=None, id=None, timestamp=None, logging_level=20, disable_web_clients_notification=False, **kwargs)[source]#
Bases:
GPSEvent
Event triggered when the GPS polling is disabled.
- __init__(target=None, origin=None, id=None, timestamp=None, logging_level=20, disable_web_clients_notification=False, **kwargs)#
- Parameters:
target (str) – Target node
origin (str) – Origin node (default: current node)
id (str) – Event ID (default: auto-generated)
timestamp (float) – Event timestamp (default: current time)
logging_level – Logging level for this event (default:
logging.INFO
)disable_web_clients_notification – Don’t send a notification of this event to the websocket clients
kwargs – Additional arguments for the event
- 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.gps.GPSEnabledEvent(target=None, origin=None, id=None, timestamp=None, logging_level=20, disable_web_clients_notification=False, **kwargs)[source]#
Bases:
GPSEvent
Event triggered when the GPS polling is enabled.
- __init__(target=None, origin=None, id=None, timestamp=None, logging_level=20, disable_web_clients_notification=False, **kwargs)#
- Parameters:
target (str) – Target node
origin (str) – Origin node (default: current node)
id (str) – Event ID (default: auto-generated)
timestamp (float) – Event timestamp (default: current time)
logging_level – Logging level for this event (default:
logging.INFO
)disable_web_clients_notification – Don’t send a notification of this event to the websocket clients
kwargs – Additional arguments for the event
- 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.gps.GPSEvent(target=None, origin=None, id=None, timestamp=None, logging_level=20, disable_web_clients_notification=False, **kwargs)[source]#
Bases:
Event
,ABC
Generic class for GPS events.
- __init__(target=None, origin=None, id=None, timestamp=None, logging_level=20, disable_web_clients_notification=False, **kwargs)#
- Parameters:
target (str) – Target node
origin (str) – Origin node (default: current node)
id (str) – Event ID (default: auto-generated)
timestamp (float) – Event timestamp (default: current time)
logging_level – Logging level for this event (default:
logging.INFO
)disable_web_clients_notification – Don’t send a notification of this event to the websocket clients
kwargs – Additional arguments for the event
- 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.gps.GPSLocationUpdateEvent(*args, device=None, latitude=None, longitude=None, altitude=None, mode=None, **kwargs)[source]#
Bases:
GPSEvent
Event triggered upon GPS status update.
- __init__(*args, device=None, latitude=None, longitude=None, altitude=None, mode=None, **kwargs)[source]#
- Parameters:
target (str) – Target node
origin (str) – Origin node (default: current node)
id (str) – Event ID (default: auto-generated)
timestamp (float) – Event timestamp (default: current time)
logging_level – Logging level for this event (default:
logging.INFO
)disable_web_clients_notification – Don’t send a notification of this event to the websocket clients
kwargs – Additional arguments for the event
- 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