Problem string
authorBernhard Tittelbach <xro@realraum.at>
Wed, 6 Nov 2013 20:09:01 +0000 (20:09 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Wed, 6 Nov 2013 20:09:01 +0000 (20:09 +0000)
go/r3-eventbroker_zmq/sockettoevent.go
go/r3events/basicevents.go

index 7831ab8..d8de48e 100644 (file)
@@ -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:
index f2fa559..60a8b8d 100644 (file)
@@ -31,6 +31,7 @@ type DoorManualMovementEvent struct {
 
 type DoorProblemEvent struct {
     Severity int
+    Problem string
     Ts int64
 }