mirror of
https://github.com/cyberjunky/home-assistant-garmin_connect.git
synced 2026-01-07 20:13:57 -05:00
Fixed deprecations issue
This commit is contained in:
@@ -196,8 +196,13 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
|
||||
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,
|
||||
config_entry=entry,
|
||||
)
|
||||
|
||||
async def async_login(self) -> bool:
|
||||
"""
|
||||
@@ -403,7 +408,8 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
)
|
||||
_LOGGER.debug("Gear data fetched: %s", gear)
|
||||
else:
|
||||
_LOGGER.debug("No userProfileId found in summary, skipping gear data fetch")
|
||||
_LOGGER.debug(
|
||||
"No userProfileId found in summary, skipping gear data fetch")
|
||||
|
||||
# Fitness age data
|
||||
fitnessage_data = await self.hass.async_add_executor_job(
|
||||
@@ -461,7 +467,8 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
]
|
||||
gear_stats = await asyncio.gather(*tasks)
|
||||
if gear_stats:
|
||||
_LOGGER.debug("Gear statistics data fetched: %s", gear_stats)
|
||||
_LOGGER.debug(
|
||||
"Gear statistics data fetched: %s", gear_stats)
|
||||
else:
|
||||
_LOGGER.debug("No gear statistics data found")
|
||||
|
||||
@@ -471,15 +478,16 @@ class GarminConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
self.api.get_gear_defaults, summary[Gear.USERPROFILE_ID]
|
||||
)
|
||||
if gear_defaults:
|
||||
_LOGGER.debug("Gear defaults data fetched: %s", gear_defaults)
|
||||
_LOGGER.debug(
|
||||
"Gear defaults data fetched: %s", gear_defaults)
|
||||
else:
|
||||
_LOGGER.debug("No gear defaults data found")
|
||||
else:
|
||||
_LOGGER.debug("No userProfileId found in summary, skipping gear defaults fetch")
|
||||
_LOGGER.debug(
|
||||
"No userProfileId found in summary, skipping gear defaults fetch")
|
||||
else:
|
||||
_LOGGER.debug("No gear data available, skipping gear stats and defaults fetch")
|
||||
else:
|
||||
_LOGGER.debug("No gear defaults data found")
|
||||
_LOGGER.debug(
|
||||
"No gear data available, skipping gear stats and defaults fetch")
|
||||
except GarminConnectAuthenticationError as err:
|
||||
_LOGGER.error(
|
||||
"Authentication error occurred while fetching Gear data: %s", err.response.text
|
||||
|
||||
@@ -224,10 +224,6 @@ class GarminConnectConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
class GarminConnectOptionsFlowHandler(OptionsFlow):
|
||||
"""Handle options flow for Garmin Connect integration."""
|
||||
|
||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||
"""Initialize options flow."""
|
||||
self.config_entry = config_entry
|
||||
|
||||
async def async_step_init(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
|
||||
@@ -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.31"],
|
||||
"version": "0.2.35"
|
||||
"requirements": ["garminconnect>=0.2.33"],
|
||||
"version": "0.2.39-beta-01"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user