0.6.6 Arroyo Toad

Fixed some bugs
This commit is contained in:
Christian Risi 2024-12-21 18:51:56 +00:00
parent 21081cc7ce
commit 4ffee0ec63

View File

@ -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)
}
}