mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-02 06:14:52 +00:00
fix: improve error handling and await device actions in RoomCombinationScenario
This commit is contained in:
@@ -81,12 +81,10 @@ namespace PepperDash.Essentials.Core
|
||||
foreach (var action in activationActions)
|
||||
{
|
||||
this.LogInformation("Running Activation action {@action}", action);
|
||||
tasks.Add(DeviceJsonApi.DoDeviceActionAsync(action));
|
||||
await DeviceJsonApi.DoDeviceActionAsync(action);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.WhenAll(tasks);
|
||||
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
@@ -101,12 +99,10 @@ namespace PepperDash.Essentials.Core
|
||||
foreach (var action in deactivationActions)
|
||||
{
|
||||
this.LogInformation("Running deactivation action {actionDeviceKey}:{actionMethod}", action.DeviceKey, action.MethodName);
|
||||
tasks.Add( DeviceJsonApi.DoDeviceActionAsync(action));
|
||||
await DeviceJsonApi.DoDeviceActionAsync(action);
|
||||
}
|
||||
}
|
||||
|
||||
await Task.WhenAll(tasks);
|
||||
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user