mirror of
https://github.com/bckelley/tconnectsync.git
synced 2026-08-24 03:34:12 -05:00
Implement FSL3 sensor integration alongside G6, G7, and FSL2 with expanded CGM alert codes, improved datetime handling, and test coverage. **FSL3 Event Integration:** - Add FSL3 events to CGM_READING, _CGM_JOIN, and _CGM_STOP event classes - Enable unified processing of FSL3 alongside existing sensor variants: - Event 480: LID_CGM_DATA_FSL3 - Event 477: LID_CGM_JOIN_SESSION_FSL3 - Event 486: LID_CGM_STOP_SESSION_FSL3 **CGM Alert Enumeration:** - Expand CGM alert codes from 8 to 18 mapped codes - Add verified alert codes: 1, 2, 3, 8, 12, 22, 25, 45, 46, 48 - Rename alert 51 to CONTROL_IQ_LOW (was DEFAULT_ALERT_51) - Add alert descriptions based on pump history verification **Code Quality Improvements:** - Fix duplicate enum keys in events.json (Sensor Type codes 12, 13) - Add logging infrastructure to generic.py for event diagnostics - Add conftest.py test configuration **DateTime and API Improvements:** - Fix format_datetime() for proper UTC conversion with Z suffix - Simplify Nightscout API methods by removing redundant retry logic - Improve error reporting in last_uploaded_entry() and last_uploaded_bg_entry() **Test Coverage:** - Add 3 FSL3 test cases with real pump data - Test single reading processing, multiple readings, and JOIN event parsing - All 105 tests passing (102 existing + 3 new FSL3 tests)
11 lines
341 B
Python
11 lines
341 B
Python
import os
|
|
import sys
|
|
|
|
# Set timezone BEFORE importing any tconnectsync modules
|
|
os.environ['TIMEZONE_NAME'] = 'America/New_York'
|
|
|
|
# Remove any cached imports of tconnectsync modules to force reimport with new env
|
|
for module_name in list(sys.modules.keys()):
|
|
if module_name.startswith('tconnectsync'):
|
|
del sys.modules[module_name]
|