mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Changes to CrestronGenericBridgeableBaseDevice and CrestronGenericBaseDevice to allow it to take a func<DeviceConfig, GenericBase> in an overloaded constructor
Addresses #292
This commit is contained in:
parent
f6286cb5c1
commit
495bf70d3a
2 changed files with 28 additions and 2 deletions
|
|
@ -18,7 +18,8 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
public IntFeedback TemperatureFeedback { get; private set; }
|
public IntFeedback TemperatureFeedback { get; private set; }
|
||||||
public IntFeedback HumidityFeedback { get; private set; }
|
public IntFeedback HumidityFeedback { get; private set; }
|
||||||
|
|
||||||
public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
|
public C2nRthsController(string key, string name, GenericBase hardware)
|
||||||
|
: base(key, name, hardware)
|
||||||
{
|
{
|
||||||
_device = hardware as C2nRths;
|
_device = hardware as C2nRths;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.JsonStandardObjects;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
|
|
@ -42,6 +44,24 @@ namespace PepperDash.Essentials.Core
|
||||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected CrestronGenericBaseDevice(string key, string name)
|
||||||
|
: base(key, name)
|
||||||
|
{
|
||||||
|
Feedbacks = new FeedbackCollection<Feedback>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void RegisterCrestronGenericBase(GenericBase hardware)
|
||||||
|
{
|
||||||
|
Hardware = hardware;
|
||||||
|
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
|
||||||
|
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
|
||||||
|
IpConnectionsText = new StringFeedback("IpConnectionsText", () => Hardware.ConnectedIpList != null ? string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()) : string.Empty);
|
||||||
|
AddToFeedbackList(IsOnline, IpConnectionsText);
|
||||||
|
|
||||||
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make sure that overriding classes call this!
|
/// Make sure that overriding classes call this!
|
||||||
/// Registers the Crestron device, connects up to the base events, starts communication monitor
|
/// Registers the Crestron device, connects up to the base events, starts communication monitor
|
||||||
|
|
@ -135,6 +155,11 @@ namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected CrestronGenericBridgeableBaseDevice(string key, string name)
|
||||||
|
: base(key, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
|
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue