mirror of
https://github.com/cyberjunky/home-assistant-garmin_connect.git
synced 2026-01-09 12:57:58 -05:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0074b94723 | ||
|
|
ee777314f9 | ||
|
|
58f5dd49db | ||
|
|
7b66c4b7be | ||
|
|
1aa8cfb78f | ||
|
|
a29be3127e | ||
|
|
ef91580157 | ||
|
|
1c3e5a4385 | ||
|
|
b6aebe1637 |
@@ -37,7 +37,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
DATA_COORDINATOR: coordinator,
|
||||
}
|
||||
|
||||
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
"codeowners": ["@cyberjunky"],
|
||||
"config_flow": true,
|
||||
"iot_class": "cloud_polling",
|
||||
"version": "0.2.8"
|
||||
"version": "0.2.11"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
import logging
|
||||
import datetime
|
||||
import pytz
|
||||
from tzlocal import get_localzone
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
SensorEntity,
|
||||
@@ -118,7 +119,8 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
|
||||
)
|
||||
if active_alarms:
|
||||
date_time_obj = datetime.datetime.strptime(active_alarms[0], "%Y-%m-%dT%H:%M:%S")
|
||||
timezone = pytz.timezone('UTC')
|
||||
tz = get_localzone()
|
||||
timezone = pytz.timezone(tz.zone)
|
||||
timezone_date_time_obj = timezone.localize(date_time_obj)
|
||||
return timezone_date_time_obj
|
||||
else:
|
||||
@@ -128,7 +130,8 @@ class GarminConnectSensor(CoordinatorEntity, SensorEntity):
|
||||
|
||||
if self._device_class == SensorDeviceClass.TIMESTAMP:
|
||||
date_time_obj = datetime.datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f")
|
||||
timezone = pytz.timezone('UTC')
|
||||
tz = get_localzone()
|
||||
timezone = pytz.timezone(tz.zone)
|
||||
timezone_date_time_obj = timezone.localize(date_time_obj)
|
||||
return timezone_date_time_obj
|
||||
|
||||
|
||||
23
custom_components/garmin_connect/translations/sk.json
Normal file
23
custom_components/garmin_connect/translations/sk.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"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 poverenia.",
|
||||
"title": "Garmin Connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user