OmniLinkBridge/OmniLinkBridge/MQTT/Sensor.cs
2019-12-13 23:14:20 -05:00

28 lines
774 B
C#

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace OmniLinkBridge.MQTT
{
public class Sensor : Device
{
[JsonConverter(typeof(StringEnumConverter))]
public enum DeviceClass
{
humidity,
temperature
}
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public DeviceClass? device_class { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string icon { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string unit_of_measurement { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string value_template { get; set; }
}
}