Skip to content

Commit

Permalink
Chnanged CrossLIne and Cross Region topic to IVS
Browse files Browse the repository at this point in the history
  • Loading branch information
psyciknz committed Feb 2, 2019
1 parent 8ade9d9 commit 0086a3c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions CameraEvents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import paho.mqtt.client as paho # pip install paho-mqtt
import base64

version = "0.1.0"
version = "0.1.1"

mqttc = paho.Client("CameraEvents-" + socket.gethostname(), clean_session=True)

Expand Down Expand Up @@ -267,17 +267,13 @@ def OnReceive(self, data):

region = crossData["Name"]
object = crossData["Object"]["ObjectType"]
regionText = "{}: {} {}".format(object,direction,region)
regionText = "{} With {} in {} direction for {} region".format(object,direction,region)

self.client.publish(self.basetopic +"/" + Alarm["Code"] + "/" + Alarm["channel"] ,regionText)
self.client.publish(self.basetopic +"/IVS/" + Alarm["channel"] ,regionText)
if self.alerts:
#possible new process:
#http://192.168.10.66/cgi-bin/snapManager.cgi?action=attachFileProc&Flags[0]=Event&Events=[VideoMotion%2CVideoLoss]
if Alarm["Code"] == "CrossRegionDetection":
code = "Cross Region"
else:
code = "Cross Line"
process = threading.Thread(target=self.SnapshotImage,args=(index+1,Alarm["channel"],"{0}: {1}: {2}".format(code,Alarm["channel"],regionText)))
process = threading.Thread(target=self.SnapshotImage,args=(index+1,Alarm["channel"],"IVS: {0}: {1}".format(Alarm["channel"],regionText)))
process.daemon = True # Daemonize thread
process.start()
else:
Expand Down

0 comments on commit 0086a3c

Please sign in to comment.