Compare commits

...

20 Commits

Author SHA1 Message Date
Ron Klinkien
f16f96e5de Pin garth version to 0.4.47 2024-12-12 08:32:30 +01:00
Ron Klinkien
5a5b42a560 Bumped version of garminconnect 2024-11-27 20:20:57 +01:00
Ron Klinkien
e2deaed42b Dev version, added garmin badges 2024-11-27 10:14:55 +01:00
Ron Klinkien
78b6641506 Updated sk.json 2024-11-27 10:14:17 +01:00
Ron Klinkien
29f0832e8b Updated LICENSE 2024-11-27 10:14:17 +01:00
Ron
07473ef701 Merge pull request #139 from kozerskil/badges
Added badges
2024-11-27 10:13:26 +01:00
Ron
b8156a6a7d Merge pull request #186 from cyberjunky/dependabot/pip/pylint-3.2.5
Bump pylint from 3.0.3 to 3.2.5
2024-11-27 09:41:25 +01:00
Ron
7546a40012 Merge branch 'main' into dependabot/pip/pylint-3.2.5 2024-11-27 09:40:48 +01:00
Ron
e6f7947e2c Merge pull request #187 from cyberjunky/dependabot/pip/ruff-0.5.0
Bump ruff from 0.3.5 to 0.5.0
2024-11-27 09:39:53 +01:00
Ron
dda115539f Merge branch 'main' into dependabot/pip/ruff-0.5.0 2024-11-27 09:39:41 +01:00
Ron
304cd1f227 Merge pull request #188 from cyberjunky/dependabot/pip/mypy-1.10.1
Bump mypy from 1.8.0 to 1.10.1
2024-11-27 09:38:59 +01:00
Ron
6dc64df4d9 Merge branch 'main' into dependabot/pip/mypy-1.10.1 2024-11-27 09:38:23 +01:00
Ron
c3af1cc392 Merge pull request #185 from cyberjunky/dependabot/pip/pip-gte-24.1.1-and-lt-24.2
Update pip requirement from <24.1,>=21.0 to >=24.1.1,<24.2
2024-11-27 09:37:25 +01:00
Ron
4fa9f446de Merge pull request #173 from cyberjunky/dependabot/pip/pre-commit-3.7.1
Bump pre-commit from 3.6.0 to 3.7.1
2024-11-27 09:37:11 +01:00
dependabot[bot]
3b54e25db5 Bump mypy from 1.8.0 to 1.10.1
Bumps [mypy](https://github.com/python/mypy) from 1.8.0 to 1.10.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.8.0...v1.10.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 19:10:08 +00:00
dependabot[bot]
73eb0cea73 Bump ruff from 0.3.5 to 0.5.0
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.5 to 0.5.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.3.5...0.5.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 19:10:03 +00:00
dependabot[bot]
8099a99077 Bump pylint from 3.0.3 to 3.2.5
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.3 to 3.2.5.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.3...v3.2.5)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 19:09:53 +00:00
dependabot[bot]
8647e95e30 Update pip requirement from <24.1,>=21.0 to >=24.1.1,<24.2
Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/compare/21.0...24.1.1)

---
updated-dependencies:
- dependency-name: pip
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 19:09:49 +00:00
dependabot[bot]
270327d7d8 Bump pre-commit from 3.6.0 to 3.7.1
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.6.0 to 3.7.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v3.7.1)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 19:18:19 +00:00
luk
261f41940f Add badges 2024-02-13 13:47:51 +01:00
8 changed files with 23 additions and 10 deletions

View File

@@ -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

View File

@@ -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}")

View File

@@ -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,

View File

@@ -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.24", "tzlocal"],
"version": "0.2.23"
}

View File

@@ -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]

View File

@@ -15,7 +15,7 @@
"password": "Heslo",
"username": "Užívateľské meno"
},
"description": "Zadajte svoje poverenia.",
"description": "Zadajte svoje poverovacie údaje.",
"title": "Garmin Connect"
}
}

View File

@@ -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

View File

@@ -1,3 +1,3 @@
-r requirements.txt
pre-commit==3.7.0
pre-commit==3.7.1
vulture==2.11