mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-17 11:58:30 +00:00
Report -1 instead of null for no activity
This commit is contained in:
@ -103,13 +103,15 @@ class BackgroundServiceDelegate extends System.ServiceDelegate {
|
||||
}
|
||||
];
|
||||
if (Activity has :getProfileInfo) {
|
||||
var activity = Activity.getProfileInfo().sport;
|
||||
var sub_activity = Activity.getProfileInfo().subSport;
|
||||
data.add({
|
||||
"state" => Activity.getProfileInfo().sport,
|
||||
"state" => activity ? activity : -1,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "activity"
|
||||
});
|
||||
data.add({
|
||||
"state" => Activity.getProfileInfo().subSport,
|
||||
"state" => sub_activity ? sub_activity : -1,
|
||||
"type" => "sensor",
|
||||
"unique_id" => "sub_activity"
|
||||
});
|
||||
|
Reference in New Issue
Block a user