mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 03:35:00 +00:00
feat: Adds mechanism to track initialization status of EssentialsDevice as well as an event on DeviceManager to notify when all devices initialized. Room combiner now waits for all initialize before setting current scenario.
This commit is contained in:
@@ -84,7 +84,15 @@ namespace PepperDash.Essentials.Core
|
||||
SetupPartitionStateProviders();
|
||||
|
||||
SetRooms();
|
||||
});
|
||||
|
||||
|
||||
// Subscribe to the AllDevicesInitialized event
|
||||
// We need to wait until all devices are initialized in case
|
||||
// any actions are dependent on 3rd party devices already being
|
||||
// connected and initialized
|
||||
DeviceManager.AllDevicesInitialized += (o, a) =>
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
{
|
||||
DetermineRoomCombinationScenario();
|
||||
@@ -93,7 +101,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
SetRoomCombinationScenario(_propertiesConfig.defaultScenarioKey);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
private void CreateScenarios()
|
||||
|
||||
Reference in New Issue
Block a user