Updates to add comments and better organize. Updates to Github repo for submodule and to latest release version of Essentials (1.4.31)

This commit is contained in:
Neil Dorin
2020-02-13 12:40:23 -07:00
parent 5281564ba4
commit caf2731dfb
8 changed files with 76 additions and 17 deletions

View File

@@ -12,29 +12,35 @@ using PepperDash.Core;
namespace EssentialsPluginTemplateEPI
{
public class EssentialsPluginTemplate : Device
public class EssentialsPluginTemplate
{
/// <summary>
/// This string is used to define the minimum version of the
/// Essentials Framework required for this plugin
/// </summary>
public static string MinimumEssentialsFrameworkVersion = "1.4.23";
/// <summary>
/// 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
/// </summary>
public static void LoadPlugin()
{
PepperDash.Essentials.Core.DeviceFactory.AddFactoryForType("EssentialsPluginTemplate", EssentialsPluginTemplate.BuildDevice);
}
public static EssentialsPluginTemplate BuildDevice(DeviceConfig dc)
/// <summary>
/// Builds an instance of the device type
/// </summary>
/// <param name="dc">The device configuration</param>
/// <returns>The device</returns>
public static EssentialsPluginTemplateDevice BuildDevice(DeviceConfig dc)
{
var config = JsonConvert.DeserializeObject<EssentialsPluginTemplateConfigObject>(dc.Properties.ToString());
var newMe = new EssentialsPluginTemplate(dc.Key, dc.Name, config);
return newMe;
var config = JsonConvert.DeserializeObject<EssentialsPluginTemplatePropertiesConfig>(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)
{
}
}
}