From 164e7321f68ca53bdbb6f69ca10c8b99af923c46 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Wed, 6 Nov 2013 20:09:01 +0000 Subject: [PATCH] Problem string --- go/r3-eventbroker_zmq/sockettoevent.go | 7 ++++++- go/r3events/basicevents.go | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go/r3-eventbroker_zmq/sockettoevent.go b/go/r3-eventbroker_zmq/sockettoevent.go index 7831ab8..d8de48e 100644 --- a/go/r3-eventbroker_zmq/sockettoevent.go +++ b/go/r3-eventbroker_zmq/sockettoevent.go @@ -38,8 +38,13 @@ func parseSocketInputLine_State(lines [][]byte, ps *pubsub.PubSub, ts int64) { ps.Pub(r3events.DoorProblemEvent{100, ts}, "door") case "reset": ps.Pub(r3events.DoorLockUpdate{true, ts}, "door") - case "timeout", "timeout_after_open", "timeout_after_close": + case "timeout_after_open": ps.Pub(r3events.DoorProblemEvent{10, ts}, "door") + ps.Pub(r3events.DoorLockUpdate{false, ts}, "door") + case "timeout_after_close": + ps.Pub(r3events.DoorProblemEvent{20, ts}, "door") + // can't say for sure that door is locked if we ran into timeout while closing + //~ ps.Pub(r3events.DoorLockUpdate{true, ts}, "door") case "opening": case "closing": default: diff --git a/go/r3events/basicevents.go b/go/r3events/basicevents.go index f2fa559..60a8b8d 100644 --- a/go/r3events/basicevents.go +++ b/go/r3events/basicevents.go @@ -31,6 +31,7 @@ type DoorManualMovementEvent struct { type DoorProblemEvent struct { Severity int + Problem string Ts int64 } -- 1.7.10.4