From 4ffee0ec6304a59277cacdc7c50989a45306b7fa Mon Sep 17 00:00:00 2001 From: Christian Risi <75698846+CnF-Gris@users.noreply.github.com> Date: Sat, 21 Dec 2024 18:51:56 +0000 Subject: [PATCH] 0.6.6 Arroyo Toad Fixed some bugs --- Sources/App/simulator-configuration.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/App/simulator-configuration.swift b/Sources/App/simulator-configuration.swift index 7f94f6f..ee76771 100644 --- a/Sources/App/simulator-configuration.swift +++ b/Sources/App/simulator-configuration.swift @@ -37,16 +37,16 @@ private func jsonConfigurationParser(_ json: [String: Any]) async throws { for environmentJSON in environments { - let env = try json2env(environmentJSON) + let env = try await json2env(environmentJSON) - IoTSimulatorCore.addEnv(environment: env) + await IoTSimulatorCore.addEnv(environment: env) if let devices = environmentJSON["devices"] as? [[String: Any]] { for deviceJSON in devices { let devices = try await json2edge_dev(deviceJSON) for dev in devices { - try IoTSimulatorCore.addDevice(location: env.location, device: dev) { msg in + await try IoTSimulatorCore.addDevice(location: env.location, device: dev) { msg in // UGLY: But fast // TODO: add sending code here let backendURL = ProcessInfo.processInfo.environment["BACKEND_URL"]! @@ -69,7 +69,7 @@ private func jsonConfigurationParser(_ json: [String: Any]) async throws { } -private func json2env(_ json: [String: Any]) throws -> PhysicalEnvironment { +private func json2env(_ json: [String: Any]) async throws -> PhysicalEnvironment { guard let envName = json["name"] as? String @@ -91,7 +91,7 @@ private func json2env(_ json: [String: Any]) throws -> PhysicalEnvironment { } let datum = PhysicalData(dataType, Float(value)) - environment.setPhysicalData(datum.type, datum) + await environment.setPhysicalData(datum.type, datum) } }