server: implement python WritableDeviceState (#1537)

This commit is contained in:
Brett Jia
2024-07-28 14:35:27 -04:00
committed by GitHub
parent e870370d0c
commit 4adb8e4202

View File

@@ -274,6 +274,13 @@ class DeviceState(scrypted_python.scrypted_sdk.types.DeviceState):
self.systemManager.api.setState(self.nativeId, property, value)
class WritableDeviceState(scrypted_python.scrypted_sdk.types.WritableDeviceState):
def __init__(self, id, setState) -> None:
self.id = id
self.setState = setState
class DeviceStorage(Storage):
id: str
nativeId: str
@@ -757,7 +764,7 @@ class PluginRemote:
pass
async def createDeviceState(self, id, setState):
pass
return WritableDeviceState(id, setState)
async def getServicePort(self, name):
if name == "repl":