mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-04 02:48:41 +00:00
Using System.getDeviceSettings().activityTrackingOn
Instead of activity elapsed time. Also forgot to update the WebhookManager class code.
This commit is contained in:
@ -105,8 +105,9 @@ class BackgroundServiceDelegate extends System.ServiceDelegate {
|
||||
if ((Activity has :getActivityInfo) and (Activity has :getProfileInfo)) {
|
||||
var activity = Activity.getProfileInfo().sport;
|
||||
var sub_activity = Activity.getProfileInfo().subSport;
|
||||
// We need to check if we are actually tracking any activity
|
||||
if (Activity.getActivityInfo().elapsedTime == 0) {
|
||||
// We need to check if we are actually tracking any activity as the enumerated type does not include "No Sport".
|
||||
System.println("activityTrackingOn = " + System.getDeviceSettings().activityTrackingOn);
|
||||
if (!System.getDeviceSettings().activityTrackingOn) {
|
||||
// Indicate no activity with -1, not part of Garmin's activity codes.
|
||||
// https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity.html#Sport-module
|
||||
activity = -1;
|
||||
|
Reference in New Issue
Block a user