From 4fd9dd739efb1f5621011234f9df93310b8fff9c Mon Sep 17 00:00:00 2001 From: Aviv Cohn Date: Thu, 10 Oct 2024 16:33:06 -0400 Subject: [PATCH] chore: remove additional device types --- src/EssentialsPluginTemplateCrestronDevice.cs | 99 ------------------- src/EssentialsPluginTemplateLogicDevice.cs | 86 ---------------- 2 files changed, 185 deletions(-) delete mode 100644 src/EssentialsPluginTemplateCrestronDevice.cs delete mode 100644 src/EssentialsPluginTemplateLogicDevice.cs diff --git a/src/EssentialsPluginTemplateCrestronDevice.cs b/src/EssentialsPluginTemplateCrestronDevice.cs deleted file mode 100644 index 8836cc5..0000000 --- a/src/EssentialsPluginTemplateCrestronDevice.cs +++ /dev/null @@ -1,99 +0,0 @@ -// For Basic SIMPL# Classes -// For Basic SIMPL#Pro classes - -using Crestron.SimplSharpPro.DeviceSupport; -using Crestron.SimplSharpPro; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Core.Bridges; - -namespace EssentialsPluginTemplate -{ - /// - /// Plugin device - /// - /// - /// Rename the class to match the device plugin being developed. - /// - /// - /// "EssentialsPluginDeviceTemplate" renamed to "SamsungMdcDevice" - /// - public class EssentialsPluginTemplateCrestronDevice : CrestronGenericBridgeableBaseDevice - { - /// - /// It is often desirable to store the config - /// - private EssentialsPluginTemplateConfigObject _config; - - - #region Constructor for Devices without IBasicCommunication. Remove if not needed - /// - /// Plugin device constructor for Crestron devices - /// - /// - /// - /// - /// - public EssentialsPluginTemplateCrestronDevice(string key, string name, EssentialsPluginTemplateConfigObject config, GenericBase hardware) - : base(key, name, hardware) - { - Debug.Console(0, this, "Constructing new {0} instance", name); - - // The base class takes care of registering the hardware device for you - - // TODO [ ] Update the constructor as needed for the plugin device being developed - - _config = config; - } - - #endregion - - - #region Overrides of EssentialsBridgeableDevice - - /// - /// Links the plugin device to the EISC bridge - /// - /// - /// - /// - /// - public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) - { - var joinMap = new EssentialsPluginTemplateBridgeJoinMap(joinStart); - - // This adds the join map to the collection on the bridge - if (bridge != null) - { - bridge.AddJoinMap(Key, joinMap); - } - - var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey); - - if (customJoins != null) - { - joinMap.SetCustomJoinData(customJoins); - } - - Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); - Debug.Console(0, "Linking to Bridge Type {0}", GetType().Name); - - // TODO [ ] Implement bridge links as needed - - // links to bridge - trilist.SetString(joinMap.DeviceName.JoinNumber, Name); - - trilist.OnlineStatusChange += (o, a) => - { - if (!a.DeviceOnLine) return; - - trilist.SetString(joinMap.DeviceName.JoinNumber, Name); - }; - } - - - #endregion - - } -} - diff --git a/src/EssentialsPluginTemplateLogicDevice.cs b/src/EssentialsPluginTemplateLogicDevice.cs deleted file mode 100644 index 0685a43..0000000 --- a/src/EssentialsPluginTemplateLogicDevice.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Crestron.SimplSharpPro.DeviceSupport; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Core.Bridges; - -namespace EssentialsPluginTemplate -{ - /// - /// Plugin device template for logic devices that don't communicate outside the program - /// - /// - /// Rename the class to match the device plugin being developed. - /// - /// - /// "EssentialsPluginTemplateLogicDevice" renamed to "SamsungMdcDevice" - /// - public class EssentialsPluginTemplateLogicDevice : EssentialsBridgeableDevice - { - /// - /// It is often desirable to store the config - /// - private EssentialsPluginTemplateConfigObject _config; - - /// - /// Plugin device constructor - /// - /// - /// - /// - public EssentialsPluginTemplateLogicDevice(string key, string name, EssentialsPluginTemplateConfigObject config) - : base(key, name) - { - Debug.Console(0, this, "Constructing new {0} instance", name); - - // TODO [ ] Update the constructor as needed for the plugin device being developed - - _config = config; - } - - #region Overrides of EssentialsBridgeableDevice - - /// - /// Links the plugin device to the EISC bridge - /// - /// - /// - /// - /// - public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) - { - var joinMap = new EssentialsPluginTemplateBridgeJoinMap(joinStart); - - // This adds the join map to the collection on the bridge - if (bridge != null) - { - bridge.AddJoinMap(Key, joinMap); - } - - var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey); - - if (customJoins != null) - { - joinMap.SetCustomJoinData(customJoins); - } - - Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); - Debug.Console(0, "Linking to Bridge Type {0}", GetType().Name); - - // TODO [ ] Implement bridge links as needed - - // links to bridge - trilist.SetString(joinMap.DeviceName.JoinNumber, Name); - - trilist.OnlineStatusChange += (o, a) => - { - if (!a.DeviceOnLine) return; - - trilist.SetString(joinMap.DeviceName.JoinNumber, Name); - }; - } - - #endregion - - } -} -