added swd controller and promagmbs rework

This commit is contained in:
Nico Melone
2021-12-08 16:00:13 -06:00
parent e351d00037
commit 38c0657fcf
17 changed files with 1893 additions and 520 deletions

View File

@@ -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."""