mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 13:07:18 +00:00
fix: improve error handling and await device actions in RoomCombinationScenario
This commit is contained in:
parent
cc724ddf19
commit
4ef481375c
2 changed files with 17 additions and 16 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue