mirror of
https://github.com/koush/scrypted.git
synced 2026-08-02 19:31:34 +01:00
python-client: fix test.py for current rpc_reader and PluginRemote APIs (#2087)
test.py has drifted from the server code it exercises: RpcTransport implementations must provide writeSerialized (rpc.py no longer calls writeJSON), and PluginRemote.__init__ now takes a ClusterSetup as its first argument instead of the peer. Verified against a live scrypted server (connects and enumerates devices). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ class EioRpcTransport(rpc_reader.RpcTransport):
|
||||
|
||||
asyncio.run_coroutine_threadsafe(send(), self.loop)
|
||||
|
||||
def writeJSON(self, json, reject):
|
||||
def writeSerialized(self, json, reject):
|
||||
return self.writeBuffer(json, reject)
|
||||
|
||||
|
||||
@@ -96,8 +96,9 @@ async def connect_scrypted_client(
|
||||
peer.params["print"] = print
|
||||
|
||||
def callback(api, pluginId, hostInfo):
|
||||
cluster_setup = plugin_remote.ClusterSetup(transport.loop, peer)
|
||||
remote = plugin_remote.PluginRemote(
|
||||
peer, api, pluginId, hostInfo, transport.loop
|
||||
cluster_setup, api, pluginId, hostInfo, transport.loop
|
||||
)
|
||||
wrapped = remote.setSystemState
|
||||
|
||||
|
||||
Reference in New Issue
Block a user