pysmarlaapi 0.2.3__tar.gz → 0.3.0__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.
Potentially problematic release.
This version of pysmarlaapi might be problematic. Click here for more details.
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/PKG-INFO +3 -2
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pyproject.toml +2 -1
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/__init__.py +1 -1
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/classes/auth_token.py +9 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/classes/connection.py +3 -1
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/tests/test.py +3 -3
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/.gitignore +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/.pre-commit-config.yaml +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/.pypirc +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/.vscode/launch.json +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/.vscode/settings.json +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/README.md +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/classes/__init__.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/connection_hub/__init__.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/__init__.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/classes/__init__.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/classes/property.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/classes/service.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/services/__init__.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/services/analyser_service.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/services/babywiege_service.py +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/requirements.txt +0 -0
- {pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/requirements_dev.txt +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pysmarlaapi
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Swing2Sleep Smarla API
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Swing2Sleep Smarla API
|
|
5
5
|
Author-email: Robin Lintermann <robin.lintermann@explicatis.com>
|
|
6
6
|
Requires-Python: >=3.11.9
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
9
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
12
|
Requires-Dist: aiohttp~=3.11.11
|
|
@@ -12,10 +12,11 @@ dependencies = [
|
|
|
12
12
|
"jsonpickle~=4.0.0",
|
|
13
13
|
"pysignalr~=1.1.0",
|
|
14
14
|
]
|
|
15
|
-
description = "Swing2Sleep Smarla API
|
|
15
|
+
description = "Swing2Sleep Smarla API"
|
|
16
16
|
readme = "README.md"
|
|
17
17
|
classifiers = [
|
|
18
18
|
"Development Status :: 3 - Alpha",
|
|
19
|
+
"License :: OSI Approved :: Apache Software License",
|
|
19
20
|
"Programming Language :: Python :: 3.11",
|
|
20
21
|
"Programming Language :: Python :: 3.12"
|
|
21
22
|
]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import base64
|
|
1
2
|
from dataclasses import dataclass
|
|
2
3
|
from typing import Self
|
|
3
4
|
|
|
@@ -23,5 +24,13 @@ class AuthToken:
|
|
|
23
24
|
def from_string(cls, value) -> Self:
|
|
24
25
|
return AuthToken.from_json(jsonpickle.decode(value))
|
|
25
26
|
|
|
27
|
+
@classmethod
|
|
28
|
+
def from_base64(cls, value) -> Self:
|
|
29
|
+
token = base64.b64decode(value.encode()).decode()
|
|
30
|
+
return AuthToken.from_string(token)
|
|
31
|
+
|
|
26
32
|
def get_string(self) -> str:
|
|
27
33
|
return jsonpickle.encode(self, unpicklable=False)
|
|
34
|
+
|
|
35
|
+
def get_base64(self) -> str:
|
|
36
|
+
return base64.b64encode(self.get_string().encode()).decode()
|
|
@@ -6,7 +6,7 @@ from . import AuthToken
|
|
|
6
6
|
|
|
7
7
|
class Connection:
|
|
8
8
|
|
|
9
|
-
def __init__(self, url: str, token: AuthToken = None, token_str=None, token_json=None):
|
|
9
|
+
def __init__(self, url: str, token: AuthToken = None, token_str=None, token_json=None, token_b64=None):
|
|
10
10
|
self.url = url
|
|
11
11
|
if token is not None:
|
|
12
12
|
self.token = token
|
|
@@ -14,6 +14,8 @@ class Connection:
|
|
|
14
14
|
self.token = AuthToken.from_json(token_json)
|
|
15
15
|
elif token_str is not None:
|
|
16
16
|
self.token = AuthToken.from_string(token_str)
|
|
17
|
+
elif token_b64 is not None:
|
|
18
|
+
self.token = AuthToken.from_base64(token_b64)
|
|
17
19
|
else:
|
|
18
20
|
self.token = None
|
|
19
21
|
|
|
@@ -10,15 +10,15 @@ logging.basicConfig(level=20)
|
|
|
10
10
|
from pysmarlaapi import Connection, Federwiege
|
|
11
11
|
|
|
12
12
|
try:
|
|
13
|
-
from config import
|
|
13
|
+
from config import AUTH_TOKEN_B64, HOST
|
|
14
14
|
except ImportError:
|
|
15
15
|
print("config.py or mandatory variables missing, please add in root folder...")
|
|
16
|
-
exit()
|
|
16
|
+
sys.exit()
|
|
17
17
|
|
|
18
18
|
loop = asyncio.get_event_loop()
|
|
19
19
|
async_thread = threading.Thread(target=loop.run_forever)
|
|
20
20
|
|
|
21
|
-
connection = Connection(url=HOST,
|
|
21
|
+
connection = Connection(url=HOST, token_b64=AUTH_TOKEN_B64)
|
|
22
22
|
|
|
23
23
|
federwiege = Federwiege(loop, connection)
|
|
24
24
|
|
|
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
|
{pysmarlaapi-0.2.3 → pysmarlaapi-0.3.0}/pysmarlaapi/federwiege/services/babywiege_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|