mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Adds dummy source and room power on implementation
This commit is contained in:
parent
57ebd2b608
commit
f0a3b27e3b
2 changed files with 18 additions and 11 deletions
|
|
@ -5,6 +5,9 @@ namespace PepperDash.Essentials.Room.Config
|
|||
{
|
||||
public class EssentialsTechRoomConfig
|
||||
{
|
||||
[JsonProperty("dummySourceKey")]
|
||||
public string DummySourceKey { get; set; }
|
||||
|
||||
[JsonProperty("displays")]
|
||||
public List<string> Displays;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ namespace PepperDash.Essentials
|
|||
private Dictionary<string, string> _currentPresets;
|
||||
private ScheduledEventGroup _roomScheduledEventGroup;
|
||||
|
||||
private GenericSource DummySource = new GenericSource("$off", "Dummy Source");
|
||||
|
||||
public EssentialsTechRoom(DeviceConfig config) : base(config)
|
||||
{
|
||||
_config = config.Properties.ToObject<EssentialsTechRoomConfig>();
|
||||
|
|
@ -243,9 +241,17 @@ namespace PepperDash.Essentials
|
|||
|
||||
public void RoomPowerOn()
|
||||
{
|
||||
var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
|
||||
|
||||
if (dummySource == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to get source with key: {0}", _config.DummySourceKey);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var display in _displays)
|
||||
{
|
||||
|
||||
RunDirectRoute(dummySource, display.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -388,7 +394,7 @@ namespace PepperDash.Essentials
|
|||
return;
|
||||
}
|
||||
|
||||
if (source.Key.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||
if (source == null)
|
||||
{
|
||||
dest.ReleaseRoute();
|
||||
if (dest is IHasPowerControl)
|
||||
|
|
@ -396,11 +402,6 @@ namespace PepperDash.Essentials
|
|||
}
|
||||
else
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", source.Key, dest.Key);
|
||||
return;
|
||||
}
|
||||
dest.ReleaseAndMakeRoute(source, eRoutingSignalType.Video);
|
||||
}
|
||||
}
|
||||
|
|
@ -418,11 +419,14 @@ namespace PepperDash.Essentials
|
|||
|
||||
var source = DeviceManager.GetDeviceForKey(sourceKey) as IRoutingOutputs;
|
||||
|
||||
if (source == null || dest == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route unknown source or destination '{0}' to {1}", sourceKey, destinationKey);
|
||||
return;
|
||||
}
|
||||
RunDirectRoute(source, dest);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue