diff --git a/source/BackgroundServiceDelegate.mc b/source/BackgroundServiceDelegate.mc index a783b5f..13e72d8 100644 --- a/source/BackgroundServiceDelegate.mc +++ b/source/BackgroundServiceDelegate.mc @@ -106,12 +106,12 @@ class BackgroundServiceDelegate extends System.ServiceDelegate { var activity = Activity.getProfileInfo().sport; var sub_activity = Activity.getProfileInfo().subSport; data.add({ - "state" => activity ? activity : -1, + "state" => activity != null ? activity : -1, "type" => "sensor", "unique_id" => "activity" }); data.add({ - "state" => sub_activity ? sub_activity : -1, + "state" => sub_activity != null ? sub_activity : -1, "type" => "sensor", "unique_id" => "sub_activity" }); diff --git a/source/WebhookManager.mc b/source/WebhookManager.mc index 162e9c8..80747fe 100644 --- a/source/WebhookManager.mc +++ b/source/WebhookManager.mc @@ -186,7 +186,7 @@ class WebhookManager { var activity = Activity.getProfileInfo().sport; registerWebhookSensor({ "name" => "Activity", - "state" => activity ? activity : -1, + "state" => activity != null ? activity : -1, "type" => "sensor", "unique_id" => "activity", "disabled" => false @@ -199,7 +199,7 @@ class WebhookManager { var sub_activity = Activity.getProfileInfo().subSport; registerWebhookSensor({ "name" => "Sub-activity", - "state" => sub_activity ? sub_activity : -1, + "state" => sub_activity != null ? sub_activity : -1, "type" => "sensor", "unique_id" => "sub_activity", "disabled" => false