Skip to content

Commit

Permalink
refactor: remove unecessary dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-welker committed Aug 30, 2022
1 parent 847e785 commit 197fb94
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions 3-series/RoomBridges/MobileControlSIMPLRoomBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public class MobileControlSIMPLRoomBridge : MobileControlBridgeBase, IDelayedCon

public MobileControlSIMPLRoomJoinMap JoinMap { get; private set; }

public Dictionary<string, MessengerBase> DeviceMessengers { get; private set; }


/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -871,8 +868,6 @@ private void CreateDestinationList(BasicConfig co)
/// </summary>
private void SetupDeviceMessengers()
{
DeviceMessengers = new Dictionary<string, MessengerBase>();

try
{
foreach (var device in ConfigReader.ConfigObject.Devices)
Expand Down Expand Up @@ -916,9 +911,7 @@ private void SetupDeviceMessengers()

if (messenger != null)
{
DeviceManager.AddDevice(messenger);
DeviceMessengers.Add(device.Key, messenger);
messenger.RegisterWithAppServer(Parent);
Parent.AddDeviceMessenger(messenger);
}
else
{
Expand All @@ -938,9 +931,7 @@ private void SetupDeviceMessengers()
Debug.Console(1, this, "Adding CameraBaseMessenger for device: {0}", dev.Key);
var cameraMessenger = new CameraBaseMessenger(device.Key + "-" + Parent.Key, camDevice,
"/device/" + device.Key);
DeviceMessengers.Add(device.Key, cameraMessenger);
DeviceManager.AddDevice(cameraMessenger);
cameraMessenger.RegisterWithAppServer(Parent);
Parent.AddDeviceMessenger(messenger);
continue;
}

Expand All @@ -965,8 +956,6 @@ private void SetupDeviceMessengers()
var messenger = new LightingBaseMessenger(deviceKey + "-" + Parent.Key,
lightingDevice, string.Format("/device/{0}", deviceKey));
Parent.AddDeviceMessenger(messenger);
DeviceMessengers.Add(dev.Key, messenger);
messenger.RegisterWithAppServer(Parent);
continue;
}

Expand All @@ -978,8 +967,6 @@ private void SetupDeviceMessengers()
var messenger = new ShadeBaseMessenger(deviceKey + "-" + Parent.Key,
shadeDevice, string.Format("/device/{0}", deviceKey));
Parent.AddDeviceMessenger(messenger);
DeviceMessengers.Add(dev.Key, messenger);
messenger.RegisterWithAppServer(Parent);
continue;
}

Expand Down

0 comments on commit 197fb94

Please sign in to comment.