new meta events
authorBernhard Tittelbach <xro@realraum.at>
Tue, 8 Oct 2013 14:30:14 +0000 (14:30 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Tue, 8 Oct 2013 14:30:14 +0000 (14:30 +0000)
go/r3events/marshal_events.go
go/r3events/metaevents.go

index 212f9b1..6f087c8 100644 (file)
@@ -101,6 +101,16 @@ func UnmarshalByteByte2Event(data [][]byte) (event interface{}, category string,
             err = json.Unmarshal(data[1], newevent)
             category = "movement"
             event = *newevent
+        case "TempSensorSpike":
+            newevent := new(TempSensorSpike)
+            err = json.Unmarshal(data[1], newevent)
+            category = "sensors"
+            event = *newevent
+        case "DustSensorSpike":
+            newevent := new(DustSensorSpike)
+            err = json.Unmarshal(data[1], newevent)
+            category = "sensors"
+            event = *newevent
         case "NetDHCPACK":
             newevent := new(NetDHCPACK)
             err = json.Unmarshal(data[1], newevent)
index c22a79d..f57e954 100644 (file)
@@ -9,5 +9,18 @@ type PresenceUpdate struct {
 
 type SomethingReallyIsMoving struct {
     Movement bool
+    Confidence uint8
+    Ts int64
+}
+
+type TempSensorSpike struct {
+    Sensorindex int
+    Value float64    
+    Ts int64
+}
+
+type DustSensorSpike struct {
+    Sensorindex int
+    Value int64
     Ts int64
 }
\ No newline at end of file