pysmarlaapi 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.0"
1
+ __version__ = "0.2.1"
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),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pysmarlaapi
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Swing2Sleep Smarla API via websocket with signalr protocol
5
5
  Author-email: Robin Lintermann <robin.lintermann@explicatis.com>
6
6
  Requires-Python: >=3.11.9
@@ -1,15 +1,15 @@
1
- pysmarlaapi/__init__.py,sha256=i45rOL2uYBjAHltN282RAZVC16RoTLHoGGdHZbZfMlY,94
1
+ pysmarlaapi/__init__.py,sha256=bHJSpTFoTKf3KeNsCiFVLdNERSeIBY6Ly5PTLHudnVQ,94
2
2
  pysmarlaapi/classes/__init__.py,sha256=4F4LRzLQtj6AmzrXn74iHEZl-YElpMkb7MhEGkab504,71
3
3
  pysmarlaapi/classes/auth_token.py,sha256=FgLkZ0xPETfh1ZMQfWhwW6tkPnqFYeHhDUBLBFbauwA,663
4
- pysmarlaapi/classes/connection.py,sha256=tjcSmuUgCns0YRCB0WxFLtMYQujDInIlQs0FyigUO1k,1402
5
- pysmarlaapi/connection_hub/__init__.py,sha256=h20zSrb60nmiKC-oR91mkQal1yZbNko6IVTslDBppNg,4595
6
- pysmarlaapi/federwiege/__init__.py,sha256=YfhO-Vg25e_dbUrMJUhTEloFtwLyoRPyw2Af8h66mU0,1676
4
+ pysmarlaapi/classes/connection.py,sha256=vNh9vG4xAewl2gmkducwSd3u7osjYw5gwtZTZ48rqVo,1291
5
+ pysmarlaapi/connection_hub/__init__.py,sha256=6bLOH7cY_AyZwsMLKlFEA-kwmhKCI4pb0aLrflgfWdQ,4600
6
+ pysmarlaapi/federwiege/__init__.py,sha256=6Hk_Oqrk8AKoomNGdq3o-2pBW6E8ejvKArAc0DdOBGw,1743
7
7
  pysmarlaapi/federwiege/classes/__init__.py,sha256=1cCe3iToaNmbUfy_7PynoPenNHtVcKC03rFc4ADqnbE,62
8
8
  pysmarlaapi/federwiege/classes/property.py,sha256=YZnpw0cD2NUPnlWo6TBjOzNTWcSJG1tvArXs1dRT6dY,1084
9
9
  pysmarlaapi/federwiege/classes/service.py,sha256=J_4WjL0SyyxwlvBp-zpO9EaXNUUcTnOLoPfSdU1FrjA,771
10
10
  pysmarlaapi/federwiege/services/__init__.py,sha256=F_54VQIYWAZaGm2ITzCJeG7G-6ARW2PfWvqaut56WN8,96
11
11
  pysmarlaapi/federwiege/services/analyser_service.py,sha256=tQb6ijNlrtbz4igH7awdoBnOVHu4TO6SPJmMW5yeT3A,1340
12
12
  pysmarlaapi/federwiege/services/babywiege_service.py,sha256=SJFPAsZaf4nSRmt6ojJq-9MtWqk1MdtcaPzBmTN3H0Y,2167
13
- pysmarlaapi-0.2.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
14
- pysmarlaapi-0.2.0.dist-info/METADATA,sha256=XOCu8O2fyfOypK-oFsDm3O4TYHkDusw4W_zr7AU72hI,763
15
- pysmarlaapi-0.2.0.dist-info/RECORD,,
13
+ pysmarlaapi-0.2.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
14
+ pysmarlaapi-0.2.1.dist-info/METADATA,sha256=7P3-L0UgSh5bXHX4io29JTT6Qaaw3dWil_7QdF-hwBI,763
15
+ pysmarlaapi-0.2.1.dist-info/RECORD,,