mirror of
https://github.com/cyberjunky/home-assistant-garmin_connect.git
synced 2026-01-09 12:57:58 -05:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a5b42a560 | ||
|
|
e2deaed42b | ||
|
|
78b6641506 | ||
|
|
29f0832e8b | ||
|
|
07473ef701 | ||
|
|
b8156a6a7d | ||
|
|
7546a40012 | ||
|
|
e6f7947e2c | ||
|
|
dda115539f | ||
|
|
304cd1f227 | ||
|
|
6dc64df4d9 | ||
|
|
c3af1cc392 | ||
|
|
4fa9f446de | ||
|
|
3b54e25db5 | ||
|
|
73eb0cea73 | ||
|
|
8099a99077 | ||
|
|
8647e95e30 | ||
|
|
270327d7d8 | ||
|
|
261f41940f |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Ron Klinkien
|
||||
Copyright (c) 2021-2024 Ron Klinkien
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -130,6 +130,12 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
_LOGGER.debug(f"Activities data: {activities}")
|
||||
summary['lastActivities'] = activities
|
||||
|
||||
badges = await self.hass.async_add_executor_job(
|
||||
self._api.get_earned_badges
|
||||
)
|
||||
_LOGGER.debug(f"Badges data: {badges}")
|
||||
summary['badges'] = badges
|
||||
|
||||
alarms = await self.hass.async_add_executor_job(self._api.get_device_alarms)
|
||||
_LOGGER.debug(f"Alarms data: {alarms}")
|
||||
|
||||
|
||||
@@ -400,6 +400,7 @@ GARMIN_ENTITY_LIST = {
|
||||
"metabolicAge": ["Metabolic Age", UnitOfTime.YEARS, "mdi:calendar-heart", None, SensorStateClass.TOTAL, False],
|
||||
"nextAlarm": ["Next Alarm Time", None, "mdi:alarm", SensorDeviceClass.TIMESTAMP, None, True],
|
||||
"lastActivities": ["Last Activities", None, "mdi:numeric", SensorStateClass.TOTAL, None, False],
|
||||
"badges": ["Badges", None, "mdi:numeric", SensorStateClass.TOTAL, None, False],
|
||||
"sleepScore": [
|
||||
"Sleep Score",
|
||||
None,
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
"documentation": "https://github.com/cyberjunky/home-assistant-garmin_connect",
|
||||
"iot_class": "cloud_polling",
|
||||
"issue_tracker": "https://github.com/cyberjunky/home-assistant-garmin_connect/issues",
|
||||
"requirements": ["garminconnect>=0.2.22", "tzlocal"],
|
||||
"version": "0.2.20"
|
||||
"requirements": ["garminconnect>=0.2.23", "tzlocal"],
|
||||
"version": "0.2.22"
|
||||
}
|
||||
|
||||
@@ -169,6 +169,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
|
||||
|
||||
@@ -212,6 +215,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]
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"password": "Heslo",
|
||||
"username": "Užívateľské meno"
|
||||
},
|
||||
"description": "Zadajte svoje poverenia.",
|
||||
"description": "Zadajte svoje poverovacie údaje.",
|
||||
"title": "Garmin Connect"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
colorlog==6.8.2
|
||||
homeassistant==2024.1.0
|
||||
pip>=21.0,<24.1
|
||||
ruff==0.3.5
|
||||
mypy==1.8.0
|
||||
pre-commit==3.6.0
|
||||
pylint==3.0.3
|
||||
pip>=24.1.1,<24.2
|
||||
ruff==0.5.0
|
||||
mypy==1.10.1
|
||||
pre-commit==3.7.1
|
||||
pylint==3.2.5
|
||||
types-cachetools
|
||||
@@ -1,3 +1,3 @@
|
||||
-r requirements.txt
|
||||
pre-commit==3.7.0
|
||||
pre-commit==3.7.1
|
||||
vulture==2.11
|
||||
Reference in New Issue
Block a user