@@ -59,13 +59,14 @@ type Events struct {
59
59
// Event represents a SecuritySpy event from the Stream Reply.
60
60
// This is the INPUT data for an event that is sent to a bound callback method or channel.
61
61
type Event struct {
62
- Time time.Time // Local time event was recorded.
63
- When time.Time // Event time according to server.
64
- ID int // Negative numbers are custom events.
65
- Camera * Camera // Each event gets a camera interface.
66
- Type EventType // Event identifier
67
- Msg string // Event Text
68
- Errors []error // Errors populated by parse errors.
62
+ Time time.Time // Local time event was recorded.
63
+ When time.Time // Event time according to server.
64
+ ID int // Negative numbers are custom events.
65
+ Camera * Camera // Each event gets a camera interface.
66
+ Type EventType // Event identifier
67
+ Msg string // Event Text
68
+ Errors []error // Errors populated by parse errors.
69
+ Reasons []TriggerEvent // Bitmask of trigger reasons.
69
70
}
70
71
71
72
// EventType is a set of constant strings validated by the EventNames map.
@@ -85,6 +86,7 @@ const (
85
86
EventSecSpyError EventType = "ERROR"
86
87
EventConfigChange EventType = "CONFIGCHANGE"
87
88
EventMotionDetected EventType = "MOTION" // Legacy (v4)
89
+ EventMotionEnd EventType = "MOTION_END"
88
90
EventOnline EventType = "ONLINE"
89
91
EventOffline EventType = "OFFLINE"
90
92
EventClassify EventType = "CLASSIFY"
@@ -161,3 +163,7 @@ var Reasons = map[TriggerEvent]string{ //nolint:gochecknoglobals
161
163
TriggerByHumanDetection : "Human Detected" ,
162
164
TriggerByVehicleDetection : "Vehicle Detected" ,
163
165
}
166
+
167
+ func (reason TriggerEvent ) String () string {
168
+ return Reasons [reason ]
169
+ }
0 commit comments