Skip to content

Commit

Permalink
Merge pull request #104 from craibo/2023.5.0
Browse files Browse the repository at this point in the history
2023.5.0
  • Loading branch information
craibo authored May 7, 2023
2 parents 237785f + cde266d commit cff4d41
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions custom_components/ha_strava/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,14 @@ def __init__(
oauth_websession: config_entry_oauth2_flow.OAuth2Session,
event_factory: Callable,
host: str,
hass: HomeAssistant,
entry: ConfigEntry
hass: HomeAssistant
):
"""Init the view."""
self.oauth_websession = oauth_websession
self.event_factory = event_factory
self.webhook_id = None
self.host = host
self.hass = hass
self.entry = entry

async def fetch_strava_data(
self,
Expand Down Expand Up @@ -144,11 +142,9 @@ async def _fetch_activities(self) -> Tuple[str, list[dict]]:
_LOGGER.error(f"Activities Fetch Failed: {response.status}: {text}")
return

config_data = {
**self.entry.data,
}
config_entries = self.hass.config_entries.async_entries(domain=DOMAIN)
auth = config_entries.get(CONF_GEOCODE_XYZ_API_KEY, None)

auth = config_data.get(CONF_GEOCODE_XYZ_API_KEY, None)
if auth:
_LOGGER.debug("Geocode.xyz has API key")

Expand Down Expand Up @@ -713,8 +709,7 @@ def strava_update_event_factory(data, event_type=CONF_STRAVA_DATA_UPDATE_EVENT):
oauth_websession=oauth_websession,
event_factory=strava_update_event_factory,
host=get_url(hass, allow_internal=False, allow_ip=False),
hass=hass,
entry=entry
hass=hass
)

hass.http.register_view(strava_webhook_view)
Expand Down

0 comments on commit cff4d41

Please sign in to comment.