grml parsing firmware
authorBernhard Tittelbach <xro@realraum.at>
Fri, 4 Oct 2013 17:22:14 +0000 (17:22 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Fri, 4 Oct 2013 17:22:14 +0000 (17:22 +0000)
go/r3-eventbroker_zmq/sockettoevent.go

index 2445c78..6c245b4 100644 (file)
@@ -29,19 +29,19 @@ var (
 
 func parseSocketInputLine_State(lines [][]byte, ps *pubsub.PubSub, ts int64) {
     switch string(lines[0]) {
-        case "closed,":
+        case "closed":
             ps.Pub(r3events.DoorLockUpdate{0, true, ts}, "door")
-        case "opened,":
+        case "opened":
             ps.Pub(r3events.DoorLockUpdate{0, false, ts}, "door")
         case "manual":   //movement
-        case "error,":
-        case "reset,":
+        case "error":
+        case "reset":
             ps.Pub(r3events.DoorLockUpdate{0, true, ts}, "door")
         case "timeout":   //after open | after close
-        case "opening,":
-        case "closing,":
+        case "opening":
+        case "closing":
         default:
-            log.Print("parseSocketInputLine_State: Unexpected State:", lines)
+            if Syslog_ != nil {Syslog_.Print("parseSocketInputLine_State: Unexpected State:", lines)}
     }
 }