public async Task RunScene(Scene scene) { var parameters = new Parameters(); parameters.id = scene.id; parameters.state = "run"; var jsonrpc = new JsonRpcClient(parameters); if (await jsonrpc.SendRequest("scenario::changeState")) { await UpdateScene(scene); } }
private async Task UpdateScene(Scene scene) { var parameters = new Parameters(); parameters.id = scene.id; var jsonrpc = new JsonRpcClient(parameters); if (await jsonrpc.SendRequest("scenario::byId")) { var response = jsonrpc.GetRequestResponseDeserialized<Response<Scene>>(); scene.lastLaunch = response.result.lastLaunch; } }