mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-03 14:55:05 +00:00
fix: deactivate all rooms on startup
As part of the Essentials startup process, ALL rooms are activated, meaning there are unnecessary rooms activated. Deactiving them all prior to determining a combination scenario helps keep unecessary activity from happening.
This commit is contained in:
@@ -110,11 +110,20 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
foreach (var roomKey in _propertiesConfig.RoomKeys)
|
||||
{
|
||||
if (DeviceManager.GetDeviceForKey(roomKey) is IEssentialsRoom room)
|
||||
var room = DeviceManager.GetDeviceForKey(roomKey);
|
||||
|
||||
if (DeviceManager.GetDeviceForKey(roomKey) is IEssentialsRoom essentialsRoom)
|
||||
{
|
||||
_rooms.Add(room);
|
||||
_rooms.Add(essentialsRoom);
|
||||
}
|
||||
}
|
||||
|
||||
var rooms = DeviceManager.AllDevices.OfType<IEssentialsRoom>().Cast<Device>();
|
||||
|
||||
foreach (var room in rooms)
|
||||
{
|
||||
room.Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupPartitionStateProviders()
|
||||
|
||||
Reference in New Issue
Block a user