mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-10 10:15:01 +00:00
chore: miscellaeneous cleanup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.AppServer;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using System.Linq;
|
||||
@@ -32,7 +33,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
|
||||
if (inputPort == null)
|
||||
{
|
||||
Debug.Console(1, "No input named {0} found for device {1}", s, display.Key);
|
||||
this.LogWarning("No input named {inputName} found for {deviceKey}", s, display.Key);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class IDspPresetsMessenger : MessengerBase
|
||||
{
|
||||
private IDspPresets _device;
|
||||
private readonly IDspPresets device;
|
||||
|
||||
public IDspPresetsMessenger(string key, string messagePath, IDspPresets device)
|
||||
: base(key, messagePath, device as Device)
|
||||
: base(key, messagePath, device as IKeyName)
|
||||
{
|
||||
_device = device;
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
protected override void RegisterActions()
|
||||
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
var message = new IHasDspPresetsStateMessage
|
||||
{
|
||||
Presets = _device.Presets
|
||||
Presets = device.Presets
|
||||
};
|
||||
|
||||
PostStatusMessage(message);
|
||||
@@ -36,7 +36,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (!string.IsNullOrEmpty(presetKey))
|
||||
{
|
||||
_device.RecallPreset(presetKey);
|
||||
device.RecallPreset(presetKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -117,7 +118,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, this, "Error sending full status: {0}", e);
|
||||
this.LogException(e, "Error sending full status");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.Core;
|
||||
using System;
|
||||
|
||||
@@ -43,7 +44,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
if (!string.IsNullOrEmpty(c.SourceListKey))
|
||||
{
|
||||
// Check for source list in content of message
|
||||
Debug.Console(1, this, "sourceListKey found in message");
|
||||
sourceListKey = c.SourceListKey;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
private void SendFullStatus()
|
||||
{
|
||||
Debug.Console(2, "LightingBaseMessenger GetFullStatus");
|
||||
|
||||
var state = new LightingBaseStateMessage
|
||||
{
|
||||
Scenes = Device.LightingScenes,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using System;
|
||||
@@ -51,7 +52,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Console(0, this, "Exception saving event: {0}\r\n{1}", ex.Message, ex.StackTrace);
|
||||
this.LogException(ex,"Exception saving event");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,16 +59,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
foreach (var p in systemMonitor.ProgramStatusFeedbackCollection)
|
||||
{
|
||||
PostStatusMessage(JToken.FromObject(p.Value.ProgramInfo)
|
||||
);
|
||||
PostStatusMessage(JToken.FromObject(p.Value.ProgramInfo));
|
||||
}
|
||||
}
|
||||
|
||||
private void SendSystemMonitorStatusMessage()
|
||||
{
|
||||
Debug.Console(1, "Posting System Monitor Status Message.");
|
||||
|
||||
// This takes a while, launch a new thread
|
||||
|
||||
Task.Run(() => PostStatusMessage(JToken.FromObject(new SystemMonitorStateMessage
|
||||
{
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
@@ -111,7 +112,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (Codec is IHasDirectory dirCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Sending Directory. Directory Item Count: {0}", directory.CurrentDirectoryResults.Count);
|
||||
this.LogVerbose("Sending Directory. Directory Item Count: {directoryItemCount}", directory.CurrentDirectoryResults.Count);
|
||||
|
||||
//state.CurrentDirectory = PrefixDirectoryFolderItems(directory);
|
||||
state.CurrentDirectory = directory;
|
||||
@@ -238,7 +239,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
if (Codec is IHasCodecCameras cameraCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecCameras Actions");
|
||||
this.LogVerbose("Adding IHasCodecCameras Actions");
|
||||
|
||||
cameraCodec.CameraSelected += CameraCodec_CameraSelected;
|
||||
|
||||
@@ -254,7 +255,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (Codec is IHasCodecRoomPresets presetsCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecRoomPresets Actions");
|
||||
this.LogVerbose("Adding IHasCodecRoomPresets Actions");
|
||||
|
||||
presetsCodec.CodecRoomPresetsListHasChanged += PresetsCodec_CameraPresetsListHasChanged;
|
||||
|
||||
@@ -275,7 +276,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (Codec is IHasCameraAutoMode speakerTrackCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCameraAutoMode Actions");
|
||||
this.LogVerbose("Adding IHasCameraAutoMode Actions");
|
||||
|
||||
speakerTrackCodec.CameraAutoModeIsOnFeedback.OutputChange += CameraAutoModeIsOnFeedback_OutputChange;
|
||||
|
||||
@@ -286,7 +287,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (Codec is IHasCameraOff cameraOffCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCameraOff Actions");
|
||||
this.LogVerbose("Adding IHasCameraOff Actions");
|
||||
|
||||
cameraOffCodec.CameraIsOffFeedback.OutputChange += (CameraIsOffFeedback_OutputChange);
|
||||
|
||||
@@ -298,7 +299,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (Codec is IHasCodecSelfView selfViewCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecSelfView Actions");
|
||||
this.LogVerbose("Adding IHasCodecSelfView Actions");
|
||||
|
||||
AddAction("/cameraSelfView", (id, content) => selfViewCodec.SelfViewModeToggle());
|
||||
|
||||
@@ -308,7 +309,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (Codec is IHasCodecLayouts layoutsCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecLayouts Actions");
|
||||
this.LogVerbose("Adding IHasCodecLayouts Actions");
|
||||
|
||||
AddAction("/cameraRemoteView", (id, content) => layoutsCodec.LocalLayoutToggle());
|
||||
|
||||
@@ -317,7 +318,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
if (Codec is IPasswordPrompt pwCodec)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IPasswordPrompt Actions");
|
||||
this.LogVerbose("Adding IPasswordPrompt Actions");
|
||||
|
||||
AddAction("/password", (id, content) =>
|
||||
{
|
||||
@@ -334,7 +335,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
(sender, args) => PostReceivingContent(args.BoolValue);
|
||||
}
|
||||
|
||||
Debug.Console(2, this, "Adding Privacy & Standby Actions");
|
||||
this.LogVerbose("Adding Privacy & Standby Actions");
|
||||
|
||||
AddAction("/privacyModeOn", (id, content) => Codec.PrivacyModeOn());
|
||||
AddAction("/privacyModeOff", (id, content) => Codec.PrivacyModeOff());
|
||||
@@ -346,7 +347,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(2, this, "Error: {0}", e);
|
||||
this.LogException(e, "Exception adding paths");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,16 +26,24 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineConstants>$(DefineConstants);SERIES4</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Messengers\SIMPLAtcMessenger.cs" />
|
||||
<Compile Remove="Messengers\SIMPLCameraMessenger.cs" />
|
||||
<Compile Remove="Messengers\SIMPLDirectRouteMessenger.cs" />
|
||||
<Compile Remove="Messengers\SimplMessengerPropertiesConfig.cs" />
|
||||
<Compile Remove="Messengers\SIMPLRouteMessenger.cs" />
|
||||
<Compile Remove="Messengers\SIMPLVtcMessenger.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.21.90" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" >
|
||||
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj">
|
||||
<Private>false</Private>
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</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>
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</ProjectReference>
|
||||
|
||||
Reference in New Issue
Block a user