Added In Flowrate summation

This commit is contained in:
2020-10-02 08:44:40 -05:00
parent 392aa3b6ac
commit 5fdac4043e

View File

@@ -71,6 +71,7 @@ class start(threading.Thread, deviceBase):
self.private_ip_address = ""
self.public_ip_address_last_checked = 0
self.ping_counter = 0
self.flowrates = [0] * 10
threading.Thread.start(self)
# this is a required function for all drivers, its goal is to upload some piece of data
@@ -100,16 +101,21 @@ class start(threading.Thread, deviceBase):
for chan in CHANNELS:
val = chan.read()
if chan.mesh_name == "total_in_flowrate":
val = sum(self.flowrates)
if chan.check(val, self.force_send):
if chan.mesh_name in PERSIST["ignore_list"]:
if "lifetime" in chan.mesh_name and chan.mesh_name not in ['forward_out_lifetime', 'reverse_out_lifetime', 'net_out_lifetime']:
self.totalizer_null(chan.mesh_name[:-9])
else:
self.sendtodbDev(1, chan.mesh_name, None, 0, 'tenflowmeterskid')
elif "lifetime" in chan.mesh_name and chan.mesh_name not in ['forward_out_lifetime', 'reverse_out_lifetime', 'net_out_lifetime']:
self.totalize(val, chan.mesh_name[:-9])
else:
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'tenflowmeterskid')
if "flowrate" in chan.mesh_name and chan.mesh_name not in ["total_in_flowrate","total_out_flowrate"]:
self.flowrates[int(chan.mesh_name.split("_")[0][2:]) - 1] = val
#time.sleep(TAG_DATAERROR_SLEEPTIME) # sleep to allow Micro800 to handle ENET requests
for pond_index in range(1, 3):