backdoor parse
authorBernhard Tittelbach <xro@realraum.at>
Sun, 6 Oct 2013 00:21:37 +0000 (00:21 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Sun, 6 Oct 2013 00:21:37 +0000 (00:21 +0000)
go/r3-eventbroker_zmq/main.go
go/r3-eventbroker_zmq/sockettoevent.go

index 8ea5fe4..6745752 100644 (file)
@@ -3,8 +3,6 @@
 package main
 
 import (
 package main
 
 import (
-    "fmt"
-    "os"
     "flag"
     //~ "time"
     pubsub "github.com/tuxychandru/pubsub"
     "flag"
     //~ "time"
     pubsub "github.com/tuxychandru/pubsub"
index a7a21bf..64c71dd 100644 (file)
@@ -79,6 +79,8 @@ func ParseSocketInputLine(lines [][]byte, ps *pubsub.PubSub, keylookup_socket *z
             ps.Pub(r3events.DoorAjarUpdate{string(lines[4]) == "shut", ts}, "door")
         case "open", "close", "toggle", "reset":
             ps.Pub(r3events.DoorCommandEvent{string(lines[0]), string(lines[1]), string(lines[2]), ts},"doorcmd")
             ps.Pub(r3events.DoorAjarUpdate{string(lines[4]) == "shut", ts}, "door")
         case "open", "close", "toggle", "reset":
             ps.Pub(r3events.DoorCommandEvent{string(lines[0]), string(lines[1]), string(lines[2]), ts},"doorcmd")
+        case "BackdoorInfo(ajar):":
+            ps.Pub(r3events.BackdoorAjarUpdate{string(lines[len(lines)-1]) == "shut", ts},"door")
         //~ case "photo0:":
             //~ newphoto, err := strconv.ParseInt(string(lines[1]), 10, 32)
             //~ if err == nil {
         //~ case "photo0:":
             //~ newphoto, err := strconv.ParseInt(string(lines[1]), 10, 32)
             //~ if err == nil {