using System.Collections.Generic; using Newtonsoft.Json; using PepperDash.Essentials.Core; namespace EssentialsPluginTemplate { /// /// Plugin device configuration object /// /// /// Rename the class to match the device plugin being created /// /// /// "EssentialsPluginConfigObjectTemplate" renamed to "SamsungMdcConfig" /// [ConfigSnippet("\"properties\":{\"control\":{}")] public class EssentialsPluginConfigObjectTemplate { /// /// JSON control object /// /// /// Typically this object is not required, but in some instances it may be needed. For example, when building a /// plugin that is using Telnet (TCP/IP) communications and requires login, the device will need to handle the login. /// In order to do so, you will need the username and password in the "tcpSshProperties" object. /// /// /// /// "control": { /// "method": "tcpIp", /// "controlPortDevKey": "processor", /// "controlPortNumber": 1, /// "comParams": { /// "baudRate": 9600, /// "dataBits": 8, /// "stopBits": 1, /// "parity": "None", /// "protocol": "RS232", /// "hardwareHandshake": "None", /// "softwareHandshake": "None" /// }, /// "tcpSshProperties": { /// "address": "172.22.0.101", /// "port": 23, /// "username": "admin", /// "password": "password", /// "autoReconnect": true, /// "autoReconnectIntervalMs": 10000 /// } /// } /// /// [JsonProperty("control")] public EssentialsControlPropertiesConfig Control { get; set; } /// /// Serializes the poll time value /// /// /// This is an exmaple device plugin property. This should be modified or deleted as needed for the plugin being built. /// /// /// PollTimeMs property gets/sets the value as a long /// /// /// /// "properties": { /// "polltimeMs": 30000 /// } /// /// [JsonProperty("pollTimeMs")] public long PollTimeMs { get; set; } /// /// Serializes the warning timeout value /// /// /// This is an exmaple device plugin property. This should be modified or deleted as needed for the plugin being built. /// /// /// WarningTimeoutMs property gets/sets the value as a long /// /// /// /// "properties": { /// "warningTimeoutMs": 180000 /// } /// /// [JsonProperty("warningTimeoutMs")] public long WarningTimeoutMs { get; set; } /// /// Serializes the error timeout value /// /// /// /// This is an exmaple device plugin property. This should be modified or deleted as needed for the plugin being built. /// /// /// ErrorTimeoutMs property gets/sets the value as a long /// /// /// /// "properties": { /// "errorTimeoutMs": 300000 /// } /// /// [JsonProperty("errorTimeoutMs")] public long ErrorTimeoutMs { get; set; } /// /// Example dictionary of objects /// /// /// This is an example collection configuration object. This should be modified or deleted as needed for the plugin being built. /// /// /// /// "properties": { /// "presets": { /// "preset1": { /// "enabled": true, /// "name": "Preset 1" /// } /// } /// } /// /// /// /// /// "properties": { /// "inputNames": { /// "input1": "Input 1", /// "input2": "Input 2" /// } /// } /// /// [JsonProperty("DeviceDictionary")] public Dictionary DeviceDictionary { get; set; } /// /// Constuctor /// /// /// If using a collection you must instantiate the collection in the constructor /// to avoid exceptions when reading the configuration file /// public EssentialsPluginConfigObjectTemplate() { DeviceDictionary = new Dictionary(); } } /// /// Example plugin configuration dictionary object /// /// /// This is an example collection of configuration objects. This can be modified or deleted as needed for the plugin being built. /// /// /// /// "properties": { /// "dictionary": { /// "item1": { /// "name": "Item 1 Name", /// "value": "Item 1 Value" /// } /// } /// } /// /// public class EssentialsPluginConfigObjectDictionaryTemplate { /// /// Serializes collection name property /// /// /// This is an example collection of configuration objects. This can be modified or deleted as needed for the plugin being built. /// [JsonProperty("name")] public string Name { get; set; } /// /// Serializes collection value property /// /// /// This is an example collection of configuration objects. This can be modified or deleted as needed for the plugin being built. /// [JsonProperty("value")] public uint Value { get; set; } } }