mirror of
https://github.com/cyberjunky/home-assistant-garmin_connect.git
synced 2026-01-09 12:57:58 -05:00
Add badges
This commit is contained in:
@@ -179,6 +179,9 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
|
||||
if self._type == "lastActivities":
|
||||
return len(self.coordinator.data[self._type])
|
||||
|
||||
if self._type == "badges":
|
||||
return len(self.coordinator.data[self._type])
|
||||
|
||||
if not self.coordinator.data or not self.coordinator.data[self._type]:
|
||||
return None
|
||||
|
||||
@@ -222,6 +225,9 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
|
||||
if self._type == "lastActivities":
|
||||
attributes["last_Activities"] = self.coordinator.data[self._type]
|
||||
|
||||
if self._type == "badges":
|
||||
attributes["badges"] = self.coordinator.data[self._type]
|
||||
|
||||
if self._type == "nextAlarm":
|
||||
attributes["next_alarms"] = calculate_next_active_alarms(
|
||||
self.coordinator.data[self._type]
|
||||
|
||||
Reference in New Issue
Block a user