Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update timer logic to be 2.0 compatible #14

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion firmware/lib/scout.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def set_timer(self, child_id, activity):
timer = send_api_request(
self.base_url, path=path, data={"child": child_id, "name": activity}
)
print("Timer started for " + activity)
return timer

def get_timer(self, child_id, activity):
Expand All @@ -88,7 +89,6 @@ def get_timer(self, child_id, activity):
if (
timer["name"] == activity
and timer["child"] == child_id
and timer["active"] == True
):
return timer
return None
Expand All @@ -101,6 +101,7 @@ def sleep(self, child_id):
"""
activity = "sleep"
self.resolve_timers(child_id, activity)
print("Recorded Sleep")

def tummy_time(self, child_id):
"""
Expand Down
Loading