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