mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
feat: Add full status actions to IHasCodecSelfView and IHasDirectory messengers
This commit is contained in:
parent
ab4a243ffb
commit
b41c30cdd0
3 changed files with 31 additions and 17 deletions
|
|
@ -28,6 +28,10 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
{
|
||||
base.RegisterActions();
|
||||
|
||||
AddAction("/fullStatus", (id, content) => SendFullStatus());
|
||||
|
||||
AddAction("/cameraSelfViewStatus", (id, content) => SendFullStatus());
|
||||
|
||||
AddAction("/cameraSelfView", (id, content) => _selfView.SelfViewModeToggle());
|
||||
|
||||
_selfView.SelfviewIsOnFeedback.OutputChange += SelfviewIsOnFeedback_OutputChange;
|
||||
|
|
@ -38,6 +42,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
PostCameraSelfView();
|
||||
}
|
||||
|
||||
private void SendFullStatus()
|
||||
{
|
||||
PostCameraSelfView();
|
||||
}
|
||||
|
||||
private void PostCameraSelfView()
|
||||
{
|
||||
try
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
{
|
||||
base.RegisterActions();
|
||||
|
||||
AddAction("/fullStatus", (id, content) => SendFullStatus());
|
||||
|
||||
AddAction("/directoryStatus", (id, content) => SendFullStatus());
|
||||
|
||||
AddAction("/getDirectory", (id, content) => GetDirectoryRoot());
|
||||
|
||||
AddAction("/directoryById", (id, content) =>
|
||||
|
|
@ -116,6 +120,17 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
{
|
||||
_directory.GetDirectoryParentFolderContents();
|
||||
}
|
||||
|
||||
private void SendFullStatus()
|
||||
{
|
||||
PostStatusMessage(new IHasDirectoryStateMessage
|
||||
{
|
||||
CurrentDirectory = _directory.CurrentDirectoryResult,
|
||||
InitialPhonebookSyncComplete = _directory.PhonebookSyncState.InitialSyncComplete,
|
||||
HasDirectory = true,
|
||||
HasDirectorySearch = true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class IHasDirectoryStateMessage : DeviceStateMessageBase
|
||||
|
|
@ -125,5 +140,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
|
||||
[JsonProperty("initialPhonebookSyncComplete", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? InitialPhonebookSyncComplete { get; set; }
|
||||
|
||||
[JsonProperty("hasDirectory", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? HasDirectory { get; set; }
|
||||
|
||||
[JsonProperty("hasDirectorySearch", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? HasDirectorySearch { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,13 +227,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
};
|
||||
}
|
||||
|
||||
if (Codec is IHasDirectory directoryCodec)
|
||||
{
|
||||
status.HasDirectory = true;
|
||||
status.HasDirectorySearch = true;
|
||||
status.CurrentDirectory = directoryCodec.CurrentDirectoryResult;
|
||||
}
|
||||
|
||||
var codecType = Codec.GetType();
|
||||
|
||||
status.CameraSelfViewIsOn = Codec is IHasCodecSelfView && (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue;
|
||||
|
|
@ -387,12 +380,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
public string CurrentDialString { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the CurrentDirectory
|
||||
/// </summary>
|
||||
[JsonProperty("currentDirectory", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public CodecDirectory CurrentDirectory { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DirectorySelectedFolderName
|
||||
|
|
@ -403,11 +390,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
[JsonProperty("hasCameras", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? HasCameras { get; set; }
|
||||
|
||||
[JsonProperty("hasDirectory", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? HasDirectory { get; set; }
|
||||
|
||||
[JsonProperty("hasDirectorySearch", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? HasDirectorySearch { get; set; }
|
||||
|
||||
[JsonProperty("hasPresets", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? HasPresets { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue