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)
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