mirror of
https://github.com/excaliburpartners/OmniLinkBridge
synced 2025-05-06 17:13:11 +00:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
using OmniLinkBridge.Modules;
|
|
using System.Collections.Generic;
|
|
|
|
namespace OmniLinkBridge.MQTT.HomeAssistant
|
|
{
|
|
public class Device
|
|
{
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public enum AvailabilityMode
|
|
{
|
|
all,
|
|
any,
|
|
latest
|
|
}
|
|
|
|
public string unique_id { get; set; }
|
|
|
|
public string name { get; set; }
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
public string state_topic { get; set; }
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
public string availability_topic { get; set; } = $"{Global.mqtt_prefix}/status";
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
public List<Availability> availability { get; set; }
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
public AvailabilityMode? availability_mode { get; set; }
|
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
public DeviceRegistry device { get; set; } = MQTTModule.MqttDeviceRegistry;
|
|
}
|
|
}
|