added swd controller and promagmbs rework
This commit is contained in:
@@ -103,7 +103,7 @@ class start(threading.Thread, deviceBase):
|
||||
val = chan.read()
|
||||
if chan.mesh_name == "total_in_flowrate":
|
||||
val = sum(self.flowrates)
|
||||
if chan.check(val, self.force_send):
|
||||
if chan.check(val, self.force_send) or self.check_new_day(chan.mesh_name[:-9]):
|
||||
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])
|
||||
@@ -134,6 +134,12 @@ class start(threading.Thread, deviceBase):
|
||||
if (now - self.public_ip_address_last_checked) > IP_CHECK_PERIOD:
|
||||
self._check_ip_address()
|
||||
|
||||
def check_new_day(self, totalizer):
|
||||
right_now = dt.today()
|
||||
day = right_now.day
|
||||
if not(day == TOTALIZERS[totalizer]['Day']):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _check_ip_address(self):
|
||||
"""Check the public IP address and send to Meshify if changed."""
|
||||
|
||||
Reference in New Issue
Block a user