From df03216ae02275765ae9a6757aed77bf0ac3da20 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sat, 16 Nov 2013 20:56:52 +0000 Subject: [PATCH] GasLeakSensor --- go/r3events/basicevents.go | 4 ++++ go/r3events/marshal_events.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/go/r3events/basicevents.go b/go/r3events/basicevents.go index 60a8b8d..35f6385 100644 --- a/go/r3events/basicevents.go +++ b/go/r3events/basicevents.go @@ -81,6 +81,10 @@ type NetGWStatUpdate struct { Ts int64 } +type GasLeakAlert struct { + Ts int64 +} + type TimeTick struct { Ts int64 } diff --git a/go/r3events/marshal_events.go b/go/r3events/marshal_events.go index 5456bdb..7da4e1f 100644 --- a/go/r3events/marshal_events.go +++ b/go/r3events/marshal_events.go @@ -91,6 +91,11 @@ func UnmarshalByteByte2Event(data [][]byte) (event interface{}, category string, err = json.Unmarshal(data[1], newevent) category = "time" event = *newevent + case "GasLeakAlert": + newevent := new(GasLeakAlert) + err = json.Unmarshal(data[1], newevent) + category = "sensors" + event = *newevent case "MovementSensorUpdate": newevent := new(MovementSensorUpdate) err = json.Unmarshal(data[1], newevent) -- 1.7.10.4