mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 20:47:04 +00:00
style: run code cleanup & apply VS suggestions
This commit is contained in:
parent
4d98191fa7
commit
789111cb9a
64 changed files with 329 additions and 390 deletions
|
|
@ -2,14 +2,12 @@
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.AppServer;
|
using PepperDash.Essentials.AppServer;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using DisplayBase = PepperDash.Essentials.Devices.Common.Displays.DisplayBase;
|
using DisplayBase = PepperDash.Essentials.Devices.Common.Displays.DisplayBase;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class DisplayBaseMessenger: MessengerBase
|
public class DisplayBaseMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly DisplayBase display;
|
private readonly DisplayBase display;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class IChannelMessenger:MessengerBase
|
public class IChannelMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly IChannel channelDevice;
|
private readonly IChannel channelDevice;
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||||
AddAction("/chanDown", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.ChannelDown(b)));
|
AddAction("/chanDown", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.ChannelDown(b)));
|
||||||
AddAction("/lastChan", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.LastChannel(b)));
|
AddAction("/lastChan", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.LastChannel(b)));
|
||||||
AddAction("/guide", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.Guide(b)));
|
AddAction("/guide", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.Guide(b)));
|
||||||
AddAction("/info", (id, content) => PressAndHoldHandler.HandlePressAndHold (DeviceKey, content, (b) => channelDevice?.Info(b)));
|
AddAction("/info", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.Info(b)));
|
||||||
AddAction("/exit", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.Exit(b)));
|
AddAction("/exit", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => channelDevice?.Exit(b)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class IColorMessenger:MessengerBase
|
public class IColorMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly IColor colorDevice;
|
private readonly IColor colorDevice;
|
||||||
public IColorMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
public IColorMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class IDPadMessenger:MessengerBase
|
public class IDPadMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly IDPad dpadDevice;
|
private readonly IDPad dpadDevice;
|
||||||
public IDPadMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
public IDPadMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class IDvrMessenger: MessengerBase
|
public class IDvrMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly IDvr dvrDevice;
|
private readonly IDvr dvrDevice;
|
||||||
public IDvrMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
public IDvrMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class IHasPowerMessenger:MessengerBase
|
public class IHasPowerMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly IHasPowerControl powerDevice;
|
private readonly IHasPowerControl powerDevice;
|
||||||
public IHasPowerMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
public IHasPowerMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class INumericKeypadMessenger:MessengerBase
|
public class INumericKeypadMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly INumericKeypad keypadDevice;
|
private readonly INumericKeypad keypadDevice;
|
||||||
public INumericKeypadMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
public INumericKeypadMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class ISetTopBoxControlsMessenger:MessengerBase
|
public class ISetTopBoxControlsMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly ISetTopBoxControls stbDevice;
|
private readonly ISetTopBoxControls stbDevice;
|
||||||
public ISetTopBoxControlsMessenger(string key, string messagePath, IKeyName device) : base(key, messagePath, device)
|
public ISetTopBoxControlsMessenger(string key, string messagePath, IKeyName device) : base(key, messagePath, device)
|
||||||
|
|
@ -19,14 +19,14 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||||
AddAction("/dvrList", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => stbDevice?.DvrList(b)));
|
AddAction("/dvrList", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => stbDevice?.DvrList(b)));
|
||||||
AddAction("/replay", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => stbDevice?.Replay(b)));
|
AddAction("/replay", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => stbDevice?.Replay(b)));
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper method to build call status for vtc
|
/// Helper method to build call status for vtc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private void SendISetTopBoxControlsFullMessageObject()
|
private void SendISetTopBoxControlsFullMessageObject()
|
||||||
{
|
{
|
||||||
|
|
||||||
PostStatusMessage( new SetTopBoxControlsState());
|
PostStatusMessage(new SetTopBoxControlsState());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
public class ITransportMessenger:MessengerBase
|
public class ITransportMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly ITransport transportDevice;
|
private readonly ITransport transportDevice;
|
||||||
public ITransportMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
public ITransportMessenger(string key, string messagePath, Device device) : base(key, messagePath, device)
|
||||||
|
|
@ -16,14 +16,14 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||||
{
|
{
|
||||||
base.RegisterActions();
|
base.RegisterActions();
|
||||||
|
|
||||||
AddAction("/play", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Play(b)));
|
AddAction("/play", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Play(b)));
|
||||||
AddAction("/pause", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Pause(b)));
|
AddAction("/pause", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Pause(b)));
|
||||||
AddAction("/stop", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Stop(b)));
|
AddAction("/stop", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Stop(b)));
|
||||||
AddAction("/prevTrack", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.ChapPlus(b)));
|
AddAction("/prevTrack", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.ChapPlus(b)));
|
||||||
AddAction("/nextTrack", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.ChapMinus(b)));
|
AddAction("/nextTrack", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.ChapMinus(b)));
|
||||||
AddAction("/rewind", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Rewind(b)));
|
AddAction("/rewind", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Rewind(b)));
|
||||||
AddAction("/ffwd", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.FFwd(b)));
|
AddAction("/ffwd", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.FFwd(b)));
|
||||||
AddAction("/record", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Record(b)));
|
AddAction("/record", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => transportDevice?.Record(b)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -103,14 +102,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
var info = Codec.CodecInfo;
|
var info = Codec.CodecInfo;
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
|
{
|
||||||
|
isInCall = Codec.IsInCall,
|
||||||
|
calls = Codec.ActiveCalls,
|
||||||
|
info = new
|
||||||
{
|
{
|
||||||
isInCall = Codec.IsInCall,
|
phoneNumber = info.PhoneNumber
|
||||||
calls = Codec.ActiveCalls,
|
}
|
||||||
info = new
|
})
|
||||||
{
|
|
||||||
phoneNumber = info.PhoneNumber
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -40,9 +39,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
presetList = presetsCamera.Presets;
|
presetList = presetsCamera.Presets;
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
presets = presetList
|
presets = presetList
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -175,14 +174,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
presetList = presetsCamera.Presets;
|
presetList = presetsCamera.Presets;
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
cameraManualSupported = Camera is IHasCameraControls,
|
cameraManualSupported = Camera is IHasCameraControls,
|
||||||
cameraAutoSupported = Camera is IHasCameraAutoMode,
|
cameraAutoSupported = Camera is IHasCameraAutoMode,
|
||||||
cameraOffSupported = Camera is IHasCameraOff,
|
cameraOffSupported = Camera is IHasCameraOff,
|
||||||
cameraMode = GetCameraMode(),
|
cameraMode = GetCameraMode(),
|
||||||
hasPresets = Camera is IHasCameraPresets,
|
hasPresets = Camera is IHasCameraPresets,
|
||||||
presets = presetList
|
presets = presetList
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceInfo;
|
using PepperDash.Essentials.Core.DeviceInfo;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
protected override void RegisterActions()
|
protected override void RegisterActions()
|
||||||
|
|
||||||
{
|
{
|
||||||
AddAction("/presets/fullStatus", (id, content) => {
|
AddAction("/presets/fullStatus", (id, content) =>
|
||||||
|
{
|
||||||
this.LogInformation("getting full status for client {id}", id);
|
this.LogInformation("getting full status for client {id}", id);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SendPresets();
|
SendPresets();
|
||||||
} catch(Exception ex)
|
}
|
||||||
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Exception sending preset full status", this);
|
Debug.LogMessage(ex, "Exception sending preset full status", this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Logging;
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
@ -39,7 +38,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
}
|
}
|
||||||
|
|
||||||
PostStatusMessage(messageObj);
|
PostStatusMessage(messageObj);
|
||||||
} catch(Exception ex)
|
}
|
||||||
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Exception sending full status", this);
|
Debug.LogMessage(ex, "Exception sending full status", this);
|
||||||
}
|
}
|
||||||
|
|
@ -80,11 +80,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_localDevice.VolumeUp(b);
|
_localDevice.VolumeUp(b);
|
||||||
} catch (Exception ex)
|
}
|
||||||
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Got exception during volume up: {Exception}", null, ex);
|
Debug.LogMessage(ex, "Got exception during volume up: {Exception}", null, ex);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@ using Newtonsoft.Json.Converters;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
PostStatusMessage(JToken.FromObject(message));
|
PostStatusMessage(JToken.FromObject(message));
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach(var partition in _roomCombiner.Partitions)
|
foreach (var partition in _roomCombiner.Partitions)
|
||||||
{
|
{
|
||||||
partition.PartitionPresentFeedback.OutputChange += (sender, args) =>
|
partition.PartitionPresentFeedback.OutputChange += (sender, args) =>
|
||||||
{
|
{
|
||||||
|
|
@ -101,7 +101,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
|
||||||
foreach (var room in _roomCombiner.Rooms)
|
foreach (var room in _roomCombiner.Rooms)
|
||||||
{
|
{
|
||||||
rooms.Add(new RoomCombinerRoom{ Key = room.Key, Name = room.Name });
|
rooms.Add(new RoomCombinerRoom { Key = room.Key, Name = room.Name });
|
||||||
}
|
}
|
||||||
|
|
||||||
var message = new IEssentialsRoomCombinerStateMessage
|
var message = new IEssentialsRoomCombinerStateMessage
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
@ -29,7 +28,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
PostStatusMessage(message);
|
PostStatusMessage(message);
|
||||||
});
|
});
|
||||||
|
|
||||||
sourceDevice.CurrentSourceChange += (sender, e) => {
|
sourceDevice.CurrentSourceChange += (sender, e) =>
|
||||||
|
{
|
||||||
switch (e)
|
switch (e)
|
||||||
{
|
{
|
||||||
case ChangeType.DidChange:
|
case ChangeType.DidChange:
|
||||||
|
|
@ -46,7 +46,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CurrentSourceStateMessage: DeviceStateMessageBase
|
public class CurrentSourceStateMessage : DeviceStateMessageBase
|
||||||
{
|
{
|
||||||
[JsonProperty("currentSourceKey", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("currentSourceKey", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string CurrentSourceKey { get; set; }
|
public string CurrentSourceKey { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using System;
|
using PepperDash.Essentials.Core;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
public class IHasPowerControlWithFeedbackMessenger: MessengerBase
|
public class IHasPowerControlWithFeedbackMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly IHasPowerControlWithFeedback _powerControl;
|
private readonly IHasPowerControlWithFeedback _powerControl;
|
||||||
|
|
||||||
|
|
@ -42,9 +37,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
private void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs args)
|
private void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs args)
|
||||||
{
|
{
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
powerState = args.BoolValue
|
powerState = args.BoolValue
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -28,13 +27,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
private void CodecSchedule_MeetingEventChange(object sender, MeetingEventArgs e)
|
private void CodecSchedule_MeetingEventChange(object sender, MeetingEventArgs e)
|
||||||
{
|
{
|
||||||
PostStatusMessage(JToken.FromObject(new MeetingChangeMessage
|
PostStatusMessage(JToken.FromObject(new MeetingChangeMessage
|
||||||
|
{
|
||||||
|
MeetingChange = new MeetingChange
|
||||||
{
|
{
|
||||||
MeetingChange = new MeetingChange
|
ChangeType = e.ChangeType.ToString(),
|
||||||
{
|
Meeting = e.Meeting
|
||||||
ChangeType = e.ChangeType.ToString(),
|
}
|
||||||
Meeting = e.Meeting
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
using Independentsoft.Exchange;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
@ -33,7 +29,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
PostStatusMessage(message);
|
PostStatusMessage(message);
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach(var levelControl in levelControlsDevice.LevelControlPoints)
|
foreach (var levelControl in levelControlsDevice.LevelControlPoints)
|
||||||
{
|
{
|
||||||
// reassigning here just in case of lambda closure issues
|
// reassigning here just in case of lambda closure issues
|
||||||
var key = levelControl.Key;
|
var key = levelControl.Key;
|
||||||
|
|
@ -78,7 +74,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LevelControlStateMessage:DeviceStateMessageBase
|
public class LevelControlStateMessage : DeviceStateMessageBase
|
||||||
{
|
{
|
||||||
[JsonProperty("levelControls")]
|
[JsonProperty("levelControls")]
|
||||||
public Dictionary<string, Volume> Levels { get; set; }
|
public Dictionary<string, Volume> Levels { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
@ -52,7 +52,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
matrixDevice.Route(request.InputKey, request.OutputKey, request.RouteType);
|
matrixDevice.Route(request.InputKey, request.OutputKey, request.RouteType);
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach(var output in matrixDevice.OutputSlots)
|
foreach (var output in matrixDevice.OutputSlots)
|
||||||
{
|
{
|
||||||
var key = output.Key;
|
var key = output.Key;
|
||||||
var outputSlot = output.Value;
|
var outputSlot = output.Value;
|
||||||
|
|
@ -66,7 +66,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(var input in matrixDevice.InputSlots)
|
foreach (var input in matrixDevice.InputSlots)
|
||||||
{
|
{
|
||||||
var key = input.Key;
|
var key = input.Key;
|
||||||
var inputSlot = input.Value;
|
var inputSlot = input.Value;
|
||||||
|
|
@ -82,7 +82,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MatrixStateMessage : DeviceStateMessageBase
|
public class MatrixStateMessage : DeviceStateMessageBase
|
||||||
{
|
{
|
||||||
[JsonProperty("outputs")]
|
[JsonProperty("outputs")]
|
||||||
public Dictionary<string, RoutingOutput> Outputs;
|
public Dictionary<string, RoutingOutput> Outputs;
|
||||||
|
|
@ -113,7 +113,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
|
||||||
[JsonProperty("videoSyncDetected", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("videoSyncDetected", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
|
||||||
public bool? VideoSyncDetected => _input?.VideoSyncDetected;
|
public bool? VideoSyncDetected => _input?.VideoSyncDetected;
|
||||||
|
|
||||||
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string Key => _input?.Key;
|
public string Key => _input?.Key;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using System;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
public class IProjectorScreenLiftControlMessenger: MessengerBase
|
public class IProjectorScreenLiftControlMessenger : MessengerBase
|
||||||
{
|
{
|
||||||
private readonly IProjectorScreenLiftControl device;
|
private readonly IProjectorScreenLiftControl device;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,8 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json.Converters;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
|
||||||
using PepperDash.Essentials.Core.Shades;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,4 @@
|
||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics.Contracts;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Independentsoft.Json.Parser;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
|
@ -83,7 +76,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
public bool? IsValid { get; set; }
|
public bool? IsValid { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
class SetTechPasswordContent
|
internal class SetTechPasswordContent
|
||||||
{
|
{
|
||||||
[JsonProperty("oldPassword")]
|
[JsonProperty("oldPassword")]
|
||||||
public string OldPassword { get; set; }
|
public string OldPassword { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Core.Lighting;
|
using PepperDash.Essentials.Core.Lighting;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
@ -83,7 +82,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
// replace base path with empty string. Should leave something like /fullStatus
|
// replace base path with empty string. Should leave something like /fullStatus
|
||||||
var route = path.Replace(MessagePath, string.Empty);
|
var route = path.Replace(MessagePath, string.Empty);
|
||||||
|
|
||||||
if(!_actions.TryGetValue(route, out var action)) {
|
if (!_actions.TryGetValue(route, out var action))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,12 +136,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(message == null)
|
if (message == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("message");
|
throw new ArgumentNullException("message");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_device == null)
|
if (_device == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("device");
|
throw new ArgumentNullException("device");
|
||||||
}
|
}
|
||||||
|
|
@ -154,7 +154,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(message), MessagePath, clientId);
|
PostStatusMessage(JToken.FromObject(message), MessagePath, clientId);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex)
|
||||||
|
{
|
||||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
Debug.LogMessage(ex, "Exception posting status message", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
|
|
@ -70,7 +69,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Debug, "Attempting to stop timer for {deviceKey}", deviceKey);
|
Debug.LogMessage(Serilog.Events.LogEventLevel.Debug, "Attempting to stop timer for {deviceKey}", deviceKey);
|
||||||
|
|
||||||
if (!_pushedActions.TryGetValue(deviceKey, out CTimer cancelTimer)) {
|
if (!_pushedActions.TryGetValue(deviceKey, out CTimer cancelTimer))
|
||||||
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Debug, "Timer for {deviceKey} not found", deviceKey);
|
Debug.LogMessage(Serilog.Events.LogEventLevel.Debug, "Timer for {deviceKey} not found", deviceKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -44,12 +43,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
private void SendFullStatus()
|
private void SendFullStatus()
|
||||||
{
|
{
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
calls = GetCurrentCallList(),
|
calls = GetCurrentCallList(),
|
||||||
currentCallString = _eisc.GetString(JoinMap.CurrentCallName.JoinNumber),
|
currentCallString = _eisc.GetString(JoinMap.CurrentCallName.JoinNumber),
|
||||||
currentDialString = _eisc.GetString(JoinMap.CurrentDialString.JoinNumber),
|
currentDialString = _eisc.GetString(JoinMap.CurrentDialString.JoinNumber),
|
||||||
isInCall = _eisc.GetString(JoinMap.HookState.JoinNumber) == "Connected"
|
isInCall = _eisc.GetString(JoinMap.HookState.JoinNumber) == "Connected"
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,9 +138,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
private void SendCallsList()
|
private void SendCallsList()
|
||||||
{
|
{
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
calls = GetCurrentCallList(),
|
calls = GetCurrentCallList(),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,11 +125,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
}
|
}
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
cameraMode = GetCameraMode(),
|
cameraMode = GetCameraMode(),
|
||||||
hasPresets = _eisc.GetBool(_joinMap.SupportsPresets.JoinNumber),
|
hasPresets = _eisc.GetBool(_joinMap.SupportsPresets.JoinNumber),
|
||||||
presets = presetList
|
presets = presetList
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
sourceKey = "none";
|
sourceKey = "none";
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
selectedSourceKey = sourceKey
|
selectedSourceKey = sourceKey
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using System;
|
using System;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Core.Shades;
|
using PepperDash.Essentials.Core.Shades;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
using PepperDash.Essentials.Core.Monitoring;
|
using PepperDash.Essentials.Core.Monitoring;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -71,15 +70,15 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
|
||||||
// This takes a while, launch a new thread
|
// This takes a while, launch a new thread
|
||||||
Task.Run(() => PostStatusMessage(JToken.FromObject(new SystemMonitorStateMessage
|
Task.Run(() => PostStatusMessage(JToken.FromObject(new SystemMonitorStateMessage
|
||||||
{
|
{
|
||||||
|
|
||||||
TimeZone = systemMonitor.TimeZoneFeedback.IntValue,
|
TimeZone = systemMonitor.TimeZoneFeedback.IntValue,
|
||||||
TimeZoneName = systemMonitor.TimeZoneTextFeedback.StringValue,
|
TimeZoneName = systemMonitor.TimeZoneTextFeedback.StringValue,
|
||||||
IoControllerVersion = systemMonitor.IoControllerVersionFeedback.StringValue,
|
IoControllerVersion = systemMonitor.IoControllerVersionFeedback.StringValue,
|
||||||
SnmpVersion = systemMonitor.SnmpVersionFeedback.StringValue,
|
SnmpVersion = systemMonitor.SnmpVersionFeedback.StringValue,
|
||||||
BacnetVersion = systemMonitor.BaCnetAppVersionFeedback.StringValue,
|
BacnetVersion = systemMonitor.BaCnetAppVersionFeedback.StringValue,
|
||||||
ControllerVersion = systemMonitor.ControllerVersionFeedback.StringValue
|
ControllerVersion = systemMonitor.ControllerVersionFeedback.StringValue
|
||||||
})
|
})
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
private void CurrentInputFeedbackOnOutputChange(object sender, FeedbackEventArgs feedbackEventArgs)
|
private void CurrentInputFeedbackOnOutputChange(object sender, FeedbackEventArgs feedbackEventArgs)
|
||||||
{
|
{
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
currentInput = feedbackEventArgs.StringValue
|
currentInput = feedbackEventArgs.StringValue
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,18 +66,18 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
private void IsWarmingFeedbackOnOutputChange(object sender, FeedbackEventArgs feedbackEventArgs)
|
private void IsWarmingFeedbackOnOutputChange(object sender, FeedbackEventArgs feedbackEventArgs)
|
||||||
{
|
{
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
isWarming = feedbackEventArgs.BoolValue
|
isWarming = feedbackEventArgs.BoolValue
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void IsCoolingFeedbackOnOutputChange(object sender, FeedbackEventArgs feedbackEventArgs)
|
private void IsCoolingFeedbackOnOutputChange(object sender, FeedbackEventArgs feedbackEventArgs)
|
||||||
{
|
{
|
||||||
PostStatusMessage(JToken.FromObject(new
|
PostStatusMessage(JToken.FromObject(new
|
||||||
{
|
{
|
||||||
isCooling = feedbackEventArgs.BoolValue
|
isCooling = feedbackEventArgs.BoolValue
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a room whose configuration is derived from runtime data,
|
/// Represents a room whose configuration is derived from runtime data,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using PepperDash.Essentials.Core.Web.RequestHandlers;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
|
|
@ -13,9 +8,10 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public IMobileControlMessenger Messenger { get; private set; }
|
public IMobileControlMessenger Messenger { get; private set; }
|
||||||
|
|
||||||
public Action<string, string, JToken> Action {get; private set; }
|
public Action<string, string, JToken> Action { get; private set; }
|
||||||
|
|
||||||
public MobileControlAction(IMobileControlMessenger messenger, Action<string,string, JToken> handler) {
|
public MobileControlAction(IMobileControlMessenger messenger, Action<string, string, JToken> handler)
|
||||||
|
{
|
||||||
Messenger = messenger;
|
Messenger = messenger;
|
||||||
Action = handler;
|
Action = handler;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using PepperDash.Core.Logging;
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Room.MobileControl;
|
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,22 @@
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.MobileControl
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class MobileControlFactory
|
public class MobileControlFactory
|
||||||
{
|
{
|
||||||
public MobileControlFactory() {
|
public MobileControlFactory()
|
||||||
|
{
|
||||||
var assembly = Assembly.GetExecutingAssembly();
|
var assembly = Assembly.GetExecutingAssembly();
|
||||||
|
|
||||||
PluginLoader.SetEssentialsAssembly(assembly.GetName().Name, assembly);
|
PluginLoader.SetEssentialsAssembly(assembly.GetName().Name, assembly);
|
||||||
|
|
||||||
var types = assembly.GetTypes().Where(t => typeof(IDeviceFactory).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract);
|
var types = assembly.GetTypes().Where(t => typeof(IDeviceFactory).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract);
|
||||||
|
|
||||||
if(types == null)
|
if (types == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,9 @@
|
||||||
using System;
|
using Crestron.SimplSharp;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharp.Net.Http;
|
using Crestron.SimplSharp.Net.Http;
|
||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Org.BouncyCastle.Crypto.Prng;
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Logging;
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.AppServer;
|
using PepperDash.Essentials.AppServer;
|
||||||
|
|
@ -32,9 +25,16 @@ using PepperDash.Essentials.Devices.Common.Displays;
|
||||||
using PepperDash.Essentials.Devices.Common.SoftCodec;
|
using PepperDash.Essentials.Devices.Common.SoftCodec;
|
||||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
using PepperDash.Essentials.Room.MobileControl;
|
using PepperDash.Essentials.Room.MobileControl;
|
||||||
|
using PepperDash.Essentials.RoomBridges;
|
||||||
using PepperDash.Essentials.Services;
|
using PepperDash.Essentials.Services;
|
||||||
using PepperDash.Essentials.WebApiHandlers;
|
using PepperDash.Essentials.WebApiHandlers;
|
||||||
using Serilog.Events;
|
using PepperDash.Essentials.WebSocketServer;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using WebSocketSharp;
|
using WebSocketSharp;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
|
|
@ -222,7 +222,7 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
_roomCombiner = DeviceManager.AllDevices.OfType<IEssentialsRoomCombiner>().FirstOrDefault();
|
_roomCombiner = DeviceManager.AllDevices.OfType<IEssentialsRoomCombiner>().FirstOrDefault();
|
||||||
|
|
||||||
if(_roomCombiner == null)
|
if (_roomCombiner == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_roomCombiner.RoomCombinationScenarioChanged += OnRoomCombinationScenarioChanged;
|
_roomCombiner.RoomCombinationScenarioChanged += OnRoomCombinationScenarioChanged;
|
||||||
|
|
@ -425,26 +425,26 @@ namespace PepperDash.Essentials
|
||||||
var presetsDevice = device as ITvPresetsProvider;
|
var presetsDevice = device as ITvPresetsProvider;
|
||||||
|
|
||||||
|
|
||||||
this.LogVerbose(
|
this.LogVerbose(
|
||||||
"Adding ITvPresetsProvider for {deviceKey}",
|
"Adding ITvPresetsProvider for {deviceKey}",
|
||||||
device.Key
|
device.Key
|
||||||
);
|
);
|
||||||
|
|
||||||
var presetsMessenger = new DevicePresetsModelMessenger(
|
var presetsMessenger = new DevicePresetsModelMessenger(
|
||||||
$"{device.Key}-presets-{Key}",
|
$"{device.Key}-presets-{Key}",
|
||||||
$"/device/{device.Key}",
|
$"/device/{device.Key}",
|
||||||
presetsDevice
|
presetsDevice
|
||||||
);
|
);
|
||||||
|
|
||||||
AddDefaultDeviceMessenger(presetsMessenger);
|
AddDefaultDeviceMessenger(presetsMessenger);
|
||||||
|
|
||||||
messengerAdded = true;
|
messengerAdded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (device is DisplayBase)
|
if (device is DisplayBase)
|
||||||
{
|
{
|
||||||
this.LogVerbose( "Adding actions for device: {0}", device.Key);
|
this.LogVerbose("Adding actions for device: {0}", device.Key);
|
||||||
|
|
||||||
var dbMessenger = new DisplayBaseMessenger(
|
var dbMessenger = new DisplayBaseMessenger(
|
||||||
$"{device.Key}-displayBase-{Key}",
|
$"{device.Key}-displayBase-{Key}",
|
||||||
|
|
@ -476,10 +476,10 @@ namespace PepperDash.Essentials
|
||||||
if (device is IBasicVolumeWithFeedback)
|
if (device is IBasicVolumeWithFeedback)
|
||||||
{
|
{
|
||||||
var deviceKey = device.Key;
|
var deviceKey = device.Key;
|
||||||
this.LogVerbose(
|
this.LogVerbose(
|
||||||
"Adding IBasicVolumeControlWithFeedback for {deviceKey}",
|
"Adding IBasicVolumeControlWithFeedback for {deviceKey}",
|
||||||
deviceKey
|
deviceKey
|
||||||
);
|
);
|
||||||
|
|
||||||
var volControlDevice = device as IBasicVolumeWithFeedback;
|
var volControlDevice = device as IBasicVolumeWithFeedback;
|
||||||
var messenger = new DeviceVolumeMessenger(
|
var messenger = new DeviceVolumeMessenger(
|
||||||
|
|
@ -535,7 +535,7 @@ namespace PepperDash.Essentials
|
||||||
if (device is VideoCodecBase codec)
|
if (device is VideoCodecBase codec)
|
||||||
{
|
{
|
||||||
this.LogVerbose(
|
this.LogVerbose(
|
||||||
"Adding VideoCodecBaseMessenger for {deviceKey}", codec.Key );
|
"Adding VideoCodecBaseMessenger for {deviceKey}", codec.Key);
|
||||||
|
|
||||||
var messenger = new VideoCodecBaseMessenger(
|
var messenger = new VideoCodecBaseMessenger(
|
||||||
$"{codec.Key}-videoCodec-{Key}",
|
$"{codec.Key}-videoCodec-{Key}",
|
||||||
|
|
@ -571,7 +571,7 @@ namespace PepperDash.Essentials
|
||||||
"Adding ISetTopBoxControlMessenger for {deviceKey}"
|
"Adding ISetTopBoxControlMessenger for {deviceKey}"
|
||||||
);
|
);
|
||||||
|
|
||||||
var dev = device as Device;
|
var dev = device as Device;
|
||||||
|
|
||||||
var messenger = new ISetTopBoxControlsMessenger(
|
var messenger = new ISetTopBoxControlsMessenger(
|
||||||
$"{device.Key}-stb-{Key}",
|
$"{device.Key}-stb-{Key}",
|
||||||
|
|
@ -639,7 +639,7 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (device is INumericKeypad)
|
if (device is INumericKeypad)
|
||||||
{
|
{
|
||||||
this.LogVerbose("Adding INumericKeyapdMessenger for {deviceKey}", device.Key);
|
this.LogVerbose("Adding INumericKeyapdMessenger for {deviceKey}", device.Key);
|
||||||
|
|
||||||
var dev = device as PepperDash.Core.Device;
|
var dev = device as PepperDash.Core.Device;
|
||||||
|
|
||||||
|
|
@ -709,7 +709,7 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (device is IHasCurrentSourceInfoChange)
|
if (device is IHasCurrentSourceInfoChange)
|
||||||
{
|
{
|
||||||
this.LogVerbose("Adding IHasCurrentSourceInfoMessenger for {deviceKey}", device.Key );
|
this.LogVerbose("Adding IHasCurrentSourceInfoMessenger for {deviceKey}", device.Key);
|
||||||
|
|
||||||
var messenger = new IHasCurrentSourceInfoMessenger(
|
var messenger = new IHasCurrentSourceInfoMessenger(
|
||||||
$"{device.Key}-currentSource-{Key}",
|
$"{device.Key}-currentSource-{Key}",
|
||||||
|
|
@ -942,7 +942,7 @@ namespace PepperDash.Essentials
|
||||||
messengerAdded = true;
|
messengerAdded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device is IDspPresets dspPresets)
|
if (device is IDspPresets dspPresets)
|
||||||
{
|
{
|
||||||
this.LogVerbose("Adding IDspPresetsMessenger for {deviceKey}", device.Key
|
this.LogVerbose("Adding IDspPresetsMessenger for {deviceKey}", device.Key
|
||||||
);
|
);
|
||||||
|
|
@ -958,13 +958,11 @@ namespace PepperDash.Essentials
|
||||||
messengerAdded = true;
|
messengerAdded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.LogVerbose("Trying to cast to generic device for device: {key}", device.Key );
|
this.LogVerbose("Trying to cast to generic device for device: {key}", device.Key);
|
||||||
|
|
||||||
if (device is EssentialsDevice)
|
if (device is EssentialsDevice)
|
||||||
{
|
{
|
||||||
var genericDevice = device as EssentialsDevice;
|
if (!(device is EssentialsDevice genericDevice) || messengerAdded)
|
||||||
|
|
||||||
if (genericDevice == null || messengerAdded)
|
|
||||||
{
|
{
|
||||||
this.LogVerbose(
|
this.LogVerbose(
|
||||||
"Skipping GenericMessenger for {deviceKey}. Messenger(s) Added: {messengersAdded}.",
|
"Skipping GenericMessenger for {deviceKey}. Messenger(s) Added: {messengersAdded}.",
|
||||||
|
|
@ -1617,8 +1615,8 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (Config.EnableApiServer)
|
if (Config.EnableApiServer)
|
||||||
{
|
{
|
||||||
CrestronConsole.ConsoleCommandResponse(
|
CrestronConsole.ConsoleCommandResponse(
|
||||||
@"Mobile Control Edge Server API Information:
|
@"Mobile Control Edge Server API Information:
|
||||||
|
|
||||||
Server address: {0}
|
Server address: {0}
|
||||||
System Name: {1}
|
System Name: {1}
|
||||||
|
|
@ -1627,14 +1625,14 @@ namespace PepperDash.Essentials
|
||||||
System User code: {4}
|
System User code: {4}
|
||||||
Connected?: {5}
|
Connected?: {5}
|
||||||
Seconds Since Last Ack: {6}",
|
Seconds Since Last Ack: {6}",
|
||||||
url,
|
url,
|
||||||
name,
|
name,
|
||||||
ConfigReader.ConfigObject.SystemUrl,
|
ConfigReader.ConfigObject.SystemUrl,
|
||||||
SystemUuid,
|
SystemUuid,
|
||||||
code,
|
code,
|
||||||
conn,
|
conn,
|
||||||
secSinceLastAck.Seconds
|
secSinceLastAck.Seconds
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1960,17 +1958,16 @@ Mobile Control Direct Server Infromation:
|
||||||
confObject.Info.RuntimeInfo.AssemblyVersion = essentialsVersion;
|
confObject.Info.RuntimeInfo.AssemblyVersion = essentialsVersion;
|
||||||
|
|
||||||
|
|
||||||
// // Set for local testing
|
// // Set for local testing
|
||||||
// confObject.RuntimeInfo.PluginVersion = "4.0.0-localBuild";
|
// confObject.RuntimeInfo.PluginVersion = "4.0.0-localBuild";
|
||||||
|
|
||||||
// Populate the plugin version
|
// Populate the plugin version
|
||||||
var pluginVersion = Assembly
|
var pluginVersion = Assembly
|
||||||
.GetExecutingAssembly()
|
.GetExecutingAssembly()
|
||||||
.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
|
.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
|
||||||
|
|
||||||
var fullVersionAtt = pluginVersion[0] as AssemblyInformationalVersionAttribute;
|
|
||||||
|
|
||||||
if (fullVersionAtt != null)
|
if (pluginVersion[0] is AssemblyInformationalVersionAttribute fullVersionAtt)
|
||||||
{
|
{
|
||||||
var pluginInformationalVersion = fullVersionAtt.InformationalVersion;
|
var pluginInformationalVersion = fullVersionAtt.InformationalVersion;
|
||||||
|
|
||||||
|
|
@ -2003,7 +2000,7 @@ Mobile Control Direct Server Infromation:
|
||||||
if (Config.EnableApiServer)
|
if (Config.EnableApiServer)
|
||||||
{
|
{
|
||||||
|
|
||||||
_transmitToServerQueue.Enqueue(new TransmitMessage(o, _wsClient2));
|
_transmitToServerQueue.Enqueue(new TransmitMessage(o, _wsClient2));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2142,7 +2139,6 @@ Mobile Control Direct Server Infromation:
|
||||||
{
|
{
|
||||||
var clientId = content["clientId"].Value<string>();
|
var clientId = content["clientId"].Value<string>();
|
||||||
var roomKey = content["roomKey"].Value<string>();
|
var roomKey = content["roomKey"].Value<string>();
|
||||||
var touchpanelKey = content.SelectToken("touchpanelKey"); //content["touchpanelKey"].Value<string>();
|
|
||||||
|
|
||||||
if (_roomCombiner == null)
|
if (_roomCombiner == null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,11 @@
|
||||||
<EmbeddedResource Remove="bin\**" />
|
<EmbeddedResource Remove="bin\**" />
|
||||||
<None Remove="bin\**" />
|
<None Remove="bin\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="MobileControlSimplDeviceBridge.cs" />
|
||||||
|
<Compile Remove="RoomBridges\MobileControlSIMPLRoomBridge.cs" />
|
||||||
|
<Compile Remove="RoomBridges\SourceDeviceMapDictionary.cs" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.21.90" />
|
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.21.90" />
|
||||||
<PackageReference Include="PepperDashCore" Version="2.0.1" />
|
<PackageReference Include="PepperDashCore" Version="2.0.1" />
|
||||||
|
|
@ -48,15 +53,15 @@
|
||||||
<None Remove="C:\Users\awelker\source\Essentials\Essentials\src\PepperDash.Essentials.MobileControl\bin\Debug\net472\PepperDash.Essentials.MobileControl.4.0.0-local.net472.cplz" />
|
<None Remove="C:\Users\awelker\source\Essentials\Essentials\src\PepperDash.Essentials.MobileControl\bin\Debug\net472\PepperDash.Essentials.MobileControl.4.0.0-local.net472.cplz" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" >
|
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<ExcludeAssets>runtime</ExcludeAssets>
|
<ExcludeAssets>runtime</ExcludeAssets>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\PepperDash.Essentials.Devices.Common\PepperDash.Essentials.Devices.Common.csproj" >
|
<ProjectReference Include="..\PepperDash.Essentials.Devices.Common\PepperDash.Essentials.Devices.Common.csproj">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<ExcludeAssets>runtime</ExcludeAssets>
|
<ExcludeAssets>runtime</ExcludeAssets>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\PepperDash.Essentials.MobileControl.Messengers\PepperDash.Essentials.MobileControl.Messengers.csproj" >
|
<ProjectReference Include="..\PepperDash.Essentials.MobileControl.Messengers\PepperDash.Essentials.MobileControl.Messengers.csproj">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<ExcludeAssets>runtime</ExcludeAssets>
|
<ExcludeAssets>runtime</ExcludeAssets>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials.RoomBridges
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|
@ -102,12 +103,12 @@ namespace PepperDash.Essentials
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void UserCodeChange()
|
protected virtual void UserCodeChange()
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Server user code changed: {0}", UserCode);
|
this.LogDebug("Server user code changed: {userCode}", UserCode);
|
||||||
|
|
||||||
var qrUrl = string.Format($"{Parent.Host}/api/rooms/{Parent.SystemUuid}/{RoomKey}/qr?x={new Random().Next()}");
|
var qrUrl = string.Format($"{Parent.Host}/api/rooms/{Parent.SystemUuid}/{RoomKey}/qr?x={new Random().Next()}");
|
||||||
QrCodeUrl = qrUrl;
|
QrCodeUrl = qrUrl;
|
||||||
|
|
||||||
Debug.Console(1, this, "Server user code changed: {0} - {1}", UserCode, qrUrl);
|
this.LogDebug("Server user code changed: {userCode} - {qrCodeUrl}", UserCode, qrUrl);
|
||||||
|
|
||||||
OnUserCodeChanged();
|
OnUserCodeChanged();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
using PepperDash.Essentials.Devices.Common.Room;
|
using PepperDash.Essentials.Devices.Common.Room;
|
||||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
using PepperDash.Essentials.WebSocketServer;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using IShades = PepperDash.Essentials.Core.Shades.IShades;
|
using IShades = PepperDash.Essentials.Core.Shades.IShades;
|
||||||
using ShadeBase = PepperDash.Essentials.Devices.Common.Shades.ShadeBase;
|
using ShadeBase = PepperDash.Essentials.Devices.Common.Shades.ShadeBase;
|
||||||
using Volume = PepperDash.Essentials.Room.MobileControl.Volume;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials.RoomBridges
|
||||||
{
|
{
|
||||||
public class MobileControlEssentialsRoomBridge : MobileControlBridgeBase
|
public class MobileControlEssentialsRoomBridge : MobileControlBridgeBase
|
||||||
{
|
{
|
||||||
|
|
@ -339,7 +339,7 @@ namespace PepperDash.Essentials
|
||||||
string shareText;
|
string shareText;
|
||||||
bool isSharing;
|
bool isSharing;
|
||||||
|
|
||||||
if (Room is IHasCurrentSourceInfoChange srcInfoRoom && (Room is IHasVideoCodec vcRoom && (vcRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue && srcInfoRoom.CurrentSourceInfo != null)))
|
if (Room is IHasCurrentSourceInfoChange srcInfoRoom && Room is IHasVideoCodec vcRoom && vcRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue && srcInfoRoom.CurrentSourceInfo != null)
|
||||||
{
|
{
|
||||||
shareText = srcInfoRoom.CurrentSourceInfo.PreferredName;
|
shareText = srcInfoRoom.CurrentSourceInfo.PreferredName;
|
||||||
isSharing = true;
|
isSharing = true;
|
||||||
|
|
@ -532,7 +532,8 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
} catch (Exception ex)
|
}
|
||||||
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Error getting full status", this);
|
Debug.LogMessage(ex, "Error getting full status", this);
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -560,7 +561,7 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
var zrcTp = DeviceManager.AllDevices.OfType<IMobileControlTouchpanelController>().SingleOrDefault((tp) => tp.ZoomRoomController);
|
var zrcTp = DeviceManager.AllDevices.OfType<IMobileControlTouchpanelController>().SingleOrDefault((tp) => tp.ZoomRoomController);
|
||||||
|
|
||||||
configuration.ZoomRoomControllerKey = zrcTp != null ? zrcTp.Key : null;
|
configuration.ZoomRoomControllerKey = zrcTp?.Key;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
@ -578,7 +579,7 @@ namespace PepperDash.Essentials
|
||||||
// find the room combiner for this room by checking if the room is in the list of rooms for the room combiner
|
// find the room combiner for this room by checking if the room is in the list of rooms for the room combiner
|
||||||
var roomCombiner = DeviceManager.AllDevices.OfType<IEssentialsRoomCombiner>().FirstOrDefault();
|
var roomCombiner = DeviceManager.AllDevices.OfType<IEssentialsRoomCombiner>().FirstOrDefault();
|
||||||
|
|
||||||
configuration.RoomCombinerKey = roomCombiner != null ? roomCombiner.Key : null;
|
configuration.RoomCombinerKey = roomCombiner?.Key;
|
||||||
|
|
||||||
|
|
||||||
if (room is IEssentialsRoomPropertiesConfig propertiesConfig)
|
if (room is IEssentialsRoomPropertiesConfig propertiesConfig)
|
||||||
|
|
@ -620,7 +621,8 @@ namespace PepperDash.Essentials
|
||||||
configuration.VideoCodecKey = vcRoom.VideoCodec.Key;
|
configuration.VideoCodecKey = vcRoom.VideoCodec.Key;
|
||||||
configuration.VideoCodecIsZoomRoom = type.Name.Equals("ZoomRoom", StringComparison.InvariantCultureIgnoreCase);
|
configuration.VideoCodecIsZoomRoom = type.Name.Equals("ZoomRoom", StringComparison.InvariantCultureIgnoreCase);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
;
|
||||||
|
|
||||||
if (room is IHasAudioCodec acRoom)
|
if (room is IHasAudioCodec acRoom)
|
||||||
{
|
{
|
||||||
|
|
@ -655,7 +657,7 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
eEnvironmentalDeviceTypes type = eEnvironmentalDeviceTypes.None;
|
eEnvironmentalDeviceTypes type = eEnvironmentalDeviceTypes.None;
|
||||||
|
|
||||||
if (dev is ILightingScenes || dev is Devices.Common.Lighting.LightingBase)
|
if (dev is ILightingScenes)
|
||||||
{
|
{
|
||||||
type = eEnvironmentalDeviceTypes.Lighting;
|
type = eEnvironmentalDeviceTypes.Lighting;
|
||||||
}
|
}
|
||||||
|
|
@ -871,7 +873,7 @@ namespace PepperDash.Essentials
|
||||||
public Dictionary<string, SourceListItem> SourceList { get; set; }
|
public Dictionary<string, SourceListItem> SourceList { get; set; }
|
||||||
|
|
||||||
[JsonProperty("destinationList", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("destinationList", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public Dictionary<string, DestinationListItem> DestinationList { get; set;}
|
public Dictionary<string, DestinationListItem> DestinationList { get; set; }
|
||||||
|
|
||||||
[JsonProperty("audioControlPointList", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("audioControlPointList", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public AudioControlPointListItem AudioControlPointList { get; set; }
|
public AudioControlPointListItem AudioControlPointList { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ namespace PepperDash.Essentials.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
return authResponse;
|
return authResponse;
|
||||||
} catch(Exception ex)
|
}
|
||||||
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Error authorizing with Mobile Control");
|
Debug.LogMessage(ex, "Error authorizing with Mobile Control");
|
||||||
return new AuthorizationResponse { Authorized = false, Reason = ex.Message };
|
return new AuthorizationResponse { Authorized = false, Reason = ex.Message };
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,8 @@
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Touchpanel
|
namespace PepperDash.Essentials.Touchpanel
|
||||||
{
|
{
|
||||||
public interface ITheme:IKeyed
|
public interface ITheme : IKeyed
|
||||||
{
|
{
|
||||||
string Theme { get; }
|
string Theme { get; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Logging;
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Touchpanel
|
namespace PepperDash.Essentials.Touchpanel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Logging;
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Touchpanel
|
namespace PepperDash.Essentials.Touchpanel
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,12 @@ using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.DeviceInfo;
|
using PepperDash.Essentials.Core.DeviceInfo;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using PepperDash.Essentials.Core.UI;
|
using PepperDash.Essentials.Core.UI;
|
||||||
using PepperDash.Essentials.Touchpanel;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.TouchPanel
|
namespace PepperDash.Essentials.Touchpanel
|
||||||
{
|
{
|
||||||
//public interface IMobileControlTouchpanelController
|
//public interface IMobileControlTouchpanelController
|
||||||
//{
|
//{
|
||||||
|
|
@ -75,7 +74,7 @@ namespace PepperDash.Essentials.Devices.Common.TouchPanel
|
||||||
|
|
||||||
AddPostActivationAction(SubscribeForMobileControlUpdates);
|
AddPostActivationAction(SubscribeForMobileControlUpdates);
|
||||||
|
|
||||||
ThemeFeedback = new StringFeedback($"{Key}-theme",() => Theme);
|
ThemeFeedback = new StringFeedback($"{Key}-theme", () => Theme);
|
||||||
AppUrlFeedback = new StringFeedback($"{Key}-appUrl", () => _appUrl);
|
AppUrlFeedback = new StringFeedback($"{Key}-appUrl", () => _appUrl);
|
||||||
QrCodeUrlFeedback = new StringFeedback($"{Key}-qrCodeUrl", () => _bridge?.QrCodeUrl);
|
QrCodeUrlFeedback = new StringFeedback($"{Key}-qrCodeUrl", () => _bridge?.QrCodeUrl);
|
||||||
McServerUrlFeedback = new StringFeedback($"{Key}-mcServerUrl", () => _bridge?.McServerUrl);
|
McServerUrlFeedback = new StringFeedback($"{Key}-mcServerUrl", () => _bridge?.McServerUrl);
|
||||||
|
|
@ -357,8 +356,9 @@ namespace PepperDash.Essentials.Devices.Common.TouchPanel
|
||||||
_bridge = bridge;
|
_bridge = bridge;
|
||||||
|
|
||||||
_bridge.UserCodeChanged += UpdateFeedbacks;
|
_bridge.UserCodeChanged += UpdateFeedbacks;
|
||||||
_bridge.AppUrlChanged += (s, a) => {
|
_bridge.AppUrlChanged += (s, a) =>
|
||||||
this.LogInformation("AppURL changed");
|
{
|
||||||
|
this.LogInformation("AppURL changed");
|
||||||
SetAppUrl(_bridge.AppUrl);
|
SetAppUrl(_bridge.AppUrl);
|
||||||
UpdateFeedbacks(s, a);
|
UpdateFeedbacks(s, a);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.TouchPanel
|
namespace PepperDash.Essentials.Touchpanel
|
||||||
{
|
{
|
||||||
public class MobileControlTouchpanelProperties : CrestronTouchpanelPropertiesConfig
|
public class MobileControlTouchpanelProperties : CrestronTouchpanelPropertiesConfig
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@ namespace PepperDash.Essentials.Touchpanel
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Setting theme to {theme}", this, theme.Value);
|
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Setting theme to {theme}", this, theme.Value);
|
||||||
_tpDevice.UpdateTheme(theme.Value);
|
_tpDevice.UpdateTheme(theme.Value);
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(new {theme = theme.Value}));
|
PostStatusMessage(JToken.FromObject(new { theme = theme.Value }));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ThemeUpdateMessage:DeviceStateMessageBase
|
public class ThemeUpdateMessage : DeviceStateMessageBase
|
||||||
{
|
{
|
||||||
[JsonProperty("theme")]
|
[JsonProperty("theme")]
|
||||||
public string Theme { get; set; }
|
public string Theme { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using PepperDash.Core;
|
||||||
using PepperDash.Core.Logging;
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core.Queues;
|
using PepperDash.Essentials.Core.Queues;
|
||||||
|
using PepperDash.Essentials.WebSocketServer;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
@ -89,7 +90,7 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(_server == null)
|
if (_server == null)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(LogEventLevel.Warning, "Cannot send message. Server is null");
|
Debug.LogMessage(LogEventLevel.Warning, "Cannot send message. Server is null");
|
||||||
return;
|
return;
|
||||||
|
|
@ -110,9 +111,9 @@ namespace PepperDash.Essentials
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_server.SendMessageToAllClients(message);
|
_server.SendMessageToAllClients(message);
|
||||||
|
|
||||||
_server.LogVerbose("Message TX To all clients: {message}", null, message);
|
_server.LogVerbose("Message TX To all clients: {message}", null, message);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -123,7 +124,7 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex,"Caught an exception in the Transmit Processor");
|
Debug.LogMessage(ex, "Caught an exception in the Transmit Processor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class UserCodeChangedContent
|
public class UserCodeChangedContent
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Room.MobileControl
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class Volumes
|
public class Volumes
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
using PepperDash.Essentials.AppServer.Messengers;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
|
@ -33,7 +32,7 @@ namespace PepperDash.Essentials.WebApiHandlers
|
||||||
private readonly MobileControlSystemController mcController;
|
private readonly MobileControlSystemController mcController;
|
||||||
|
|
||||||
[JsonProperty("actionPaths")]
|
[JsonProperty("actionPaths")]
|
||||||
public List<ActionPath> ActionPaths => mcController.GetActionDictionaryPaths().Select((path) => new ActionPath { MessengerKey = path.Item1, Path = path.Item2}).ToList();
|
public List<ActionPath> ActionPaths => mcController.GetActionDictionaryPaths().Select((path) => new ActionPath { MessengerKey = path.Item1, Path = path.Item2 }).ToList();
|
||||||
|
|
||||||
public ActionPathsResponse(MobileControlSystemController mcController)
|
public ActionPathsResponse(MobileControlSystemController mcController)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.WebSocketServer;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -30,8 +31,7 @@ namespace PepperDash.Essentials.WebApiHandlers
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.Console(1, $"exception showing mobile info: {ex.Message}");
|
Debug.LogMessage(ex, "exception showing mobile info");
|
||||||
Debug.Console(2, $"stack trace: {ex.StackTrace}");
|
|
||||||
|
|
||||||
context.Response.StatusCode = 500;
|
context.Response.StatusCode = 500;
|
||||||
context.Response.End();
|
context.Response.End();
|
||||||
|
|
@ -143,7 +143,7 @@ namespace PepperDash.Essentials.WebApiHandlers
|
||||||
public string Token => Key;
|
public string Token => Key;
|
||||||
|
|
||||||
[JsonProperty("connected")]
|
[JsonProperty("connected")]
|
||||||
public bool Connected => context.Client == null ? false : context.Client.Context.WebSocket.IsAlive;
|
public bool Connected => context.Client != null && context.Client.Context.WebSocket.IsAlive;
|
||||||
|
|
||||||
[JsonProperty("duration")]
|
[JsonProperty("duration")]
|
||||||
public double Duration => context.Client == null ? 0 : context.Client.ConnectedDuration.TotalSeconds;
|
public double Duration => context.Client == null ? 0 : context.Client.ConnectedDuration.TotalSeconds;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
using PepperDash.Essentials.Core.Web;
|
using PepperDash.Essentials.Core.Web;
|
||||||
|
using PepperDash.Essentials.WebSocketServer;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.WebApiHandlers
|
namespace PepperDash.Essentials.WebApiHandlers
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using PepperDash.Essentials.AppServer.Messengers;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using PepperDash.Essentials.Core.Web;
|
using PepperDash.Essentials.Core.Web;
|
||||||
|
using PepperDash.Essentials.RoomBridges;
|
||||||
using PepperDash.Essentials.WebApiHandlers;
|
using PepperDash.Essentials.WebApiHandlers;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -23,7 +24,7 @@ using WebSocketSharp.Server;
|
||||||
using ErrorEventArgs = WebSocketSharp.ErrorEventArgs;
|
using ErrorEventArgs = WebSocketSharp.ErrorEventArgs;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials.WebSocketServer
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the behaviour to associate with a UiClient for WebSocket communication
|
/// Represents the behaviour to associate with a UiClient for WebSocket communication
|
||||||
|
|
@ -255,14 +256,14 @@ namespace PepperDash.Essentials
|
||||||
Port = customPort;
|
Port = customPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parent.Config.DirectServer.AutomaticallyForwardPortToCSLAN == true)
|
if (parent.Config.DirectServer.AutomaticallyForwardPortToCSLAN == true)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(EthernetAdapterType.EthernetCSAdapter);
|
CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(EthernetAdapterType.EthernetCSAdapter);
|
||||||
|
|
||||||
|
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Automatically forwarding port {0} to CS LAN", Port);
|
Debug.LogMessage(LogEventLevel.Information, "Automatically forwarding port {0} to CS LAN", Port);
|
||||||
|
|
||||||
var csAdapterId = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(EthernetAdapterType.EthernetCSAdapter);
|
var csAdapterId = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(EthernetAdapterType.EthernetCSAdapter);
|
||||||
var csIp = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, csAdapterId);
|
var csIp = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, csAdapterId);
|
||||||
|
|
@ -271,12 +272,12 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (result != CrestronEthernetHelper.PortForwardingUserPatRetCodes.NoErr)
|
if (result != CrestronEthernetHelper.PortForwardingUserPatRetCodes.NoErr)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Error, "Error adding port forwarding: {0}", result);
|
Debug.LogMessage(LogEventLevel.Error, "Error adding port forwarding: {0}", result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "This processor does not have a CS LAN", this);
|
Debug.LogMessage(LogEventLevel.Information, "This processor does not have a CS LAN", this);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -351,7 +352,7 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (_server.IsListening)
|
if (_server.IsListening)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Mobile Control WebSocket Server listening on port {port}", this, _server.Port);
|
Debug.LogMessage(LogEventLevel.Information, "Mobile Control WebSocket Server listening on port {port}", this, _server.Port);
|
||||||
}
|
}
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += OnProgramStop;
|
CrestronEnvironment.ProgramStatusEventHandler += OnProgramStop;
|
||||||
|
|
@ -537,7 +538,7 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Error getting application configuration", this);
|
Debug.LogMessage(ex, "Error getting application configuration", this);
|
||||||
|
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Config Object: {config} from {parentConfig}", this, config, _parent.Config);
|
Debug.LogMessage(LogEventLevel.Verbose, "Config Object: {config} from {parentConfig}", this, config, _parent.Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
|
|
@ -558,9 +559,9 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (secret != null)
|
if (secret != null)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Secret successfully retrieved", this);
|
Debug.LogMessage(LogEventLevel.Information, "Secret successfully retrieved", this);
|
||||||
|
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Debug, "Secret: {0}", this, secret.Value.ToString());
|
Debug.LogMessage(LogEventLevel.Debug, "Secret: {0}", this, secret.Value.ToString());
|
||||||
|
|
||||||
|
|
||||||
// populate the local secrets object
|
// populate the local secrets object
|
||||||
|
|
@ -571,17 +572,17 @@ namespace PepperDash.Essentials
|
||||||
// populate the _uiClient collection
|
// populate the _uiClient collection
|
||||||
foreach (var token in _secret.Tokens)
|
foreach (var token in _secret.Tokens)
|
||||||
{
|
{
|
||||||
if(token.Value == null)
|
if (token.Value == null)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Warning, "Token value is null", this);
|
Debug.LogMessage(LogEventLevel.Warning, "Token value is null", this);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Adding token: {0} for room: {1}", this, token.Key, token.Value.RoomKey);
|
Debug.LogMessage(LogEventLevel.Information, "Adding token: {0} for room: {1}", this, token.Key, token.Value.RoomKey);
|
||||||
|
|
||||||
if(UiClients == null)
|
if (UiClients == null)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Warning, "UiClients is null", this);
|
Debug.LogMessage(LogEventLevel.Warning, "UiClients is null", this);
|
||||||
UiClients = new Dictionary<string, UiClientContext>();
|
UiClients = new Dictionary<string, UiClientContext>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -591,7 +592,7 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (UiClients.Count > 0)
|
if (UiClients.Count > 0)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Restored {uiClientCount} UiClients from secrets data", this, UiClients.Count);
|
Debug.LogMessage(LogEventLevel.Information, "Restored {uiClientCount} UiClients from secrets data", this, UiClients.Count);
|
||||||
|
|
||||||
foreach (var client in UiClients)
|
foreach (var client in UiClients)
|
||||||
{
|
{
|
||||||
|
|
@ -602,7 +603,7 @@ namespace PepperDash.Essentials
|
||||||
_server.AddWebSocketService(path, () =>
|
_server.AddWebSocketService(path, () =>
|
||||||
{
|
{
|
||||||
var c = new UiClient();
|
var c = new UiClient();
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Debug, "Constructing UiClient with id: {key}", this, key);
|
Debug.LogMessage(LogEventLevel.Debug, "Constructing UiClient with id: {key}", this, key);
|
||||||
|
|
||||||
c.Controller = _parent;
|
c.Controller = _parent;
|
||||||
c.RoomKey = roomKey;
|
c.RoomKey = roomKey;
|
||||||
|
|
@ -623,10 +624,10 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Warning, "No secret found");
|
Debug.LogMessage(LogEventLevel.Warning, "No secret found");
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Debug, "{uiClientCount} UiClients restored from secrets data", this, UiClients.Count);
|
Debug.LogMessage(LogEventLevel.Debug, "{uiClientCount} UiClients restored from secrets data", this, UiClients.Count);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -643,7 +644,7 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
if (_secret == null)
|
if (_secret == null)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Error, "Secret is null", this);
|
Debug.LogMessage(LogEventLevel.Error, "Secret is null", this);
|
||||||
|
|
||||||
_secret = new ServerTokenSecrets(string.Empty);
|
_secret = new ServerTokenSecrets(string.Empty);
|
||||||
}
|
}
|
||||||
|
|
@ -748,17 +749,17 @@ namespace PepperDash.Essentials
|
||||||
_server.AddWebSocketService(path, () =>
|
_server.AddWebSocketService(path, () =>
|
||||||
{
|
{
|
||||||
var c = new UiClient();
|
var c = new UiClient();
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Constructing UiClient with id: {0}", this, key);
|
Debug.LogMessage(LogEventLevel.Verbose, "Constructing UiClient with id: {0}", this, key);
|
||||||
c.Controller = _parent;
|
c.Controller = _parent;
|
||||||
c.RoomKey = bridge.RoomKey;
|
c.RoomKey = bridge.RoomKey;
|
||||||
UiClients[key].SetClient(c);
|
UiClients[key].SetClient(c);
|
||||||
return c;
|
return c;
|
||||||
});
|
});
|
||||||
|
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Added new WebSocket UiClient service at path: {path}", this, path);
|
Debug.LogMessage(LogEventLevel.Information, "Added new WebSocket UiClient service at path: {path}", this, path);
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Token: {@token}", this, token);
|
Debug.LogMessage(LogEventLevel.Information, "Token: {@token}", this, token);
|
||||||
|
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "{serviceCount} websocket services present", this, _server.WebSocketServices.Count);
|
Debug.LogMessage(LogEventLevel.Verbose, "{serviceCount} websocket services present", this, _server.WebSocketServices.Count);
|
||||||
|
|
||||||
UpdateSecret();
|
UpdateSecret();
|
||||||
|
|
||||||
|
|
@ -970,7 +971,7 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
this.LogException(ex, "Caught an exception in the OnPost handler");
|
this.LogException(ex, "Caught an exception in the OnPost handler");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1101,23 +1102,23 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
if (File.Exists(filePath))
|
if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
if(filePath.EndsWith(".png"))
|
if (filePath.EndsWith(".png"))
|
||||||
{
|
{
|
||||||
res.ContentType = "image/png";
|
res.ContentType = "image/png";
|
||||||
}
|
}
|
||||||
else if(filePath.EndsWith(".jpg"))
|
else if (filePath.EndsWith(".jpg"))
|
||||||
{
|
{
|
||||||
res.ContentType = "image/jpeg";
|
res.ContentType = "image/jpeg";
|
||||||
}
|
}
|
||||||
else if(filePath.EndsWith(".gif"))
|
else if (filePath.EndsWith(".gif"))
|
||||||
{
|
{
|
||||||
res.ContentType = "image/gif";
|
res.ContentType = "image/gif";
|
||||||
}
|
}
|
||||||
else if(filePath.EndsWith(".svg"))
|
else if (filePath.EndsWith(".svg"))
|
||||||
{
|
{
|
||||||
res.ContentType = "image/svg+xml";
|
res.ContentType = "image/svg+xml";
|
||||||
}
|
}
|
||||||
byte[] contents = System.IO.File.ReadAllBytes(filePath);
|
byte[] contents = File.ReadAllBytes(filePath);
|
||||||
res.ContentLength64 = contents.LongLength;
|
res.ContentLength64 = contents.LongLength;
|
||||||
res.Close(contents, true);
|
res.Close(contents, true);
|
||||||
}
|
}
|
||||||
|
|
@ -1138,9 +1139,6 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
this.LogVerbose("Requesting User app file");
|
this.LogVerbose("Requesting User app file");
|
||||||
|
|
||||||
var qp = req.QueryString;
|
|
||||||
var token = qp["token"];
|
|
||||||
|
|
||||||
string filePath = path.Split('?')[0];
|
string filePath = path.Split('?')[0];
|
||||||
|
|
||||||
// remove the token from the path if found
|
// remove the token from the path if found
|
||||||
|
|
@ -1202,10 +1200,10 @@ namespace PepperDash.Essentials
|
||||||
this.LogVerbose("Attempting to serve file: {filePath}", filePath);
|
this.LogVerbose("Attempting to serve file: {filePath}", filePath);
|
||||||
|
|
||||||
byte[] contents;
|
byte[] contents;
|
||||||
if (System.IO.File.Exists(filePath))
|
if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
this.LogVerbose("File found: {filePath}", filePath);
|
this.LogVerbose("File found: {filePath}", filePath);
|
||||||
contents = System.IO.File.ReadAllBytes(filePath);
|
contents = File.ReadAllBytes(filePath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials.WebSocketServer
|
||||||
{
|
{
|
||||||
internal class WebSocketServerSecretProvider : CrestronLocalSecretsProvider
|
internal class WebSocketServerSecretProvider : CrestronLocalSecretsProvider
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue