mirror of
https://github.com/PepperDash/EssentialsPluginTemplate.git
synced 2026-02-15 04:34:41 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user