mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +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:
parent
d970d806c9
commit
64d6df70b0
1 changed files with 11 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue