pysmarlaapi 0.8.2__tar.gz → 0.9.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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pysmarlaapi
3
- Version: 0.8.2
3
+ Version: 0.9.0
4
4
  Summary: Swing2Sleep Smarla API
5
5
  Author-email: Robin Lintermann <robin.lintermann@explicatis.com>
6
6
  Requires-Python: >=3.11
@@ -1,4 +1,4 @@
1
- __version__ = "0.8.2"
1
+ __version__ = "0.9.0"
2
2
 
3
3
  from .classes import Connection
4
4
  from .federwiege import Federwiege
@@ -8,9 +8,10 @@ _VT = TypeVar("_VT")
8
8
 
9
9
  class Property(Generic[_VT]):
10
10
 
11
- def __init__(self, hub: ConnectionHub, value: _VT):
11
+ value: _VT | None = None
12
+
13
+ def __init__(self, hub: ConnectionHub):
12
14
  self.hub = hub
13
- self.value: _VT = value
14
15
  self.listeners = set()
15
16
  self.lock = asyncio.Lock()
16
17
 
@@ -27,7 +28,7 @@ class Property(Generic[_VT]):
27
28
  for listener in self.listeners:
28
29
  await listener(self.value)
29
30
 
30
- def get(self) -> _VT:
31
+ def get(self) -> _VT | None:
31
32
  return self.value
32
33
 
33
34
  def set(self, new_value: _VT, push=True):
@@ -19,7 +19,7 @@ class OscillationProperty(Property[list[int]]):
19
19
  await self.notify_listeners()
20
20
 
21
21
  def __init__(self, hub: ConnectionHub):
22
- super().__init__(hub, [0, 0])
22
+ super().__init__(hub)
23
23
 
24
24
  def pull(self):
25
25
  self.hub.send_serialized_data("GetOscillation")
@@ -36,7 +36,7 @@ class ActivityProperty(Property[int]):
36
36
  await self.notify_listeners()
37
37
 
38
38
  def __init__(self, hub: ConnectionHub):
39
- super().__init__(hub, 0)
39
+ super().__init__(hub)
40
40
 
41
41
  def pull(self):
42
42
  self.hub.send_serialized_data("GetActivity")
@@ -53,7 +53,7 @@ class SwingCountProperty(Property[int]):
53
53
  await self.notify_listeners()
54
54
 
55
55
  def __init__(self, hub: ConnectionHub):
56
- super().__init__(hub, 0)
56
+ super().__init__(hub)
57
57
 
58
58
  def pull(self):
59
59
  self.hub.send_serialized_data("GetSwingCount")
@@ -19,7 +19,7 @@ class SwingActiveProperty(Property[bool]):
19
19
  await self.notify_listeners()
20
20
 
21
21
  def __init__(self, hub: ConnectionHub):
22
- super().__init__(hub, False)
22
+ super().__init__(hub)
23
23
 
24
24
  def pull(self):
25
25
  self.hub.send_serialized_data("GetSwingActive")
@@ -39,7 +39,7 @@ class IntensityProperty(Property[int]):
39
39
  await self.notify_listeners()
40
40
 
41
41
  def __init__(self, hub: ConnectionHub):
42
- super().__init__(hub, 0)
42
+ super().__init__(hub)
43
43
 
44
44
  def pull(self):
45
45
  self.hub.send_serialized_data("GetIntensity")
@@ -59,7 +59,7 @@ class SmartModeProperty(Property[bool]):
59
59
  await self.notify_listeners()
60
60
 
61
61
  def __init__(self, hub: ConnectionHub):
62
- super().__init__(hub, False)
62
+ super().__init__(hub)
63
63
 
64
64
  def pull(self):
65
65
  self.hub.send_serialized_data("GetSmartMode")
@@ -18,7 +18,7 @@ class DisplayNameProperty(Property[str]):
18
18
  await self.notify_listeners()
19
19
 
20
20
  def __init__(self, hub: ConnectionHub):
21
- super().__init__(hub, "Smarla")
21
+ super().__init__(hub)
22
22
 
23
23
  def pull(self):
24
24
  self.hub.send_serialized_data("GetDisplayName")
@@ -35,7 +35,7 @@ class VersionProperty(Property[str]):
35
35
  await self.notify_listeners()
36
36
 
37
37
  def __init__(self, hub: ConnectionHub):
38
- super().__init__(hub, "1.0.0")
38
+ super().__init__(hub)
39
39
 
40
40
  def pull(self):
41
41
  self.hub.send_serialized_data("GetVersion")
File without changes
File without changes
File without changes