Files

73 lines
2.3 KiB
C#

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shelly.DTO.Shelly1PM
{
public class SwitchDto
{
/// <summary>
/// Id of the Switch component instance
/// </summary>
[JsonProperty("id")]
public int Id { get; set; } = 0;
/// <summary>
/// Source of the last command, for example: init, WS_in, http, ...
/// </summary>
[JsonProperty("source")]
public string Source { get; set; } = "";
/// <summary>
/// Output status: rue if the output channel is currently on, false otherwise
/// </summary>
[JsonProperty("output")]
public bool Output { get; set; }
/// <summary>
/// Last measured instantaneous active power(in Watts) delivered to the attached load(shown if applicable)
/// </summary>
[JsonProperty("apower")]
public double Power { get; set; }
/// <summary>
/// Last measured voltage in Volts (shown if applicable)
/// </summary>
[JsonProperty("voltage")]
public double Voltage { get; set; }
/// <summary>
/// Last measured current in Amperes (shown if applicable)
/// </summary>
[JsonProperty("current")]
public double Current { get; set; }
/// <summary>
/// Information about the active energy counter (shown if applicable)
/// </summary>
[JsonProperty("aenergy")]
public EnergyDto? ActEnergy { get; set; }
/// <summary>
/// Information about the returned active energy counter * (shown if applicable)
/// </summary>
[JsonProperty("ret_aenergy")]
public EnergyDto? RetEnergy { get; set; }
/// <summary>
/// Information about the temperature (shown if applicable)
/// </summary>
[JsonProperty("temperature")]
public TemperatureDto? Temperature { get; set; }
/// <summary>
/// Error conditions occurred. May contain overtemp, overpower, overvoltage, undervoltage, (shown if at least one error is present)
/// </summary>
[JsonProperty("errors")]
public string[]? Errors { get; set; }
}
}