Skip to content

Commit

Permalink
heroku_helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoglom committed Oct 2, 2024
1 parent c2f7070 commit 0464325
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tconnectsync/sync/tandemsource/heroku_helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from ...features import DEFAULT_FEATURES
from .choose_device import TandemSourceChooseDevice
from .process import ProcessTimeRange
from ... import secret

import datetime

def run_oneshot(tconnect, nightscout, pretend=False, features=DEFAULT_FEATURES, secret_arg=None, time_start=None, time_end=None):
if not time_start and not time_end:
time_end = datetime.datetime.now()
time_start = time_end - datetime.timedelta(days=1)

if not secret_arg:
secret_arg = secret

tconnectDevice = TandemSourceChooseDevice(secret_arg, tconnect).choose()
return ProcessTimeRange(tconnect, nightscout, tconnectDevice, pretend, features).process(time_start, time_end)

0 comments on commit 0464325

Please sign in to comment.