-
Notifications
You must be signed in to change notification settings - Fork 1
OAuth support for MFA #3
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: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Olivier Mehani <[email protected]>
Signed-off-by: Olivier Mehani <[email protected]>
Signed-off-by: Olivier Mehani <[email protected]>
Signed-off-by: Olivier Mehani <[email protected]>
Signed-off-by: Olivier Mehani <[email protected]>
This is the new way, needed to support MFA Signed-off-by: Olivier Mehani <[email protected]>
Maintain backward compatibility
Signed-off-by: Olivier Mehani <[email protected]>
Signed-off-by: Olivier Mehani <[email protected]>
I've re-added a layer of backward compat: if giving an empty username and just the access token string as the password (e.g., in HomeAssistant config), it may just work without code changes. I also added and documented a methods to issue a new token. tl;dr:
Follow the URL above in a browser to authenticate with username+password and
The @slothking87, wanna give this a go? |
Yep - I'll give it a go later tonight |
Hmmmm - Im probably missing a step here somewhere. Visiting that link just gives me a "sorry, but we are having trouble signing you in" message. 2023-11-24 19:30:20.040 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up auroraplus platform for sensor |
Ah, no, I meant try the lib itself. There still is some work needed to make the HA integration take it.
--
Olivier Mehani ***@***.***>
Sent from my mobile, please excuse my brevity.
|
See if you can authenticate as per the readme.md, and get some data out in a Python console.
--
Olivier Mehani ***@***.***>
Sent from my mobile, please excuse my brevity.
|
Document authentication flow in readme and docstring
I just had a play with it and it's working for me. Thanks a lot for fixing! |
Looks like there is a problem when upgrading HA to 2024.1.2 - I get an error that the minimum version is 2023.6.0 Rolling back now - but just flagging it as something that might need looking at |
Did you get the full error message?
--
Olivier Mehani ***@***.***>
Sent from my mobile, please excuse my brevity.
|
I did now - breaks with an upgrade, but fine after a downgrade Traceback (most recent call last): and Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): and a kind little note STATE_CLASS_TOTAL was used from auroraplus, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL instead, please create a bug report at https://github.com/LeighCurran/AuroraPlusHA/issues |
Hum, I think this error is better followed up on https://github.com/LeighCurran/AuroraPlusHA#9, as it's to do with the HA integration, not the underlying lib. |
Fixes Traceback (most recent call last): File /usr/src/homeassistant/homeassistant/loader.py, line 842, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File /usr/src/homeassistant/homeassistant/loader.py, line 859, in _import_platform return importlib.import_module(f{self.pkg_path}.{platform_name}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File /usr/local/lib/python3.11/importlib/init.py, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File , line 1204, in _gcd_import File , line 1176, in _find_and_load File , line 1147, in _find_and_load_unlocked File , line 690, in _load_unlocked File , line 940, in exec_module File , line 241, in _call_with_frames_removed File /config/custom_components/auroraplus/sensor.py, line 39, in from homeassistant_historical_sensor import ( File /usr/local/lib/python3.11/site-packages/homeassistant_historical_sensor/init.py, line 39, in raise SystemError(msg) SystemError: Running HomeAssistant 2024.1.2, Minimum required version >=2023.6.0 See [0], [1] [0] ldotlopez/ha-historical-sensor#12 [1] https://github.com/LeighCurran/AuroraPlus/pull/3\#issuecomment-1884213483 Signed-off-by: Olivier Mehani <[email protected]>
Signed-off-by: Olivier Mehani <[email protected]>
Actually add the token-getting script...
Signed-off-by: Olivier Mehani <[email protected]>
This will fix #2, and is built on top of #1.
This is a breaking change in the API (replacingIt's now backward-compatible.gettoken
withget_info
), so likely will require something like a new major version.The token can be provided on
init
, e.g.,or fetched semi-interactively (wip).