pysmarlaapi 0.7.2__tar.gz → 0.8.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.
Potentially problematic release.
This version of pysmarlaapi might be problematic. Click here for more details.
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/PKG-INFO +1 -1
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/__init__.py +1 -1
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/classes/property.py +4 -4
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/services/analyser_service.py +7 -10
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/services/babywiege_service.py +7 -10
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/services/info_service.py +4 -6
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/LICENSE +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/README.md +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pyproject.toml +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/classes/__init__.py +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/classes/auth_token.py +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/classes/connection.py +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/connection_hub/__init__.py +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/__init__.py +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/classes/__init__.py +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/classes/service.py +0 -0
- {pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/services/__init__.py +0 -0
|
@@ -8,9 +8,9 @@ _VT = TypeVar("_VT")
|
|
|
8
8
|
|
|
9
9
|
class Property(Generic[_VT]):
|
|
10
10
|
|
|
11
|
-
def __init__(self, hub: ConnectionHub):
|
|
11
|
+
def __init__(self, hub: ConnectionHub, value: _VT):
|
|
12
12
|
self.hub = hub
|
|
13
|
-
self.value: _VT =
|
|
13
|
+
self.value: _VT = value
|
|
14
14
|
self.listeners = set()
|
|
15
15
|
self.lock = asyncio.Lock()
|
|
16
16
|
|
|
@@ -22,10 +22,10 @@ class Property(Generic[_VT]):
|
|
|
22
22
|
async with self.lock:
|
|
23
23
|
self.listeners.remove(listener)
|
|
24
24
|
|
|
25
|
-
async def notify_listeners(self
|
|
25
|
+
async def notify_listeners(self):
|
|
26
26
|
async with self.lock:
|
|
27
27
|
for listener in self.listeners:
|
|
28
|
-
await listener(value)
|
|
28
|
+
await listener(self.value)
|
|
29
29
|
|
|
30
30
|
def get(self) -> _VT:
|
|
31
31
|
return self.value
|
|
@@ -11,16 +11,15 @@ class AnalyserService(Service):
|
|
|
11
11
|
self.add_property("swing_count", SwingCountProperty(hub))
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
class OscillationProperty(Property[list[int
|
|
14
|
+
class OscillationProperty(Property[list[int]]):
|
|
15
15
|
|
|
16
16
|
async def on_callback(self, args):
|
|
17
17
|
value = args[0]["value"]
|
|
18
18
|
self.set(value, push=False)
|
|
19
|
-
await self.notify_listeners(
|
|
19
|
+
await self.notify_listeners()
|
|
20
20
|
|
|
21
21
|
def __init__(self, hub: ConnectionHub):
|
|
22
|
-
super().__init__(hub)
|
|
23
|
-
self.value = [0, 0]
|
|
22
|
+
super().__init__(hub, [0, 0])
|
|
24
23
|
|
|
25
24
|
def pull(self):
|
|
26
25
|
self.hub.send_serialized_data("GetOscillation")
|
|
@@ -34,11 +33,10 @@ class ActivityProperty(Property[int]):
|
|
|
34
33
|
async def on_callback(self, args):
|
|
35
34
|
value = args[0]["value"]
|
|
36
35
|
self.set(value, push=False)
|
|
37
|
-
await self.notify_listeners(
|
|
36
|
+
await self.notify_listeners()
|
|
38
37
|
|
|
39
38
|
def __init__(self, hub: ConnectionHub):
|
|
40
|
-
super().__init__(hub)
|
|
41
|
-
self.value = 0
|
|
39
|
+
super().__init__(hub, 0)
|
|
42
40
|
|
|
43
41
|
def pull(self):
|
|
44
42
|
self.hub.send_serialized_data("GetActivity")
|
|
@@ -52,11 +50,10 @@ class SwingCountProperty(Property[int]):
|
|
|
52
50
|
async def on_callback(self, args):
|
|
53
51
|
value = args[0]["value"]
|
|
54
52
|
self.set(value, push=False)
|
|
55
|
-
await self.notify_listeners(
|
|
53
|
+
await self.notify_listeners()
|
|
56
54
|
|
|
57
55
|
def __init__(self, hub: ConnectionHub):
|
|
58
|
-
super().__init__(hub)
|
|
59
|
-
self.value = 0
|
|
56
|
+
super().__init__(hub, 0)
|
|
60
57
|
|
|
61
58
|
def pull(self):
|
|
62
59
|
self.hub.send_serialized_data("GetSwingCount")
|
{pysmarlaapi-0.7.2 → pysmarlaapi-0.8.1}/pysmarlaapi/federwiege/services/babywiege_service.py
RENAMED
|
@@ -8,7 +8,7 @@ class BabywiegeService(Service):
|
|
|
8
8
|
super().__init__()
|
|
9
9
|
self.add_property("swing_active", SwingActiveProperty(hub))
|
|
10
10
|
self.add_property("intensity", IntensityProperty(hub))
|
|
11
|
-
self.add_property("
|
|
11
|
+
self.add_property("smart_mode", SmartModeProperty(hub))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class SwingActiveProperty(Property[bool]):
|
|
@@ -16,11 +16,10 @@ class SwingActiveProperty(Property[bool]):
|
|
|
16
16
|
async def on_callback(self, args):
|
|
17
17
|
value = args[0]["value"]
|
|
18
18
|
self.set(value, push=False)
|
|
19
|
-
await self.notify_listeners(
|
|
19
|
+
await self.notify_listeners()
|
|
20
20
|
|
|
21
21
|
def __init__(self, hub: ConnectionHub):
|
|
22
|
-
super().__init__(hub)
|
|
23
|
-
self.value = False
|
|
22
|
+
super().__init__(hub, False)
|
|
24
23
|
|
|
25
24
|
def pull(self):
|
|
26
25
|
self.hub.send_serialized_data("GetSwingActive")
|
|
@@ -37,11 +36,10 @@ class IntensityProperty(Property[int]):
|
|
|
37
36
|
async def on_callback(self, args):
|
|
38
37
|
value = args[0]["value"]
|
|
39
38
|
self.set(value, push=False)
|
|
40
|
-
await self.notify_listeners(
|
|
39
|
+
await self.notify_listeners()
|
|
41
40
|
|
|
42
41
|
def __init__(self, hub: ConnectionHub):
|
|
43
|
-
super().__init__(hub)
|
|
44
|
-
self.value = 0
|
|
42
|
+
super().__init__(hub, 0)
|
|
45
43
|
|
|
46
44
|
def pull(self):
|
|
47
45
|
self.hub.send_serialized_data("GetIntensity")
|
|
@@ -58,11 +56,10 @@ class SmartModeProperty(Property[bool]):
|
|
|
58
56
|
async def on_callback(self, args):
|
|
59
57
|
value = args[0]["value"]
|
|
60
58
|
self.set(value, push=False)
|
|
61
|
-
await self.notify_listeners(
|
|
59
|
+
await self.notify_listeners()
|
|
62
60
|
|
|
63
61
|
def __init__(self, hub: ConnectionHub):
|
|
64
|
-
super().__init__(hub)
|
|
65
|
-
self.value = False
|
|
62
|
+
super().__init__(hub, False)
|
|
66
63
|
|
|
67
64
|
def pull(self):
|
|
68
65
|
self.hub.send_serialized_data("GetSmartMode")
|
|
@@ -15,11 +15,10 @@ class DisplayNameProperty(Property[str]):
|
|
|
15
15
|
async def on_callback(self, args):
|
|
16
16
|
value = args[0]["value"]
|
|
17
17
|
self.set(value, push=False)
|
|
18
|
-
await self.notify_listeners(
|
|
18
|
+
await self.notify_listeners()
|
|
19
19
|
|
|
20
20
|
def __init__(self, hub: ConnectionHub):
|
|
21
|
-
super().__init__(hub)
|
|
22
|
-
self.value = "Smarla"
|
|
21
|
+
super().__init__(hub, "Smarla")
|
|
23
22
|
|
|
24
23
|
def pull(self):
|
|
25
24
|
self.hub.send_serialized_data("GetDisplayName")
|
|
@@ -33,11 +32,10 @@ class VersionProperty(Property[str]):
|
|
|
33
32
|
async def on_callback(self, args):
|
|
34
33
|
value = args[0]["value"]
|
|
35
34
|
self.set(value, push=False)
|
|
36
|
-
await self.notify_listeners(
|
|
35
|
+
await self.notify_listeners()
|
|
37
36
|
|
|
38
37
|
def __init__(self, hub: ConnectionHub):
|
|
39
|
-
super().__init__(hub)
|
|
40
|
-
self.value = "1.0.0"
|
|
38
|
+
super().__init__(hub, "1.0.0")
|
|
41
39
|
|
|
42
40
|
def pull(self):
|
|
43
41
|
self.hub.send_serialized_data("GetVersion")
|
|
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
|