mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
refactor: remove unused GetInterfaces method and streamline constructor initialization
This commit is contained in:
parent
72c948e760
commit
c306fd717e
1 changed files with 2 additions and 11 deletions
|
|
@ -84,19 +84,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
: this(key, messagePath)
|
||||
{
|
||||
_device = device;
|
||||
|
||||
_deviceInterfaces = GetInterfaces(_device as Device);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the interfaces implmented on the device
|
||||
/// </summary>
|
||||
/// <param name="device"></param>
|
||||
/// <returns></returns>
|
||||
private List<string> GetInterfaces(Device device)
|
||||
{
|
||||
return device?.GetType().GetInterfaces().Select((i) => i.Name).ToList() ?? new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers this messenger with appserver controller
|
||||
|
|
@ -262,6 +251,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||
|
||||
message.Name = _device.Name;
|
||||
|
||||
message.MessageBasePath = MessagePath;
|
||||
|
||||
var token = JToken.FromObject(message);
|
||||
|
||||
PostStatusMessage(token, MessagePath, clientId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue