using System;
using System.Collections.Generic;
namespace hass_desktop_service.Communication
{
public class AutoDiscoveryConfigModel
{
///
/// (Optional) The MQTT topic subscribed to receive availability (online/offline) updates.
///
///
public string Availability_topic { get; set; }
///
/// (Optional) Information about the device this sensor is a part of to tie it into the device registry. Only works through MQTT discovery and when unique_id is set.
///
///
public DeviceConfigModel Device { get; set; }
///
/// (Optional) The type/class of the sensor to set the icon in the frontend. See https://www.home-assistant.io/integrations/sensor/#device-class for options.
///
///
public string Device_class { get; set; }
///
/// (Optional) Defines the number of seconds after the sensor’s state expires, if it’s not updated. After expiry, the sensor’s state becomes unavailable. Defaults to 0 in hass.
///
///
public int? Expire_after { get; set; }
///
/// Sends update events even if the value hasn’t changed. Useful if you want to have meaningful value graphs in history.
///
///
public bool? Force_update { get; set; }
///
/// (Optional) The icon for the sensor.
///
///
public string Icon { get; set; }
///
/// (Optional) Defines a template to extract the JSON dictionary from messages received on the json_attributes_topic.
///
///
public string Json_attributes_template { get; set; }
///
/// (Optional) The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Implies force_update of the current sensor state when a message is received on this topic.
///
///
public string Json_attributes_topic { get; set; }
///
/// (Optional) The name of the MQTT sensor. Defaults to MQTT Sensor in hass.
///
///
public string Name { get; set; }
///
/// (Optional) The payload that represents the available state.
///
///
public string Payload_available { get; set; }
///
/// (Optional) The payload that represents the unavailable state.
///
///
public string Payload_not_available { get; set; }
///
/// (Optional) The maximum QoS level of the state topic.
///
///
public int? Qos { get; set; }
///
/// The MQTT topic subscribed to receive sensor values.
///
///
public string State_topic { get; set; }
///
/// (Optional) An ID that uniquely identifies this sensor. If two sensors have the same unique ID, Home Assistant will raise an exception.
///
///
public string Unique_id { get; set; }
///
/// (Optional) Defines the units of measurement of the sensor, if any.
///
///
public string Unit_of_measurement { get; set; }
///
/// (Optional) Defines a template to extract the value.
///
///
public string Value_template { get; set; }
}
public class DeviceConfigModel
{
///
/// (Optional) A list of connections of the device to the outside world as a list of tuples [connection_type, connection_identifier]. For example the MAC address of a network interface: "connections": [["mac", "02:5b:26:a8:dc:12"]].
///
///
public ICollection> Connections { get; set; }
///
/// (Optional) An Id to identify the device. For example a serial number.
///
///
public string Identifiers { get; set; }
///
/// (Optional) The manufacturer of the device.
///
///
public string Manufacturer { get; set; }
///
/// (Optional) The model of the device.
///
///
public string Model { get; set; }
///
/// (Optional) The name of the device.
///
///
public string Name { get; set; }
///
/// (Optional) The firmware version of the device.
///
///
public string Sw_version { get; set; }
///
/// (Optional) Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant.
///
///
public string Via_device { get; set; }
}
}