Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base_url property is deprecated #6

Open
MateEke opened this issue May 22, 2020 · 5 comments
Open

base_url property is deprecated #6

MateEke opened this issue May 22, 2020 · 5 comments

Comments

@MateEke
Copy link

MateEke commented May 22, 2020

0.110 Rel notes

@burnnat
Copy link
Owner

burnnat commented May 22, 2020

Thanks, I had seen the note but haven't yet upgraded to 0.110 for testing. Will get this updated shortly 👍

@davedan
Copy link

davedan commented Jul 14, 2020

I think it's related. When I try to configure this integration, once the configuration is added to the configuration.yaml, it's discovered in the integrations page. When I click for configuration I get the following error:
Ups, something went wrong, try again later.

Checking the URL I see is actually using my local URL in the redirect_uri:
https://flow.polar.com/oauth2/authorization?client_id=<client_id>&response_type=code&state=&redirect_uri=http%3A%2F%2F<local_ip>%3A8123%2Fapi%2Fpolar_auth

instead of using the External URL.

I'm running Home Assistant 0.112.4 (installation_type | Home Assistant Supervised )

hope this helps.

@tomecki88
Copy link

Hi @burnnat,
hass also reporting this in logs:

Logger: homeassistant.components.http
Source: components/http/__init__.py:180
Integration: HTTP (documentation, issues)
First occurred: 9:46:07 (4 occurrences)
Last logged: 9:52:38

Detected use of deprecated `base_url` property, use `homeassistant.helpers.network.get_url` method instead. Please report issue to the custom component author for polar using this method at custom_components/polar/config_flow.py, line 26: callback_url = f"{hass.config.api.base_url}{AUTH_CALLBACK_PATH}"

@joopy
Copy link

joopy commented Nov 10, 2020

Any update on this? Would love to test Polar integration in Home assistant.

@Aohzan
Copy link

Aohzan commented Jan 20, 2021

you can replace the line
callback_url = f"{hass.config.api.base_url}{AUTH_CALLBACK_PATH}"
by
callback_url = f"{hass.config.external_url}{AUTH_CALLBACK_PATH}"

the authentication will work, but all my sensors stays in Unknown state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants