Events¶
-
generate_event_timestamp
(seconds=None)¶ Generate a timestamp string in ISO format.
Example: “2018-11-02T18:50:11Z”
- Parameters
seconds (
Optional
[float
]) – The system time in seconds (time.time()) to convert to the timestamp- Return type
str
- Returns
A string in ISO format of the time in UTC
-
class
OccurrenceEvent
(event_label, timestamp=None, event_id=None, object_label=None, object_id=None, camera_label=None, zone_label=None, data=None)¶ -
publish_event
(**kwargs)¶
-
-
class
ValueEvent
(event_label, value, timestamp=None, event_id=None, object_label=None, object_id=None, camera_label=None, zone_label=None, data=None)¶ ValueEvent is used to capture a quantity associated with an event. Examples include a queue length, a current capacity proportion, or a current rate of service.
-
publish_event
(**kwargs)¶
-
-
class
StartTimedEvent
(event_label, timestamp=None, event_id=None, object_label=None, object_id=None, camera_label=None, zone_label=None, data=None)¶ Marks the beginning of a timed event (an event that typically has an end).
-
publish_event
(**kwargs)¶
-
-
class
EndTimedEvent
(event_label, event_id, timestamp=None, object_label=None, object_id=None, camera_label=None, zone_label=None, data=None)¶ Marks the end of a timed event (an event that already had a start).
-
publish_event
(**kwargs)¶
-
-
class
CompleteTimedEvent
(start_timestamp, end_timestamp, event_label, event_id=None, start_object_label=None, start_object_id=None, start_camera_label=None, start_zone_label=None, data=None, end_camera_label=None, end_zone_label=None, end_object_id=None, end_object_label=None)¶ This is a convenience class that will automatically generate a unique event ID that can be used for both a start and end of an event, for when you want to create both events at the same time. When
self.publish_event()
is called, it will generate aStartTimedEvent
as well asEndTimedEvent()
.Camera, Zone, Object Label, and Object ID can all change between start and end events, so those arguments must be provided separately for the end event or they will default to None. If not provided, they default to None, but please note that at least one of these arguments must be provided for the start and end events at a minimum.
-
publish_event
()¶
-