From caf2731dfbe40b18084a3689106b9c3c5f40a9f2 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 13 Feb 2020 12:40:23 -0700 Subject: [PATCH] Updates to add comments and better organize. Updates to Github repo for submodule and to latest release version of Essentials (1.4.31) --- .gitmodules | 2 +- EssentialsBuilds | 2 +- .../EssentailsPluginTemplate.cs | 34 +++++++++------- .../EssentialsPluginTemplateConfigObject.cs | 16 +++++++- .../EssentialsPluginTemplateDevice.cs | 38 ++++++++++++++++++ .../PDT.EssentialsPluginTemplate.EPI.csproj | 1 + .../PDT.EssentialsPluginTemplate.EPI.suo | Bin 23040 -> 22016 bytes .../PDT.EssentialsPluginTemplate.projectinfo | Bin 0 -> 428 bytes 8 files changed, 76 insertions(+), 17 deletions(-) create mode 100644 PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateDevice.cs create mode 100644 PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.projectinfo diff --git a/.gitmodules b/.gitmodules index 07e762c..726935e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "EssentialsBuilds"] path = EssentialsBuilds - url = https://bitbucket.org/Pepperdash_Products/essentials-builds.git +url=https://github.com/PepperDash/Essentials-Builds.git \ No newline at end of file diff --git a/EssentialsBuilds b/EssentialsBuilds index 2a6c167..855dccd 160000 --- a/EssentialsBuilds +++ b/EssentialsBuilds @@ -1 +1 @@ -Subproject commit 2a6c167efbd9b3770821d11effd846fabae4f8be +Subproject commit 855dccd0d41aac272512f58d6bcd4764307bbb14 diff --git a/PDT.EssentialsPluginTemplate.EPI/EssentailsPluginTemplate.cs b/PDT.EssentialsPluginTemplate.EPI/EssentailsPluginTemplate.cs index 07f6aa6..b80b595 100644 --- a/PDT.EssentialsPluginTemplate.EPI/EssentailsPluginTemplate.cs +++ b/PDT.EssentialsPluginTemplate.EPI/EssentailsPluginTemplate.cs @@ -12,29 +12,35 @@ using PepperDash.Core; namespace EssentialsPluginTemplateEPI { - public class EssentialsPluginTemplate : Device - + public class EssentialsPluginTemplate { + /// + /// This string is used to define the minimum version of the + /// Essentials Framework required for this plugin + /// + public static string MinimumEssentialsFrameworkVersion = "1.4.23"; + + /// + /// This method will get called by Essentials when this plugin is loaded. + /// Use it to add factory methods for all new Device types defined in this plugin + /// public static void LoadPlugin() { PepperDash.Essentials.Core.DeviceFactory.AddFactoryForType("EssentialsPluginTemplate", EssentialsPluginTemplate.BuildDevice); } - public static EssentialsPluginTemplate BuildDevice(DeviceConfig dc) + /// + /// Builds an instance of the device type + /// + /// The device configuration + /// The device + public static EssentialsPluginTemplateDevice BuildDevice(DeviceConfig dc) { - var config = JsonConvert.DeserializeObject(dc.Properties.ToString()); - var newMe = new EssentialsPluginTemplate(dc.Key, dc.Name, config); - return newMe; + var config = JsonConvert.DeserializeObject(dc.Properties.ToString()); + var newDevice = new EssentialsPluginTemplateDevice(dc.Key, dc.Name, config); + return newDevice; } - - GenericSecureTcpIpClient_ForServer Client; - - public EssentialsPluginTemplate(string key, string name, EssentialsPluginTemplateConfigObject config) - : base(key, name) - { - - } } } diff --git a/PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateConfigObject.cs b/PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateConfigObject.cs index 715707c..22f9a10 100644 --- a/PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateConfigObject.cs +++ b/PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateConfigObject.cs @@ -4,9 +4,23 @@ using System.Linq; using System.Text; using Crestron.SimplSharp; +using PepperDash.Core; + +using Newtonsoft.Json; + namespace EssentialsPluginTemplateEPI { - public class EssentialsPluginTemplateConfigObject + /// + /// Example of a config class that represents the structure of the Properties object of a DeviceConfig + /// + public class EssentialsPluginTemplatePropertiesConfig { + /// + /// Control properties if needed to communicate with device + /// + [JsonProperty("control")] + ControlPropertiesConfig Control { get; set; } + + } } \ No newline at end of file diff --git a/PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateDevice.cs b/PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateDevice.cs new file mode 100644 index 0000000..434dde4 --- /dev/null +++ b/PDT.EssentialsPluginTemplate.EPI/EssentialsPluginTemplateDevice.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro.DeviceSupport; + +using PepperDash.Essentials; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.Config; +using PepperDash.Core; + +namespace EssentialsPluginTemplateEPI +{ + /// + /// Example of a plugin device + /// + public class EssentialsPluginTemplateDevice : Device, IBridge + { + /// + /// Device Constructor. Called by + /// + /// + /// + /// + public EssentialsPluginTemplateDevice(string key, string name, EssentialsPluginTemplatePropertiesConfig config) + : base(key, name) + { + + } + + public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey) + { + + + } + } +} \ No newline at end of file diff --git a/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.EPI.csproj b/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.EPI.csproj index 4413a7d..5a9ae47 100644 --- a/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.EPI.csproj +++ b/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.EPI.csproj @@ -95,6 +95,7 @@ + diff --git a/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.EPI.suo b/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.EPI.suo index 8754faac5331a5c0281f2398fa001ade594ceed5..3b9a273efda09627deb240f8d48a51672e4d7b0a 100644 GIT binary patch delta 1599 zcmbtUUuaWj6hGhX&A;Z>#-^!Bjcu$+TT1h%wQj4Fsx{U&4SH*f1uMnbmLjW8V(jSZ zMg(Dxn>o(|AGU|-7}hHyjDZz}4eMVN#1~5+ME2kiE2v+_nmXT z^DlE*WPTPGlgioNwheVew3y4~L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>CS3A+S;m}^~WU42eSA)9{o1BQM(Xx zam18PEYibKgioo@_FPxRNxCRu@kFuQlT^j6t}J(^dIv0AJakoMUTwMe);eVS&l<#S zcj2;s5c7MY;!>9`dk026^>0-~72nwAa6{Q1SmWJjkZU0|Ww8>9Q0bb`6<@&4z9~#4 zPiBW*rc*@s3&N__F#M1s+I(D_987Y)AH1^;-9vo{$c}8#g`DLt diff --git a/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.projectinfo b/PDT.EssentialsPluginTemplate.EPI/PDT.EssentialsPluginTemplate.projectinfo new file mode 100644 index 0000000000000000000000000000000000000000..a449593860716ecbdce08cf7947eb99102f354fa GIT binary patch literal 428 zcmV;d0aN}TiwFP!000040PVd8U>r%7B_=Oz%6orG^-9;^bfE}=m|e(^`YTQU3S(MP)`cQ2p58J{*yzHAHn z@MXEaD3)*X#j4EOe0=)yj9#5dvtBFu>Vm%7+1c6M=KsCf*?GkOqi+h^%TL?iUe?u5 z=hOCVd0ss$%6yqEa(e&d(eL~Fez&UM7R!tDX;D*ysxI>8_x*ieKK*@v-yziS?PkPp zXt5Gp3c`i3J!`1v_S$0l`nqZJ#S20379^sPUDVm)Z1yI*7^c=qwOG-(XJ0M{$#%M! zkib<`$>ZWi~1E=hX#4yRe_0RIBSZ)w8Oc<#qGXBQxcDAN`WiM_&}n zVzFL4E9%8nR_8xSEs6?#?~ZqN9@78!9#WTIuG`hReVMiMpS{VTZm9R-yqIP!q3|ki W)@4iRe((Fg