Adds properties config for SIMPL Messenger classes and adds SetupDeviceMessengers() to MobileControlDdvc01RoomBridge to add individual device messengers

This commit is contained in:
Neil Dorin
2019-12-10 14:25:29 -07:00
parent ebc50f0caa
commit 5819ac78ec
7 changed files with 105 additions and 9 deletions

View File

@@ -39,5 +39,25 @@ namespace PepperDash.Essentials.Core.Config
return SourceLists[key];
}
/// <summary>
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
/// </summary>
/// <param name="key">Key of desired device</param>
/// <returns></returns>
public DeviceConfig GetDeviceForKey(string key)
{
if (string.IsNullOrEmpty(key))
return null;
var deviceConfig = Devices.FirstOrDefault(d => d.Key.Equals(key));
if (deviceConfig != null)
return deviceConfig;
else
{
return null;
}
}
}
}