pysmarlaapi 0.2.0__tar.gz → 0.2.2__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.

Files changed (27) hide show
  1. pysmarlaapi-0.2.2/PKG-INFO +27 -0
  2. pysmarlaapi-0.2.2/README.md +12 -0
  3. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pyproject.toml +3 -3
  4. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/__init__.py +1 -1
  5. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/classes/connection.py +1 -6
  6. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/connection_hub/__init__.py +2 -1
  7. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/federwiege/__init__.py +3 -2
  8. pysmarlaapi-0.2.2/requirements.txt +3 -0
  9. pysmarlaapi-0.2.2/requirements_dev.txt +5 -0
  10. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/tests/test.py +4 -2
  11. pysmarlaapi-0.2.0/PKG-INFO +0 -29
  12. pysmarlaapi-0.2.0/README.md +0 -14
  13. pysmarlaapi-0.2.0/requirements.txt +0 -3
  14. pysmarlaapi-0.2.0/requirements_dev.txt +0 -5
  15. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/.gitignore +0 -0
  16. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/.pre-commit-config.yaml +0 -0
  17. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/.pypirc +0 -0
  18. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/.vscode/launch.json +0 -0
  19. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/.vscode/settings.json +0 -0
  20. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/classes/__init__.py +0 -0
  21. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/classes/auth_token.py +0 -0
  22. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/federwiege/classes/__init__.py +0 -0
  23. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/federwiege/classes/property.py +0 -0
  24. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/federwiege/classes/service.py +0 -0
  25. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/federwiege/services/__init__.py +0 -0
  26. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/federwiege/services/analyser_service.py +0 -0
  27. {pysmarlaapi-0.2.0 → pysmarlaapi-0.2.2}/pysmarlaapi/federwiege/services/babywiege_service.py +0 -0
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.3
2
+ Name: pysmarlaapi
3
+ Version: 0.2.2
4
+ Summary: Swing2Sleep Smarla API via websocket with signalr protocol
5
+ Author-email: Robin Lintermann <robin.lintermann@explicatis.com>
6
+ Requires-Python: >=3.11.9
7
+ Description-Content-Type: text/markdown
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Requires-Dist: aiohttp~=3.11.11
12
+ Requires-Dist: jsonpickle~=4.0.0
13
+ Requires-Dist: pysignalr~=1.1.0
14
+
15
+ # pysmarlaapi
16
+ A python library providing an API for Swing2Sleep Smarla.
17
+
18
+ This library will let you control your Swing2Sleep Smarla device.
19
+
20
+ It requires the firmware of the Smarla device to be version 1.6.X or newer. Otherwise you cannot properly connect/pair to your device.
21
+
22
+ ## Library usage
23
+ Install pysmarlaapi using pip
24
+
25
+ ### Example usage
26
+ Please refer to the examples provided in the repository.
27
+
@@ -0,0 +1,12 @@
1
+ # pysmarlaapi
2
+ A python library providing an API for Swing2Sleep Smarla.
3
+
4
+ This library will let you control your Swing2Sleep Smarla device.
5
+
6
+ It requires the firmware of the Smarla device to be version 1.6.X or newer. Otherwise you cannot properly connect/pair to your device.
7
+
8
+ ## Library usage
9
+ Install pysmarlaapi using pip
10
+
11
+ ### Example usage
12
+ Please refer to the examples provided in the repository.
@@ -15,9 +15,9 @@ dependencies = [
15
15
  description = "Swing2Sleep Smarla API via websocket with signalr protocol"
16
16
  readme = "README.md"
17
17
  classifiers = [
18
- "Development Status :: 1 - Planning",
19
- "Programming Language :: Python :: 3 :: Only",
20
- "Programming Language :: Python :: 3.11"
18
+ "Development Status :: 3 - Alpha",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12"
21
21
  ]
22
22
  requires-python = ">=3.11.9"
23
23
  dynamic = ["version"]
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.0"
1
+ __version__ = "0.2.2"
2
2
 
3
3
  from .classes import Connection
4
4
  from .federwiege import Federwiege
@@ -1,5 +1,3 @@
1
- import asyncio
2
-
3
1
  import aiohttp
4
2
  import jsonpickle
5
3
 
@@ -8,10 +6,7 @@ from . import AuthToken
8
6
 
9
7
  class Connection:
10
8
 
11
- def __init__(
12
- self, event_loop: asyncio.AbstractEventLoop, url: str, token: AuthToken = None, token_str=None, token_json=None
13
- ):
14
- self.event_loop = event_loop
9
+ def __init__(self, url: str, token: AuthToken = None, token_str=None, token_json=None):
15
10
  self.url = url
16
11
  if token is not None:
17
12
  self.token = token
@@ -31,12 +31,13 @@ class ConnectionHub:
31
31
 
32
32
  def __init__(
33
33
  self,
34
+ event_loop: asyncio.AbstractEventLoop,
34
35
  connection: Connection,
35
36
  interval: int = 60,
36
37
  backoff: int = 300,
37
38
  ):
38
39
  self.connection: Connection = connection
39
- self._loop: asyncio.AbstractEventLoop = self.connection.event_loop
40
+ self._loop = event_loop
40
41
  self._interval = interval
41
42
  self._backoff = backoff
42
43
 
@@ -1,3 +1,4 @@
1
+ import asyncio
1
2
  import threading
2
3
 
3
4
  from ..classes import Connection
@@ -21,9 +22,9 @@ class Federwiege:
21
22
  if value:
22
23
  self.sync()
23
24
 
24
- def __init__(self, connection: Connection):
25
+ def __init__(self, event_loop: asyncio.AbstractEventLoop, connection: Connection):
25
26
  self.serial_number = connection.token.serialNumber
26
- self.hub = ConnectionHub(connection)
27
+ self.hub = ConnectionHub(event_loop, connection)
27
28
  self.services: dict[str, Service] = {
28
29
  "babywiege": BabywiegeService(self.hub),
29
30
  "analyser": AnalyserService(self.hub),
@@ -0,0 +1,3 @@
1
+ aiohttp~=3.11.11
2
+ jsonpickle~=4.0.0
3
+ pysignalr~=1.1.0
@@ -0,0 +1,5 @@
1
+ aiohttp~=3.11.11
2
+ flit~=3.10.1
3
+ jsonpickle~=4.0.0
4
+ pre-commit~=4.0.1
5
+ pysignalr~=1.1.0
@@ -18,9 +18,9 @@ except ImportError:
18
18
  loop = asyncio.get_event_loop()
19
19
  async_thread = threading.Thread(target=loop.run_forever)
20
20
 
21
- connection = Connection(loop, url=HOST, token_json=AUTH_TOKEN_PERSONAL)
21
+ connection = Connection(url=HOST, token_json=AUTH_TOKEN_PERSONAL)
22
22
 
23
- federwiege = Federwiege(connection)
23
+ federwiege = Federwiege(loop, connection)
24
24
 
25
25
 
26
26
  def main():
@@ -74,4 +74,6 @@ if __name__ == "__main__":
74
74
  except BaseException:
75
75
  pass
76
76
  federwiege.disconnect()
77
+ while federwiege.connected:
78
+ time.sleep(1)
77
79
  loop.call_soon_threadsafe(loop.stop)
@@ -1,29 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: pysmarlaapi
3
- Version: 0.2.0
4
- Summary: Swing2Sleep Smarla API via websocket with signalr protocol
5
- Author-email: Robin Lintermann <robin.lintermann@explicatis.com>
6
- Requires-Python: >=3.11.9
7
- Description-Content-Type: text/markdown
8
- Classifier: Development Status :: 1 - Planning
9
- Classifier: Programming Language :: Python :: 3 :: Only
10
- Classifier: Programming Language :: Python :: 3.11
11
- Requires-Dist: aiohttp~=3.11.11
12
- Requires-Dist: jsonpickle~=4.0.0
13
- Requires-Dist: pysignalr~=1.1.0
14
-
15
- # Federwiege Python API
16
-
17
- Swing2Sleep Smarla API via websocket with signalr protocol.
18
-
19
- See tests for example usage.
20
-
21
- ## Development Setup
22
-
23
- - `pip3 install -r requirements_dev.txt`
24
- - `pre-commit install`
25
-
26
- ## Publishing
27
-
28
- - Use flit to publish package to pypi
29
-
@@ -1,14 +0,0 @@
1
- # Federwiege Python API
2
-
3
- Swing2Sleep Smarla API via websocket with signalr protocol.
4
-
5
- See tests for example usage.
6
-
7
- ## Development Setup
8
-
9
- - `pip3 install -r requirements_dev.txt`
10
- - `pre-commit install`
11
-
12
- ## Publishing
13
-
14
- - Use flit to publish package to pypi
@@ -1,3 +0,0 @@
1
- aiohttp==3.11.11
2
- jsonpickle==4.0.0
3
- pysignalr==1.1.0
@@ -1,5 +0,0 @@
1
- aiohttp==3.11.11
2
- flit==3.10.1
3
- jsonpickle==4.0.0
4
- pre-commit==4.0.1
5
- pysignalr==1.1.0
File without changes
File without changes