Skip to content

Commit 04b93b2

Browse files
committed
change a few pieces
1 parent 0ac235a commit 04b93b2

File tree

5 files changed

+14
-35
lines changed

5 files changed

+14
-35
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
*~
2-
/vendors
32
/cmd/secspy/secspy
43
/secspy
5-
/vendor

.travis.yml

-10
This file was deleted.

Makefile

-16
This file was deleted.

events.go

+1
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ func (e *Events) UnmarshalEvent(text string) Event { // nolint:funlen,cyclop
322322
msg += ", "
323323
}
324324

325+
newEvent.Reasons = append(newEvent.Reasons, flag)
325326
msg += txt
326327
}
327328
}

events_types.go

+13-7
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ type Events struct {
5959
// Event represents a SecuritySpy event from the Stream Reply.
6060
// This is the INPUT data for an event that is sent to a bound callback method or channel.
6161
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.
6970
}
7071

7172
// EventType is a set of constant strings validated by the EventNames map.
@@ -85,6 +86,7 @@ const (
8586
EventSecSpyError EventType = "ERROR"
8687
EventConfigChange EventType = "CONFIGCHANGE"
8788
EventMotionDetected EventType = "MOTION" // Legacy (v4)
89+
EventMotionEnd EventType = "MOTION_END"
8890
EventOnline EventType = "ONLINE"
8991
EventOffline EventType = "OFFLINE"
9092
EventClassify EventType = "CLASSIFY"
@@ -161,3 +163,7 @@ var Reasons = map[TriggerEvent]string{ //nolint:gochecknoglobals
161163
TriggerByHumanDetection: "Human Detected",
162164
TriggerByVehicleDetection: "Vehicle Detected",
163165
}
166+
167+
func (reason TriggerEvent) String() string {
168+
return Reasons[reason]
169+
}

0 commit comments

Comments
 (0)