Compare commits

...

9 Commits

Author SHA1 Message Date
Ron
4a9901958e Update README.md 2025-04-18 17:26:12 +02:00
Ron Klinkien
7c119b9fe5 First beta version with MFA support. 2025-04-18 15:16:59 +00:00
Ron Klinkien
2f19c5b1d6 MFA WIP 2025-02-08 18:30:58 +01:00
Ron Klinkien
dfc4b5c723 Added User Points, User Level and Last Activity sensors 2025-01-21 10:52:42 +00:00
Ron Klinkien
06ee9e15b7 Bumped version 2025-01-21 08:12:39 +00:00
Ron Klinkien
164fc53b6d Documented services examples 2025-01-21 08:11:52 +00:00
Ron
2eeb42b4da Merge pull request #236 from cyberjunky/dependabot/pip/ruff-0.9.2
Bump ruff from 0.7.2 to 0.9.2
2025-01-20 19:11:01 +01:00
Ron Klinkien
0cb06c7cc4 Fixed selection of 10 last badges 2025-01-20 18:01:57 +00:00
dependabot[bot]
99fe655919 Bump ruff from 0.7.2 to 0.9.2
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.2 to 0.9.2.
- [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/0.7.2...0.9.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 11:47:00 +00:00
40 changed files with 499 additions and 776 deletions

View File

@@ -3,39 +3,25 @@
# Garmin Connect
The Garmin Connect integration allows you to expose data from Garmin Connect to Home Assistant.
NOTE: This integration doesn't support 2FA on Garmin Connect yet (support is coming), so if you have enabled it -and want to keep it- this integration doesn't work, it will try to login repeatedly and generate lots of 2FA codes via email.
The change of adding support for it is unlikely since the Garmin Connect API is closed source, and will not be open for open-sourced projects.
## Installation
### HACS - Recommended
- Have [HACS](https://hacs.xyz) installed, this will allow you to easily manage and track updates.
- Inside HACS click 'Explore & download repositories'
- Search for 'Garmin Connect'.
- Click on found integration.
- Click Download this repository with HACS.
- Restart Home-Assistant.
- Follow configuration steps below.
[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=cyberjunky&repository=home-assistant-garmin_connect&category=integration)
### Manual
- Copy directory `custom_components/garmin_connect` to your `<config dir>/custom_components` directory.
- Restart Home-Assistant.
- Follow configuration steps below.
## Install via HACS
- The installation is done inside [HACS](https://hacs.xyz/) (Home Assistant Community Store). If you don't have HACS, you must install it before adding this integration. [Installation instructions here.](https://hacs.xyz/docs/setup/download)
- Once HACS is installed, search for `garmin connect`
- Click on "Download". Once fully downloaded, restart HomeAssistant.
## Configuration
Adding Garmin Connect to your Home Assistant instance can be done via the integrations user interface.
- In the sidebar, click 'Configuration', then 'Devices & Services'. Click the + icon to add "Garmin Connect" to your Home Assistant installation.
- Enter the credentials of the Garmin Connect account you want to add.
- Optionally -when MFA is enabled- it will ask for your MFA code.
- Browse to your Home Assistant instance.
- In the sidebar click on Configuration.
- From the configuration menu select: Integrations.
- In the bottom right, click on the Add Integration button.
- From the list, search and select “Garmin Connect”.
- Follow the instruction on screen to complete the set up
After successful set up a standard set of sensors are enabled. You can enable more if needed by using the Entities page under Devices and services. (Filter on disabled state)
After successful set up a standard set of sensors are enabled. You can enable more if needed by using the Integrations page.
Please be aware that Garmin Connect has very low rate limits, max. once every ~5 minutes.
The integration will fetch new data every 5 minutes, make sure your devices sync to the Garmin Connect website.
## Available Sensors
@@ -89,6 +75,9 @@ Gear Sensors
Disabled by default:
```text
Badges
User Points
User Level
Consumed KiloCalories
Remaining KiloCalories
Net Remaining KiloCalories
@@ -133,6 +122,8 @@ Muscle Mass
Physique Rating
Visceral Fat
Metabolic Age
Last Activities
Last Activity
```
## Screenshots
@@ -151,20 +142,20 @@ description: ""
trigger:
- platform: state
entity_id:
- sensor.my_weight
- sensor.weight
condition:
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.my_weight
entity_id: sensor.weight
above: 75
- condition: numeric_state
entity_id: sensor.my_weight
entity_id: sensor.weight
below: 88
action:
- service: garmin_connect.add_body_composition
data:
entity_id: sensor.garmin_connect_weight
entity_id: sensor.weight
weight: "{{trigger.to_state.state}}"
timestamp: "{{ as_timestamp(now()) | timestamp_local}}"
bmi: >-
@@ -172,6 +163,46 @@ action:
}}
mode: single
```
### Examples on how to test actions from HA GUI
#### Add Body Composition
```
action: garmin_connect.add_body_composition
data:
entity_id: sensor.weight
weight: 87
bmi: 25.5
bone_mass: 4.8
...
```
NOTE: You need to enable Weight entity
#### Set Active Gear
```
action: garmin_connect.set_active_gear
data:
entity_id: sensor.adidas
activity_type: running
setting: set as default
```
#### Add Blood Pressure
```
action: garmin_connect.add_blood_pressure
data:
entity_id: sensor.min_heart_rate
systolic: 120
diastolic: 80
pulse: 60
timestamp: 2025-1-21T07:34:00.000Z
notes: Measured with Beurer BC54
```
## Debugging
Add the relevant lines below to the `configuration.yaml`:
@@ -184,4 +215,5 @@ logger:
```
## Donation
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/cyberjunkynl/)

View File

