made mappings for channels reporting a number that needed to be mapped
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"driverFileName": "multisensor.py",
|
||||
"deviceName": "multisensor",
|
||||
"driverId": "0240",
|
||||
"releaseVersion": "5",
|
||||
"releaseVersion": "6",
|
||||
"files": {
|
||||
"file1": "multisensor.py",
|
||||
"file2": "utilities.py",
|
||||
|
||||
@@ -78,7 +78,7 @@ class start(threading.Thread, deviceBase):
|
||||
mqtt=mqtt, Nodes=Nodes)
|
||||
|
||||
self.daemon = True
|
||||
self.version = "5"
|
||||
self.version = "6"
|
||||
self.finished = threading.Event()
|
||||
self.force_send = False
|
||||
self.public_ip_address = ""
|
||||
@@ -120,15 +120,15 @@ class start(threading.Thread, deviceBase):
|
||||
if "active" in chan.plc_tag:
|
||||
PERSIST[chan.mesh_name] = val
|
||||
persistence.store(PERSIST,'persist.json')
|
||||
if "scaledValue" in chan.plc_tag:
|
||||
if val <= PERSIST[chan.mesh_name[:3]+"low"] and PERSIST[chan.mesh_name[:3]+"active"] == 1:
|
||||
self.sendtodbDev(1, chan.mesh_name[:3]+"alarm", "LOW", 0, 'multisensor')
|
||||
elif val >= PERSIST[chan.mesh_name[:3]+"high"] and PERSIST[chan.mesh_name[:3]+"active"] == 1:
|
||||
self.sendtodbDev(1, chan.mesh_name[:3]+"alarm", "HIGH", 0, 'multisensor')
|
||||
else:
|
||||
self.sendtodbDev(1, chan.mesh_name[:3]+"alarm", "OK", 0, 'multisensor')
|
||||
if chan.check(val, self.force_send):
|
||||
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'multisensor')
|
||||
if "scaledValue" in chan.plc_tag:
|
||||
if val <= PERSIST[chan.mesh_name[:3]+"low"] and PERSIST[chan.mesh_name[:3]+"active"] == 1:
|
||||
self.sendtodbDev(1, chan.mesh_name[:3]+"alarm", "LOW", 0, 'multisensor')
|
||||
elif val >= PERSIST[chan.mesh_name[:3]+"high"] and PERSIST[chan.mesh_name[:3]+"active"] == 1:
|
||||
self.sendtodbDev(1, chan.mesh_name[:3]+"alarm", "HIGH", 0, 'multisensor')
|
||||
else:
|
||||
self.sendtodbDev(1, chan.mesh_name[:3]+"alarm", "OK", 0, 'multisensor')
|
||||
#time.sleep(5)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user