mirror of
				https://github.com/house-of-abbey/GarminHomeAssistant.git
				synced 2025-11-04 00:48:14 +00:00 
			
		
		
		
	Best practices!
This commit is contained in:
		@@ -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"
 | 
			
		||||
                });
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user