@scrypted/server 0.5.8 → 0.5.10
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 @scrypted/server might be problematic. Click here for more details.
- package/package.json +1 -1
- package/python/plugin-remote.py +7 -2
package/package.json
CHANGED
package/python/plugin-remote.py
CHANGED
@@ -24,6 +24,7 @@ from typing import Any, Dict, List, Optional, Set, Tuple
|
|
24
24
|
import aiofiles
|
25
25
|
import scrypted_python.scrypted_sdk.types
|
26
26
|
from scrypted_python.scrypted_sdk.types import (Device, DeviceManifest,
|
27
|
+
EventDetails,
|
27
28
|
ScryptedInterfaceProperty,
|
28
29
|
Storage)
|
29
30
|
from typing_extensions import TypedDict
|
@@ -103,7 +104,10 @@ class DeviceState(scrypted_python.scrypted_sdk.types.DeviceState):
|
|
103
104
|
if not deviceState:
|
104
105
|
print("missing id %s" % self._id)
|
105
106
|
return None
|
106
|
-
|
107
|
+
sdd = deviceState.get(property, None)
|
108
|
+
if not sdd:
|
109
|
+
return None
|
110
|
+
return sdd.get('value', None)
|
107
111
|
|
108
112
|
def setScryptedProperty(self, property: str, value: Any):
|
109
113
|
if property == ScryptedInterfaceProperty.id.value:
|
@@ -372,7 +376,8 @@ class PluginRemote:
|
|
372
376
|
else:
|
373
377
|
self.systemState[id] = state
|
374
378
|
|
375
|
-
async def notify(self, id,
|
379
|
+
async def notify(self, id, eventDetails: EventDetails, value):
|
380
|
+
property = eventDetails.get('property')
|
376
381
|
if property:
|
377
382
|
state = None
|
378
383
|
if self.systemState:
|