Compare commits

..
5 Commits
Author SHA1 Message Date
James Woglom 2339b4543e v2.1.9 2024-12-12 00:36:16 -05:00
James Woglom 3f6010fafc add processdevicestatus 2024-12-12 00:36:06 -05:00
James Woglom a028cdf3fe v2.1.8 2024-12-12 00:29:19 -05:00
James Woglom 093b42ff94 fix codecov 2024-12-12 00:29:11 -05:00
James Woglom 00023c6aba fix flake8 2024-12-12 00:27:35 -05:00
8 changed files with 9 additions and 11 deletions
+2 -2
View File
@@ -5,9 +5,9 @@ coverage:
project:
default: false
tconnectsync:
paths:
paths:
- "tconnectsync/"
target: '75%'
target: '60%'
threshold: '5%'
tests:
paths:
+1
View File
@@ -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'"
-6
View File
@@ -1,6 +0,0 @@
coverage:
status:
project:
default:
target: 50%
threshold: null
+1 -1
View File
@@ -1,6 +1,6 @@
[metadata]
name = tconnectsync
version = 2.1.7
version = 2.1.9
author = James Woglom
author_email = j@wogloms.net
description = Syncs Tandem Source (formerly t:connect) insulin pump data to Nightscout for the t:slim X2
@@ -24,6 +24,7 @@ class EventClass(set, Enum):
CGM_START_JOIN_STOP = {*_CGM_START, *_CGM_JOIN, *_CGM_STOP}
CGM_READING = {events.LidCgmDataGxb, events.LidCgmDataG7, events.LidCgmDataFsl2}
USER_MODE = {events.LidAaUserModeChange}
DEVICE_STATUS = {events.LidDailyBasal}
@staticmethod
def for_event(evt):
+1 -1
View File
@@ -173,7 +173,7 @@ class NightscoutApi:
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:
+1 -1
View File
@@ -50,7 +50,7 @@ class TandemSourceAutoupdate:
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
@@ -13,6 +13,7 @@ from .process_cartridge import ProcessCartridge
from .process_cgm_alert import ProcessCGMAlert
from .process_cgm_start_join_stop import ProcessCGMStartJoinStop
from .process_cgm_reading import ProcessCGMReading
from .process_device_status import ProcessDeviceStatus
from .process_user_mode import ProcessUserMode
from .update_profiles import UpdateProfiles
@@ -39,6 +40,7 @@ class ProcessTimeRange:
EventClass.CGM_START_JOIN_STOP.name: ProcessCGMStartJoinStop,
EventClass.CGM_READING.name: ProcessCGMReading,
EventClass.USER_MODE.name: ProcessUserMode,
EventClass.DEVICE_STATUS.name: ProcessDeviceStatus
}
updater_classes = [