PyViCare 2.58.0__tar.gz → 2.58.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PKG-INFO +1 -1
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareAbstractOAuthManager.py +7 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareBrowserOAuthManager.py +9 -5
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareOAuthManager.py +8 -5
- {pyvicare-2.58.0 → pyvicare-2.58.1}/pyproject.toml +1 -1
- {pyvicare-2.58.0 → pyvicare-2.58.1}/LICENSE +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/Feature.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCare.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareCachedService.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareDevice.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareDeviceConfig.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareElectricalEnergySystem.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareFloorHeating.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareFuelCell.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareGateway.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareGazBoiler.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareHeatCurveCalculation.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareHeatPump.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareHeatingDevice.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareHybrid.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareOilBoiler.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCarePelletsBoiler.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareRadiatorActuator.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareRepeater.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareRoomSensor.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareService.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareUtils.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/PyViCareVentilationDevice.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/PyViCare/__init__.py +0 -0
- {pyvicare-2.58.0 → pyvicare-2.58.1}/README.md +0 -0
|
@@ -15,6 +15,13 @@ logger = logging.getLogger('ViCare')
|
|
|
15
15
|
logger.addHandler(logging.NullHandler())
|
|
16
16
|
|
|
17
17
|
API_BASE_URL = 'https://api.viessmann-climatesolutions.com/iot/v2'
|
|
18
|
+
AUTHORIZE_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/authorize'
|
|
19
|
+
TOKEN_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/token'
|
|
20
|
+
|
|
21
|
+
SCOPE_IOT = "IoT"
|
|
22
|
+
SCOPE_USER = "User"
|
|
23
|
+
SCOPE_OFFLINE_ACCESS = "offline_access"
|
|
24
|
+
SCOPE_INTERNAL = "internal"
|
|
18
25
|
|
|
19
26
|
|
|
20
27
|
class AbstractViCareOAuthManager:
|
|
@@ -7,17 +7,21 @@ from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
|
7
7
|
from authlib.common.security import generate_token
|
|
8
8
|
from authlib.integrations.requests_client import OAuth2Session
|
|
9
9
|
|
|
10
|
-
from PyViCare.PyViCareAbstractOAuthManager import
|
|
10
|
+
from PyViCare.PyViCareAbstractOAuthManager import (
|
|
11
|
+
AUTHORIZE_URL,
|
|
12
|
+
SCOPE_IOT,
|
|
13
|
+
SCOPE_OFFLINE_ACCESS,
|
|
14
|
+
SCOPE_USER,
|
|
15
|
+
TOKEN_URL,
|
|
16
|
+
AbstractViCareOAuthManager,
|
|
17
|
+
)
|
|
11
18
|
from PyViCare.PyViCareUtils import (PyViCareBrowserOAuthTimeoutReachedError,
|
|
12
19
|
PyViCareInvalidCredentialsError)
|
|
13
20
|
|
|
14
21
|
logger = logging.getLogger('ViCare')
|
|
15
22
|
logger.addHandler(logging.NullHandler())
|
|
16
23
|
|
|
17
|
-
AUTHORIZE_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/authorize'
|
|
18
|
-
TOKEN_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/token'
|
|
19
24
|
REDIRECT_PORT = 51125
|
|
20
|
-
VIESSMANN_SCOPE = ["IoT User", "offline_access"]
|
|
21
25
|
AUTH_TIMEOUT = 60 * 3
|
|
22
26
|
|
|
23
27
|
|
|
@@ -50,7 +54,7 @@ class ViCareBrowserOAuthManager(AbstractViCareOAuthManager):
|
|
|
50
54
|
def __execute_browser_authentication(self):
|
|
51
55
|
redirect_uri = f"http://localhost:{REDIRECT_PORT}"
|
|
52
56
|
oauth_session = OAuth2Session(
|
|
53
|
-
self.client_id, redirect_uri=redirect_uri, scope=
|
|
57
|
+
self.client_id, redirect_uri=redirect_uri, scope=[SCOPE_IOT, SCOPE_USER, SCOPE_OFFLINE_ACCESS], code_challenge_method='S256')
|
|
54
58
|
code_verifier = generate_token(48)
|
|
55
59
|
authorization_url, _ = oauth_session.create_authorization_url(AUTHORIZE_URL, code_verifier=code_verifier)
|
|
56
60
|
|
|
@@ -8,17 +8,20 @@ import requests
|
|
|
8
8
|
from authlib.common.security import generate_token
|
|
9
9
|
from authlib.integrations.requests_client import OAuth2Session
|
|
10
10
|
|
|
11
|
-
from PyViCare.PyViCareAbstractOAuthManager import
|
|
11
|
+
from PyViCare.PyViCareAbstractOAuthManager import (
|
|
12
|
+
AUTHORIZE_URL,
|
|
13
|
+
SCOPE_IOT,
|
|
14
|
+
SCOPE_USER,
|
|
15
|
+
TOKEN_URL,
|
|
16
|
+
AbstractViCareOAuthManager,
|
|
17
|
+
)
|
|
12
18
|
from PyViCare.PyViCareUtils import (PyViCareInvalidConfigurationError,
|
|
13
19
|
PyViCareInvalidCredentialsError)
|
|
14
20
|
|
|
15
21
|
logger = logging.getLogger('ViCare')
|
|
16
22
|
logger.addHandler(logging.NullHandler())
|
|
17
23
|
|
|
18
|
-
AUTHORIZE_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/authorize'
|
|
19
|
-
TOKEN_URL = 'https://iam.viessmann-climatesolutions.com/idp/v3/token'
|
|
20
24
|
REDIRECT_URI = "vicare://oauth-callback/everest"
|
|
21
|
-
VIESSMANN_SCOPE = ["IoT User"]
|
|
22
25
|
|
|
23
26
|
|
|
24
27
|
class ViCareOAuthManager(AbstractViCareOAuthManager):
|
|
@@ -55,7 +58,7 @@ class ViCareOAuthManager(AbstractViCareOAuthManager):
|
|
|
55
58
|
oauth sessions object
|
|
56
59
|
"""
|
|
57
60
|
oauth_session = OAuth2Session(
|
|
58
|
-
self.client_id, redirect_uri=REDIRECT_URI, scope=
|
|
61
|
+
self.client_id, redirect_uri=REDIRECT_URI, scope=[SCOPE_IOT, SCOPE_USER], code_challenge_method='S256')
|
|
59
62
|
code_verifier = generate_token(48)
|
|
60
63
|
authorization_url, _ = oauth_session.create_authorization_url(AUTHORIZE_URL, code_verifier=code_verifier)
|
|
61
64
|
logger.debug("Auth URL is: %s", authorization_url)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|