diff --git a/Pipfile b/Pipfile index 42b336b..0b3bfe4 100644 --- a/Pipfile +++ b/Pipfile @@ -27,3 +27,4 @@ typing-extensions = "*" tconnectsync = "python3 main.py" test = "python3 -m unittest discover -vv" build_events = "bash -c 'cd tconnectsync/eventparser && python3 build_events.py > events.py'" +lint = "bash -c 'flake8 . --count --select=E9,F63,F7,F82 && flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 && echo PASS'" \ No newline at end of file diff --git a/tconnectsync/nightscout.py b/tconnectsync/nightscout.py index 0155713..4510f4f 100644 --- a/tconnectsync/nightscout.py +++ b/tconnectsync/nightscout.py @@ -173,7 +173,7 @@ def internal(t_to_space): if ret is None and (time_start or time_end): ret = internal(True) if ret is not None: - logger.warning("devicestatus with activityType=%s time_start=%s time_end=%s only returned data when timestamps contained a space" % (activityType, time_start, time_end)) + logger.warning("devicestatus time_start=%s time_end=%s only returned data when timestamps contained a space" % (time_start, time_end)) return ret except requests.exceptions.ConnectionError as e: if self.ignore_conn_errors: diff --git a/tconnectsync/sync/tandemsource/autoupdate.py b/tconnectsync/sync/tandemsource/autoupdate.py index cef4090..32a4f10 100644 --- a/tconnectsync/sync/tandemsource/autoupdate.py +++ b/tconnectsync/sync/tandemsource/autoupdate.py @@ -50,7 +50,7 @@ def process(self, tconnect, nightscout, time_start, time_end, pretend, features= if pretend: logger.info('Would update now if not in pretend mode') else: - added, event_seqnum = ProcessTimeRange(tconnect, nightscout, tconnectDevice, pretend, secret, features=features).process(time_start, time_end) + added, event_seqnum = ProcessTimeRange(tconnect, nightscout, tconnectDevice, pretend, self.secret, features=features).process(time_start, time_end) logger.info('Added %d items from ProcessTimeRange' % added) self.last_successful_process_time_range = now