@@ -5,7 +5,7 @@ from collections.abc import Awaitable
from datetime import datetime, timedelta
import logging
from zoneinfo import ZoneInfo
import requests
from garminconnect import (
Garmin,
GarminConnectAuthenticationError,
@@ -13,7 +13,7 @@ from garminconnect import (
GarminConnectTooManyRequestsError,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.const import CONF_TOKEN
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
@@ -23,6 +23,7 @@ from .const import (
DAY_TO_NUMBER,
DEFAULT_UPDATE_INTERVAL,
DOMAIN,
LEVEL_POINTS,
Gear,
)
@@ -64,35 +65,53 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
"""Initialize the Garmin Connect hub."""
self.entry = entry
self.hass = hass
self.in_china = False
self._in_china = False
self.country = self.hass.config.country
if self.country == "CN":
self.in_china = True
_LOGGER.debug("Country: %s", self.country)
# Check if the user resides in China
country = self.hass.config.country
if country == "CN":
self._in_china = True
_LOGGER.debug("Country: %s", country)
self.time_zone = self.hass.config.time_zone
_LOGGER.debug("Time zone: %s", self.time_zone)
self.api = Garmin(entry.data[CONF_USERNAME], entry.data[CONF_PASSWORD], self.in_china)
self.api = Garmin(is_cn=self._in_china)
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=DEFAULT_UPDATE_INTERVAL)
super().__init__(hass, _LOGGER, name=DOMAIN,
update_interval=DEFAULT_UPDATE_INTERVAL)
async def async_login(self) -> bool:
"""Login to Garmin Connect."""
try:
await self.hass.async_add_executor_job(self.api.login)
except (
GarminConnectAuthenticationError,
GarminConnectTooManyRequestsError,
) as err:
_LOGGER.error("Error occurred during Garmin Connect login request: %s", err)
await self.hass.async_add_executor_job(self.api.login, self.entry.data[CONF_TOKEN])
except GarminConnectAuthenticationError as err:
_LOGGER.error(
"Authentication error occurred during login: %s", err.response.text)
return False
except GarminConnectTooManyRequestsError as err:
_LOGGER.error(
"Too many request error occurred during login: %s", err)
return False
except GarminConnectConnectionError as err:
_LOGGER.error("Connection error occurred during Garmin Connect login request: %s", err)
_LOGGER.error(
"Connection error occurred during login: %s", err)
raise ConfigEntryNotReady from err
except Exception: # pylint: disable=broad-except
_LOGGER.exception("Unknown error occurred during Garmin Connect login request")
except requests.exceptions.HTTPError as err:
if err.response.status_code == 401:
_LOGGER.error(
"Authentication error occurred during login: %s", err.response.text)
return False
if err.response.status_code == 429:
_LOGGER.error(
"Too many requests error occurred during login: %s", err.response.text)
return False
_LOGGER.error(
"Unknown HTTP error occurred during login: %s", err)
return False
except Exception as err: # pylint: disable=broad-except
_LOGGER.exception(
"Unknown error occurred during login: %s", err)
return False
return True
@@ -106,6 +125,7 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
gear_stats = {}
gear_defaults = {}
activity_types = {}
last_activities = []
sleep_data = {}
sleep_score = None
sleep_time_seconds = None
@@ -116,101 +136,200 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
today = datetime.now(ZoneInfo(self.time_zone)).date()
try:
# User summary
summary = await self.hass.async_add_executor_job(
self.api.get_user_summary, today.isoformat()
)
_LOGGER.debug("Summary data fetched: %s", summary)
if summary:
_LOGGER.debug("User summary data fetched: %s", summary)
else:
_LOGGER.debug("No user summary data found")
# Body composition
body = await self.hass.async_add_executor_job(
self.api.get_body_composition, today.isoformat()
)
_LOGGER.debug("Body data fetched: %s", body)
if body:
_LOGGER.debug("Body data fetched: %s", body)
else:
_LOGGER.debug("No body data found")
activities = await self.hass.async_add_executor_job(
# Last activities
last_activities = await self.hass.async_add_executor_job(
self.api.get_activities_by_date,
(today - timedelta(days=7)).isoformat(),
(today + timedelta(days=1)).isoformat(),
)
_LOGGER.debug("Activities data fetched: %s", activities)
summary["lastActivities"] = activities
if last_activities:
_LOGGER.debug("Last activities data fetched: %s",
last_activities)
else:
_LOGGER.debug("No last activities data found")
# Add last activities to summary
summary["lastActivities"] = last_activities
summary["lastActivity"] = last_activities[0] if last_activities else {}
# Badges
badges = await self.hass.async_add_executor_job(self.api.get_earned_badges)
_LOGGER.debug("Badges data fetched: %s", badges)
if badges:
_LOGGER.debug("Badges data fetched: %s", badges)
else:
_LOGGER.debug("No badges data found")
# Add badges to summary
summary["badges"] = badges
alarms = await self.hass.async_add_executor_job(self.api.get_device_alarms)
_LOGGER.debug("Alarms data fetched: %s", alarms)
# Calculate user points and user level
user_points = 0
for badge in badges:
user_points += badge["badgePoints"] * \
badge["badgeEarnedNumber"]
# Add user points to summary
summary["userPoints"] = user_points
user_level = 0
for level, points in LEVEL_POINTS.items():
if user_points >= points:
user_level = level
# Add user level to summary
summary["userLevel"] = user_level
# Alarms
alarms = await self.hass.async_add_executor_job(self.api.get_device_alarms)
if alarms:
_LOGGER.debug("Alarms data fetched: %s", alarms)
else:
_LOGGER.debug("No alarms data found")
# Add alarms to summary
next_alarms = calculate_next_active_alarms(alarms, self.time_zone)
# Activity types
activity_types = await self.hass.async_add_executor_job(self.api.get_activity_types)
_LOGGER.debug("Activity types data fetched: %s", activity_types)
if activity_types:
_LOGGER.debug("Activity types data fetched: %s",
activity_types)
else:
_LOGGER.debug("No activity types data found")
# Sleep data
sleep_data = await self.hass.async_add_executor_job(
self.api.get_sleep_data, today.isoformat()
)
_LOGGER.debug("Sleep data fetched: %s", sleep_data)
if sleep_data:
_LOGGER.debug("Sleep data fetched: %s", sleep_data)
else:
_LOGGER.debug("No sleep data found")
# HRV data
hrv_data = await self.hass.async_add_executor_job(
self.api.get_hrv_data, today.isoformat()
)
_LOGGER.debug("HRV data fetched: %s", hrv_data)
except (
GarminConnectAuthenticationError,
GarminConnectTooManyRequestsError,
GarminConnectConnectionError,
) as error:
_LOGGER.debug("Trying to relogin to Garmin Connect")
if not await self.async_login():
raise UpdateFailed(error) from error
if hrv_data:
_LOGGER.debug("HRV data fetched: %s", hrv_data)
else:
_LOGGER.debug("No HRV data found")
except GarminConnectAuthenticationError as err:
_LOGGER.error(
"Authentication error occurred during update: %s", err.response.text)
return False
except GarminConnectTooManyRequestsError as err:
_LOGGER.error(
"Too many request error occurred during update: %s", err)
return False
except GarminConnectConnectionError as err:
_LOGGER.error(
"Connection error occurred during update: %s", err)
raise ConfigEntryNotReady from err
except requests.exceptions.HTTPError as err:
if err.response.status_code == 401:
_LOGGER.error(
"Authentication error occurred during update: %s", err.response.text)
return False
if err.response.status_code == 429:
_LOGGER.error(
"Too many requests error occurred during update: %s", err.response.text)
return False
_LOGGER.error(
"Unknown HTTP error occurred during update: %s", err)
return False
except Exception as err: # pylint: disable=broad-except
_LOGGER.exception(
"Unknown error occurred during update: %s", err)
return False
try:
# Gear data like shoes, bike, etc.
gear = await self.hass.async_add_executor_job(
self.api.get_gear, summary[Gear.USERPROFILE_ID]
)
_LOGGER.debug("Gear data fetched: %s", gear)
if gear:
_LOGGER.debug("Gear data fetched: %s", gear)
else:
_LOGGER.debug("No gear data found")
# Gear stats data like distance, time, etc.
tasks: list[Awaitable] = [
self.hass.async_add_executor_job(self.api.get_gear_stats, gear_item[Gear.UUID])
self.hass.async_add_executor_job(
self.api.get_gear_stats, gear_item[Gear.UUID])
for gear_item in gear
]
gear_stats = await asyncio.gather(*tasks)
_LOGGER.debug("Gear stats data fetched: %s", gear_stats)
if gear_stats:
_LOGGER.debug("Gear stats data fetched: %s", gear_stats)
else:
_LOGGER.debug("No gear stats data found")
# Gear defaults data like shoe, bike, etc.
gear_defaults = await self.hass.async_add_executor_job(
self.api.get_gear_defaults, summary[Gear.USERPROFILE_ID]
)
_LOGGER.debug("Gear defaults data fetched: %s", gear_defaults)
if gear_defaults:
_LOGGER.debug("Gear defaults data fetched: %s", gear_defaults)
else:
_LOGGER.debug("No gear defaults data found")
except (KeyError, TypeError, ValueError, ConnectionError) as err:
_LOGGER.debug("Gear data is not available: %s", err)
_LOGGER.debug("Error occurred while fetching Gear data: %s", err)
# Sleep score data
try:
sleep_score = sleep_data["dailySleepDTO"]["sleepScores"]["overall"]["value"]
_LOGGER.debug("Sleep score data: %s", sleep_score)
except KeyError:
_LOGGER.debug("Sleep score data is not available")
_LOGGER.debug("No sleep score data found")
# Sleep time seconds data
try:
sleep_time_seconds = sleep_data["dailySleepDTO"]["sleepTimeSeconds"]
_LOGGER.debug("Sleep time seconds data: %s", sleep_time_seconds)
if sleep_time_seconds:
_LOGGER.debug("Sleep time seconds data: %s",
sleep_time_seconds)
else:
_LOGGER.debug("No sleep time seconds data found")
except KeyError:
_LOGGER.debug("Sleep time seconds data is not available")
_LOGGER.debug("No sleep time seconds data found")
# HRV data
try:
if hrv_data and "hrvSummary" in hrv_data:
hrv_status = hrv_data["hrvSummary"]
_LOGGER.debug("HRV summary: %s", hrv_status)
_LOGGER.debug("HRV summary status: %s", hrv_status)
except KeyError:
_LOGGER.debug("HRV data is not available")
_LOGGER.debug(
"Error occurred while processing HRV summary status data")
return {
**summary,
**body["totalAverage"],
"nextAlarm": next_alarms,
"gear": gear,
"gear_stats": gear_stats,
"activity_types": activity_types,
"gear_defaults": gear_defaults,
"gearStats": gear_stats,
"activityTypes": activity_types,
"gearDefaults": gear_defaults,
"sleepScore": sleep_score,
"sleepTimeSeconds": sleep_time_seconds,
"hrvStatus": hrv_status,
@@ -226,6 +345,10 @@ def calculate_next_active_alarms(alarms, time_zone):
Alarms data fetched: [{'alarmMode': 'OFF', 'alarmTime': 1233, 'alarmDays': ['ONCE'], 'alarmSound': 'TONE_AND_VIBRATION', 'alarmId': 1737308355, 'changeState': 'UNCHANGED', 'backlight': 'ON', 'enabled': None, 'alarmMessage': None, 'alarmImageId': None, 'alarmIcon': None, 'alarmType': None}]
"""
active_alarms = []
if not alarms:
return active_alarms
now = datetime.now(ZoneInfo(time_zone))
_LOGGER.debug("Now: %s, Alarms: %s", now, alarms)
@@ -255,8 +378,10 @@ def calculate_next_active_alarms(alarms, time_zone):
)
days_to_add = DAY_TO_NUMBER[day] % 7
alarm = start_of_week + timedelta(minutes=alarm_time, days=days_to_add)
_LOGGER.debug("Start of week: %s, Alarm: %s", start_of_week, alarm)
alarm = start_of_week + \
timedelta(minutes=alarm_time, days=days_to_add)
_LOGGER.debug("Start of week: %s, Alarm: %s",
start_of_week, alarm)
# If the alarm time is in the past, move it to the next week
if alarm < now:

View File

@@ -1,72 +1,176 @@
"""Config flow for Garmin Connect integration."""
import logging
from collections.abc import Mapping
from typing import Any, cast
import requests
from garminconnect import (
Garmin,
GarminConnectAuthenticationError,
GarminConnectConnectionError,
GarminConnectTooManyRequestsError,
)
from homeassistant import config_entries
from homeassistant.const import CONF_ID, CONF_PASSWORD, CONF_USERNAME
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_ID, CONF_TOKEN, CONF_PASSWORD, CONF_USERNAME
import voluptuous as vol
from .const import DOMAIN
from .const import CONF_MFA, DOMAIN
_LOGGER = logging.getLogger(__name__)
class GarminConnectConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
class GarminConnectConfigFlowHandler(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Garmin Connect."""
VERSION = 1
async def _show_setup_form(self, errors=None):
"""Show the setup form to the user."""
return self.async_show_form(
step_id="user",
data_schema=vol.Schema(
{vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str}
),
errors=errors or {},
)
def __init__(self) -> None:
"""Initialize flow."""
self.data_schema = {
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str,
}
self.mfa_data_schema = {
vol.Required(CONF_MFA): str,
}
async def async_step_user(self, user_input=None):
"""Handle the initial step."""
if user_input is None:
return await self._show_setup_form()
username = user_input[CONF_USERNAME]
password = user_input[CONF_PASSWORD]
api = Garmin(username, password)
self._api = None
self._login_result1: Any = None
self._login_result2: Any = None
self._mfa_code: str | None = None
self._username: str | None = None
self._password: str | None = None
self._in_china = False
async def _async_garmin_connect_login(self, step_id: str) -> ConfigFlowResult:
"""Handle login with Garmin Connect."""
errors = {}
# Check if the user resides in China
country = self.hass.config.country
if country == "CN":
self._in_china = True
self._api = Garmin(email=self._username,
password=self._password, return_on_mfa=True, is_cn=self._in_china)
try:
await self.hass.async_add_executor_job(api.login)
self._login_result1, self._login_result2 = await self.hass.async_add_executor_job(self._api.login)
_LOGGER.debug(f"Login result1: {self._login_result1}")
_LOGGER.debug(f"Login result2: {self._login_result2}")
if self._login_result1 == "needs_mfa": # MFA is required
return await self.async_step_mfa()
except GarminConnectConnectionError:
errors["base"] = "cannot_connect"
return await self._show_setup_form(errors)
errors = {"base": "cannot_connect"}
except GarminConnectAuthenticationError:
errors["base"] = "invalid_auth"
return await self._show_setup_form(errors)
errors = {"base": "invalid_auth"}
except GarminConnectTooManyRequestsError:
errors["base"] = "too_many_requests"
return await self._show_setup_form(errors)
errors = {"base": "too_many_requests"}
except requests.exceptions.HTTPError as err:
if err.response.status_code == 403:
errors = {"base": "invalid_auth"}
elif err.response.status_code == 429:
errors = {"base": "too_many_requests"}
else:
errors = {"base": "cannot_connect"}
except Exception: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception")
errors["base"] = "unknown"
return await self._show_setup_form(errors)
errors = {"base": "unknown"}
await self.async_set_unique_id(username)
self._abort_if_unique_id_configured()
if errors:
return self.async_show_form(
step_id=step_id, data_schema=vol.Schema(self.data_schema), errors=errors
)
return await self._async_create_entry()
async def _async_garmin_connect_mfa_login(self) -> ConfigFlowResult:
"""Handle multi-factor authentication (MFA) login with Garmin Connect."""
try:
oauth1, oauth2 = await self.hass.async_add_executor_job(self._api.resume_login, self._login_result2, self._mfa_code)
_LOGGER.info(f"Oauth1: {oauth1}, Oauth2: {oauth2}")
except GarminConnectAuthenticationError:
return self.async_show_form(
step_id="mfa",
data_schema=vol.Schema(self.mfa_data_schema),
errors={"base": "invalid_mfa_code"},
)
return await self._async_create_entry()
async def _async_create_entry(self) -> ConfigFlowResult:
"""Create the config entry."""
config_data = {
CONF_ID: self._username,
CONF_USERNAME: self._username,
CONF_TOKEN: self._api.garth.dumps(),
}
existing_entry = await self.async_set_unique_id(self._username)
if existing_entry:
return self.async_update_reload_and_abort(existing_entry, data=config_data)
return self.async_create_entry(
title=username,
data={
CONF_ID: username,
CONF_USERNAME: username,
CONF_PASSWORD: password,
},
title=cast(str, self._username), data=config_data
)
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a flow initialized by the user."""
if user_input is None:
return self.async_show_form(
step_id="user", data_schema=vol.Schema(self.data_schema)
)
self._username = user_input[CONF_USERNAME]
self._password = user_input[CONF_PASSWORD]
return await self._async_garmin_connect_login(step_id="user")
async def async_step_mfa(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a multi-factor authentication (MFA) flow."""
if user_input is None:
return self.async_show_form(
step_id="mfa", data_schema=vol.Schema(self.mfa_data_schema)
)
self._mfa_code = user_input[CONF_MFA]
_LOGGER.info(f"MFA CODE: {self._mfa_code}")
return await self._async_garmin_connect_mfa_login()
async def async_step_reauth(
self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult:
"""Handle reauthorization request from Garmin Connect."""
self._username = entry_data[CONF_USERNAME]
return await self.async_step_reauth_confirm()
async def async_step_reauth_confirm(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle reauthorization flow."""
if user_input is None:
return self.async_show_form(
step_id="reauth_confirm",
data_schema=vol.Schema(
{
vol.Required(CONF_USERNAME, default=self._username): str,
vol.Required(CONF_PASSWORD): str,
}
),
)
self._username = user_input[CONF_USERNAME]
self._password = user_input[CONF_PASSWORD]
return await self._async_garmin_connect_login(step_id="reauth_confirm")

View File

@@ -9,7 +9,7 @@ from homeassistant.const import PERCENTAGE, UnitOfLength, UnitOfMass, UnitOfTime
DOMAIN = "garmin_connect"
DATA_COORDINATOR = "coordinator"
DEFAULT_UPDATE_INTERVAL = timedelta(minutes=5)
CONF_MFA = "mfa_code"
DAY_TO_NUMBER = {
"Mo": 1,
"M": 1,
@@ -23,6 +23,19 @@ DAY_TO_NUMBER = {
"Su": 7,
}
LEVEL_POINTS = {
1: 0,
2: 20,
3: 60,
4: 140,
5: 300,
6: 620,
7: 1260,
8: 2540,
9: 5100,
10: 10220,
}
GARMIN_ENTITY_LIST = {
"totalSteps": ["Total Steps", "steps", "mdi:walk", None, SensorStateClass.TOTAL, True],
"dailyStepGoal": ["Daily Step Goal", "steps", "mdi:walk", None, SensorStateClass.TOTAL, True],
@@ -609,7 +622,17 @@ GARMIN_ENTITY_LIST = {
],
"nextAlarm": ["Next Alarm Time", None, "mdi:alarm", SensorDeviceClass.TIMESTAMP, None, True],
"lastActivities": ["Last Activities", None, "mdi:numeric", None, SensorStateClass.TOTAL, False],
"lastActivity": ["Last Activity", None, "mdi:walk", None, None, False],
"badges": ["Badges", None, "mdi:medal", None, SensorStateClass.TOTAL, False],
"userPoints": ["User Points", None, "mdi:counter", None, SensorStateClass.TOTAL, False],
"userLevel": [
"User Level",
None,
"mdi:star-four-points-circle",
None,
SensorStateClass.TOTAL,
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.24"],
"version": "0.2.27"
"requirements": ["garminconnect>=0.2.26"],
"version": "0.2.31-beta-01"
}

View File

@@ -198,6 +198,9 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
if self._type == "lastActivities" or self._type == "badges":
value = len(self.coordinator.data[self._type])
if self._type == "lastActivity":
value = self.coordinator.data[self._type]["activityName"]
elif self._type == "hrvStatus":
value = self.coordinator.data[self._type]["status"].capitalize()
@@ -209,8 +212,8 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
elif self._type == "nextAlarm":
active_alarms = self.coordinator.data[self._type]
_LOGGER.debug("Active alarms: %s", active_alarms)
if active_alarms:
_LOGGER.debug("Active alarms: %s", active_alarms)
_LOGGER.debug("Next alarm: %s", active_alarms[0])
value = active_alarms[0]
else:
@@ -237,11 +240,16 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
}
if self._type == "lastActivities":
attributes["last_Activities"] = self.coordinator.data[self._type]
attributes["last_activities"] = self.coordinator.data[self._type]
if self._type == "lastActivity":
attributes = {**attributes, **self.coordinator.data[self._type]}
# Only show the last 10 badges for performance reasons
if self._type == "badges":
attributes["badges"] = self.coordinator.data[self._type][-10:]
badges = self.coordinator.data.get(self._type, [])
sorted_badges = sorted(badges, key=lambda x: x["badgeEarnedDate"])
attributes["badges"] = sorted_badges[-10:]
if self._type == "nextAlarm":
attributes["next_alarms"] = self.coordinator.data[self._type]
@@ -289,7 +297,8 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
"""Check for login."""
if not await self.coordinator.async_login():
raise IntegrationError("Failed to login to Garmin Connect, unable to update")
raise IntegrationError(
"Failed to login to Garmin Connect, unable to update")
"""Record a weigh in/body composition."""
await self.hass.async_add_executor_job(
@@ -319,7 +328,8 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
"""Check for login."""
if not await self.coordinator.async_login():
raise IntegrationError("Failed to login to Garmin Connect, unable to update")
raise IntegrationError(
"Failed to login to Garmin Connect, unable to update")
"""Record a blood pressure measurement."""
await self.hass.async_add_executor_job(
@@ -380,8 +390,9 @@ class GarminConnectGearSensor(CoordinatorEntity, SensorEntity):
gear = self._gear()
stats = self._stats()
gear_defaults = self._gear_defaults()
activity_types = self.coordinator.data["activity_types"]
default_for_activity = self._activity_names_for_gear_defaults(gear_defaults, activity_types)
activity_types = self.coordinator.data["activityTypes"]
default_for_activity = self._activity_names_for_gear_defaults(
gear_defaults, activity_types)
if not self.coordinator.data or not gear or not stats:
return {}
@@ -432,7 +443,7 @@ class GarminConnectGearSensor(CoordinatorEntity, SensorEntity):
def _stats(self):
"""Get gear statistics from garmin"""
for gear_stats_item in self.coordinator.data["gear_stats"]:
for gear_stats_item in self.coordinator.data["gearStats"]:
if gear_stats_item[Gear.UUID] == self._uuid:
return gear_stats_item
@@ -447,7 +458,7 @@ class GarminConnectGearSensor(CoordinatorEntity, SensorEntity):
return list(
filter(
lambda d: d[Gear.UUID] == self.uuid and d["defaultGear"] is True,
self.coordinator.data["gear_defaults"],
self.coordinator.data["gearDefaults"],
)
)
@@ -458,13 +469,14 @@ class GarminConnectGearSensor(CoordinatorEntity, SensorEntity):
"""Check for login."""
if not await self.coordinator.async_login():
raise IntegrationError("Failed to login to Garmin Connect, unable to update")
raise IntegrationError(
"Failed to login to Garmin Connect, unable to update")
"""Update Garmin Gear settings."""
activity_type_id = next(
filter(
lambda a: a[Gear.TYPE_KEY] == activity_type,
self.coordinator.data["activity_types"],
self.coordinator.data["activityTypes"],
)
)[Gear.TYPE_ID]
if setting != ServiceSetting.ONLY_THIS_AS_DEFAULT:

View File

@@ -2,6 +2,14 @@ set_active_gear:
name: Set active gear for activity
description: Set active gear for activity.
fields:
entity_id:
name: entity
description: entity
required: true
selector:
entity:
integration: garmin_connect
device_class: garmin_gear
activity_type:
required: true
name: activity type
@@ -28,6 +36,11 @@ set_active_gear:
- set this as default, unset others
- set as default
- unset default
add_body_composition:
name: Adds updated body composition metrics
description: Adds updated body composition metrics.
fields:
entity_id:
name: entity
description: entity
@@ -35,12 +48,7 @@ set_active_gear:
selector:
entity:
integration: garmin_connect
device_class: garmin_gear
add_body_composition:
name: Adds updated body composition metrics
description: Adds updated body composition metrics.
fields:
device_class: weight
weight:
required: true
name: Weight
@@ -106,14 +114,6 @@ add_body_composition:
name: Visceral Fat Rating
description: Visceral Fat Rating
example: 10
entity_id:
name: entity
description: entity
required: true
selector:
entity:
integration: garmin_connect
device_class: weight
add_blood_pressure:
name: Adds updated blood pressure metrics
@@ -126,7 +126,7 @@ add_blood_pressure:
selector:
entity:
integration: garmin_connect
device_class: weight
device_class: min_heart_rate
systolic:
required: true
name: Systolic

View File

@@ -1,22 +1,37 @@
{
"config": {
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]"
"step": {
"user": {
"title": "Enter your Garmin Connect login information",
"data": {
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]"
}
},
"mfa": {
"title": "Enter your Garmin Connect MFA code",
"data": {
"mfa_code": "MFA code (6-digits)"
}
},
"reauth_confirm": {
"title": "[%key:component::garmin_connect::config::step::user::title%]",
"data": {
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]"
}
}
},
"error": {
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"too_many_requests": "Too many requests, retry later.",
"unknown": "[%key:common::config_flow::error::unknown%]"
"unknown": "[%key:common::config_flow::error::unknown%]",
"invalid_mfa_code": "Invalid MFA code"
},
"step": {
"user": {
"data": {
"password": "[%key:common::config_flow::data::password%]",
"username": "[%key:common::config_flow::data::username%]"
},
"description": "Enter your credentials."
}
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "[%key::common::config_flow::abort::already_configured_account%]"
},
"error": {
"cannot_connect": "Ha fallat la connexi\u00f3",
"invalid_auth": "Autenticaci\u00f3 inv\u00e0lida",
"too_many_requests": "Massa sol\u00b7licituds, torna-ho a intentar m\u00e9s tard.",
"unknown": "Error inesperat"
},
"step": {
"user": {
"data": {
"password": "Contrasenya",
"username": "Nom d'usuari"
},
"description": "Introdueix les teves credencials.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "\u00da\u010det je ji\u017e nastaven"
},
"error": {
"cannot_connect": "Nepoda\u0159ilo se p\u0159ipojit",
"invalid_auth": "Neplatn\u00e9 ov\u011b\u0159en\u00ed",
"too_many_requests": "P\u0159\u00edli\u0161 mnoho po\u017eadavk\u016f, opakujte to pozd\u011bji.",
"unknown": "Neo\u010dek\u00e1van\u00e1 chyba"
},
"step": {
"user": {
"data": {
"password": "Heslo",
"username": "U\u017eivatelsk\u00e9 jm\u00e9no"
},
"description": "Zadejte sv\u00e9 p\u0159ihla\u0161ovac\u00ed \u00fadaje.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Denne konto er allerede konfigureret."
},
"error": {
"cannot_connect": "Kunne ikke oprette forbindelse - pr\u00f8v igen.",
"invalid_auth": "Ugyldig godkendelse.",
"too_many_requests": "For mange anmodninger - pr\u00f8v igen senere.",
"unknown": "Uventet fejl."
},
"step": {
"user": {
"data": {
"password": "Adgangskode",
"username": "Brugernavn"
},
"description": "Indtast dine legitimationsoplysninger.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Dieses Konto ist bereits konfiguriert."
},
"error": {
"cannot_connect": "Verbindung fehlgeschlagen",
"invalid_auth": "Ung\u00fcltige Authentifizierung",
"too_many_requests": "Zu viele Anfragen, versuche es sp\u00e4ter erneut.",
"unknown": "Unerwarteter Fehler"
},
"step": {
"user": {
"data": {
"password": "Passwort",
"username": "Benutzername"
},
"description": "Geben Sie Ihre Zugangsdaten ein.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,5 +1,28 @@
{
"config": {
"step": {
"user": {
"title": "Enter your Garmin Connect credentials",
"data": {
"password": "Password",
"username": "Username"
},
"description": "Enter your credentials."
},
"mfa": {
"title": "Enter your Garmin Connect MFA code",
"data": {
"mfa_code": "MFA code (6-digits)"
}
},
"reauth_confirm": {
"title": "Enter your Garmin Connect credentials",
"data": {
"password": "Password",
"username": "Username"
}
}
},
"abort": {
"already_configured": "Account is already configured"
},
@@ -8,15 +31,6 @@
"invalid_auth": "Invalid authentication",
"too_many_requests": "Too many requests, retry later.",
"unknown": "Unexpected error"
},
"step": {
"user": {
"data": {
"password": "Password",
"username": "Username"
},
"description": "Enter your credentials."
}
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Esta cuenta ya est\u00e1 configurada."
},
"error": {
"cannot_connect": "No se pudo conectar, intente nuevamente.",
"invalid_auth": "Autenticaci\u00f3n inv\u00e1lida",
"too_many_requests": "Demasiadas solicitudes, vuelva a intentarlo m\u00e1s tarde.",
"unknown": "Error inesperado."
},
"step": {
"user": {
"data": {
"password": "Contrase\u00f1a",
"username": "Nombre de usuario"
},
"description": "Ingrese sus credenciales.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "La cuenta ya ha sido configurada"
},
"error": {
"cannot_connect": "No se pudo conectar",
"invalid_auth": "Autenticaci\u00f3n no v\u00e1lida",
"too_many_requests": "Demasiadas solicitudes, vuelva a intentarlo m\u00e1s tarde.",
"unknown": "Error inesperado"
},
"step": {
"user": {
"data": {
"password": "Contrase\u00f1a",
"username": "Usuario"
},
"description": "Introduzca sus credenciales.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Konto on juba seadistatud"
},
"error": {
"cannot_connect": "\u00dchendamine nurjus",
"invalid_auth": "Tuvastamine nurjus",
"too_many_requests": "Liiga palju taotlusi, proovi hiljem uuesti.",
"unknown": "Tundmatu viga"
},
"step": {
"user": {
"data": {
"password": "Salas\u00f5na",
"username": "Kasutajanimi"
},
"description": "Sisesta oma mandaat.",
"title": ""
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Ce compte est d\u00e9j\u00e0 configur\u00e9."
},
"error": {
"cannot_connect": "Impossible de se connecter, veuillez r\u00e9essayer.",
"invalid_auth": "Authentification non valide.",
"too_many_requests": "Trop de demandes, r\u00e9essayez plus tard.",
"unknown": "Erreur inattendue."
},
"step": {
"user": {
"data": {
"password": "Mot de passe",
"username": "Nom d'utilisateur"
},
"description": "Entrez vos informations d'identification.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,21 +0,0 @@
{
"config": {
"abort": {
"already_configured": "\u05ea\u05e6\u05d5\u05e8\u05ea \u05d4\u05d7\u05e9\u05d1\u05d5\u05df \u05db\u05d1\u05e8 \u05e0\u05e7\u05d1\u05e2\u05d4"
},
"error": {
"cannot_connect": "\u05d4\u05d4\u05ea\u05d7\u05d1\u05e8\u05d5\u05ea \u05e0\u05db\u05e9\u05dc\u05d4",
"invalid_auth": "\u05d0\u05d9\u05de\u05d5\u05ea \u05dc\u05d0 \u05d7\u05d5\u05e7\u05d9",
"too_many_requests": "\u05d1\u05e7\u05e9\u05d5\u05ea \u05e8\u05d1\u05d5\u05ea \u05de\u05d3\u05d9, \u05e0\u05d0 \u05dc\u05e0\u05e1\u05d5\u05ea \u05e9\u05e0\u05d9\u05ea \u05de\u05d0\u05d5\u05d7\u05e8 \u05d9\u05d5\u05ea\u05e8.",
"unknown": "\u05e9\u05d2\u05d9\u05d0\u05d4 \u05d1\u05dc\u05ea\u05d9 \u05e6\u05e4\u05d5\u05d9\u05d4"
},
"step": {
"user": {
"data": {
"password": "\u05e1\u05d9\u05e1\u05de\u05d4",
"username": "\u05e9\u05dd \u05de\u05e9\u05ea\u05de\u05e9"
}
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "A fi\u00f3k m\u00e1r konfigur\u00e1lva van"
},
"error": {
"cannot_connect": "Sikertelen csatlakoz\u00e1s",
"invalid_auth": "\u00c9rv\u00e9nytelen hiteles\u00edt\u00e9s",
"too_many_requests": "T\u00fal sok k\u00e9r\u00e9s, pr\u00f3b\u00e1lkozzon k\u00e9s\u0151bb \u00fajra.",
"unknown": "V\u00e1ratlan hiba t\u00f6rt\u00e9nt"
},
"step": {
"user": {
"data": {
"password": "Jelsz\u00f3",
"username": "Felhaszn\u00e1l\u00f3n\u00e9v"
},
"description": "Adja meg a hiteles\u00edt\u0151 adatait.",
"title": "Garmin Csatlakoz\u00e1s"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Akun sudah dikonfigurasi"
},
"error": {
"cannot_connect": "Gagal terhubung",
"invalid_auth": "Autentikasi tidak valid",
"too_many_requests": "Terlalu banyak permintaan, coba lagi nanti.",
"unknown": "Kesalahan yang tidak diharapkan"
},
"step": {
"user": {
"data": {
"password": "Kata Sandi",
"username": "Nama Pengguna"
},
"description": "Masukkan kredensial Anda.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "L'account \u00e8 gi\u00e0 configurato"
},
"error": {
"cannot_connect": "Impossibile connettersi",
"invalid_auth": "Autenticazione non valida",
"too_many_requests": "Troppe richieste, riprovare pi\u00f9 tardi.",
"unknown": "Errore imprevisto"
},
"step": {
"user": {
"data": {
"password": "Password",
"username": "Nome utente"
},
"description": "Inserisci le tue credenziali",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "\uacc4\uc815\uc774 \uc774\ubbf8 \uad6c\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4"
},
"error": {
"cannot_connect": "\uc5f0\uacb0\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4",
"invalid_auth": "\uc778\uc99d\uc774 \uc798\ubabb\ub418\uc5c8\uc2b5\ub2c8\ub2e4",
"too_many_requests": "\uc694\uccad\uc774 \ub108\ubb34 \ub9ce\uc2b5\ub2c8\ub2e4. \ub098\uc911\uc5d0 \ub2e4\uc2dc \uc2dc\ub3c4\ud574\uc8fc\uc138\uc694.",
"unknown": "\uc608\uc0c1\uce58 \ubabb\ud55c \uc624\ub958\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4"
},
"step": {
"user": {
"data": {
"password": "\ube44\ubc00\ubc88\ud638",
"username": "\uc0ac\uc6a9\uc790 \uc774\ub984"
},
"description": "\uc790\uaca9 \uc99d\uba85\uc744 \uc785\ub825\ud574\uc8fc\uc138\uc694",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Kont ass scho konfigur\u00e9iert"
},
"error": {
"cannot_connect": "Feeler beim verbannen",
"invalid_auth": "Ong\u00eblteg Authentifikatioun",
"too_many_requests": "Ze vill Ufroen, prob\u00e9iert sp\u00e9ider nach emol.",
"unknown": "Onerwaarte Feeler"
},
"step": {
"user": {
"data": {
"password": "Passwuert",
"username": "Benotzernumm"
},
"description": "F\u00ebllt \u00e4r Umeldungs Informatiounen aus.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,12 +0,0 @@
{
"config": {
"step": {
"user": {
"data": {
"password": "Parole",
"username": "Lietot\u0101jv\u0101rds"
}
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Account is al geconfigureerd"
},
"error": {
"cannot_connect": "Kan geen verbinding maken",
"invalid_auth": "Ongeldige authenticatie",
"too_many_requests": "Te veel aanvragen, probeer het later opnieuw.",
"unknown": "Onverwachte fout"
},
"step": {
"user": {
"data": {
"password": "Wachtwoord",
"username": "Gebruikersnaam"
},
"description": "Voer uw gegevens in",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Kontoen er allerede konfigurert"
},
"error": {
"cannot_connect": "Tilkobling mislyktes",
"invalid_auth": "Ugyldig godkjenning",
"too_many_requests": "For mange foresp\u00f8rsler, pr\u00f8v p\u00e5 nytt senere.",
"unknown": "Uventet feil"
},
"step": {
"user": {
"data": {
"password": "Passord",
"username": "Brukernavn"
},
"description": "Fyll inn legitimasjonen din.",
"title": ""
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Konto jest ju\u017c skonfigurowane"
},
"error": {
"cannot_connect": "Nie mo\u017cna nawi\u0105za\u0107 po\u0142\u0105czenia",
"invalid_auth": "Niepoprawne uwierzytelnienie",
"too_many_requests": "Zbyt wiele \u017c\u0105da\u0144, spr\u00f3buj ponownie p\u00f3\u017aniej",
"unknown": "Nieoczekiwany b\u0142\u0105d"
},
"step": {
"user": {
"data": {
"password": "Has\u0142o",
"username": "Nazwa u\u017cytkownika"
},
"description": "Wprowad\u017a dane uwierzytelniaj\u0105ce",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,10 +0,0 @@
{
"config": {
"step": {
"user": {
"description": "Digite suas credenciais.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,22 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Conta j\u00e1 configurada"
},
"error": {
"cannot_connect": "Falha na liga\u00e7\u00e3o",
"invalid_auth": "Autentica\u00e7\u00e3o inv\u00e1lida",
"unknown": "Erro desconhecido"
},
"step": {
"user": {
"data": {
"password": "Palavra-passe",
"username": "Nome de Utilizador"
},
"description": "Introduza as suas credenciais.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "\u042d\u0442\u0430 \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 Home Assistant."
},
"error": {
"cannot_connect": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f.",
"invalid_auth": "\u041e\u0448\u0438\u0431\u043a\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.",
"too_many_requests": "\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.",
"unknown": "\u041d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430."
},
"step": {
"user": {
"data": {
"password": "\u041f\u0430\u0440\u043e\u043b\u044c",
"username": "\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f"
},
"description": "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0443\u0447\u0451\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Účet je už nakonfigurovaný"
},
"error": {
"cannot_connect": "Nepodarilo sa pripojiť",
"invalid_auth": "Neplatné overenie",
"too_many_requests": "Príliš veľa žiadostí, skúste to neskôr.",
"unknown": "Neočakávaná chyba"
},
"step": {
"user": {
"data": {
"password": "Heslo",
"username": "Užívateľské meno"
},
"description": "Zadajte svoje poverovacie údaje.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Ta ra\u010dun je \u017ee konfiguriran."
},
"error": {
"cannot_connect": "Povezava ni uspela, poskusite znova.",
"invalid_auth": "Neveljavna avtentikacija.",
"too_many_requests": "Preve\u010d zahtev, poskusite pozneje.",
"unknown": "Nepri\u010dakovana napaka."
},
"step": {
"user": {
"data": {
"password": "Geslo",
"username": "Uporabni\u0161ko ime"
},
"description": "Vnesite svoje poverilnice.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Det h\u00e4r kontot har redan konfigurerats."
},
"error": {
"cannot_connect": "Kunde inte ansluta, var god f\u00f6rs\u00f6k igen.",
"invalid_auth": "Ogiltig autentisering.",
"too_many_requests": "F\u00f6r m\u00e5nga f\u00f6rfr\u00e5gningar, f\u00f6rs\u00f6k igen senare.",
"unknown": "Ov\u00e4ntat fel."
},
"step": {
"user": {
"data": {
"password": "L\u00f6senord",
"username": "Anv\u00e4ndarnamn"
},
"description": "Ange dina anv\u00e4ndaruppgifter.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,20 +0,0 @@
{
"config": {
"abort": {
"already_configured": "Hesap zaten yap\u0131land\u0131r\u0131lm\u0131\u015f"
},
"error": {
"cannot_connect": "Ba\u011flanma hatas\u0131",
"invalid_auth": "Ge\u00e7ersiz kimlik do\u011frulama",
"unknown": "Beklenmeyen hata"
},
"step": {
"user": {
"data": {
"password": "Parola",
"username": "Kullan\u0131c\u0131 Ad\u0131"
}
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "\u0426\u0435\u0439 \u043e\u0431\u043b\u0456\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0441 \u0432\u0436\u0435 \u0434\u043e\u0434\u0430\u043d\u043e \u0432 Home Assistant."
},
"error": {
"cannot_connect": "\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0456\u0434'\u0454\u0434\u043d\u0430\u0442\u0438\u0441\u044f",
"invalid_auth": "\u041d\u0435\u0432\u0456\u0440\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044f.",
"too_many_requests": "\u0417\u0430\u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0437\u0430\u043f\u0438\u0442\u0456\u0432, \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.",
"unknown": "\u041d\u0435\u043e\u0447\u0456\u043a\u0443\u0432\u0430\u043d\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430"
},
"step": {
"user": {
"data": {
"password": "\u041f\u0430\u0440\u043e\u043b\u044c",
"username": "\u0406\u043c'\u044f \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430"
},
"description": "\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0412\u0430\u0448\u0456 \u043e\u0431\u043b\u0456\u043a\u043e\u0432\u0456 \u0434\u0430\u043d\u0456.",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,11 +0,0 @@
{
"config": {
"step": {
"user": {
"data": {
"username": "\u7528\u6237\u540d"
}
}
}
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"already_configured": "\u5e33\u865f\u5df2\u7d93\u8a2d\u5b9a\u5b8c\u6210"
},
"error": {
"cannot_connect": "\u9023\u7dda\u5931\u6557",
"invalid_auth": "\u9a57\u8b49\u78bc\u7121\u6548",
"too_many_requests": "\u8acb\u6c42\u6b21\u6578\u904e\u591a\uff0c\u8acb\u7a0d\u5f8c\u91cd\u8a66\u3002",
"unknown": "\u672a\u9810\u671f\u932f\u8aa4"
},
"step": {
"user": {
"data": {
"password": "\u5bc6\u78bc",
"username": "\u4f7f\u7528\u8005\u540d\u7a31"
},
"description": "\u8f38\u5165\u6191\u8b49\u3002",
"title": "Garmin Connect"
}
}
}
}

View File

@@ -1,2 +1,2 @@
colorlog==6.9.0
setuptools==75.8.0
setuptools==75.8.0

View File

@@ -1,2 +1,2 @@
# homeassistant==2024.4.1
homeassistant==2025.1.2
homeassistant==2025.1.2

View File

@@ -4,5 +4,5 @@ isort==5.13.2
pre-commit==4.0.1
pre-commit-hooks==5.0.0
pyupgrade==3.19.1
ruff==0.7.2
ruff==0.9.2
vulture==2.14