Newer
Older
SensorHub / SensorHub.Lamp / LampDatasJson.cs
root on 17 Sep 2021 1 KB first commit
using Newtonsoft.Json;
using SensorHub.Servers.JsonFormat;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SensorHub.Lamp
{
    public class LampDatasJson : DatasJson
    {
        public float electricity_1 { get; set; }
        public float voltage_1 { get; set; }

        [JsonProperty("electricity_2", DefaultValueHandling = DefaultValueHandling.Ignore)]
        [DefaultValue(-1.0)]
        public float electricity_2 { get; set; }

        [JsonProperty("voltage_2", DefaultValueHandling = DefaultValueHandling.Ignore)]
        [DefaultValue(-1.0)]
        public float voltage_2 { get; set; }

        public LampDatasJson(string uptime, float electricity_1, float voltage_1, float electricity_2, float voltage_2)
        {
            this.uptime = uptime;
            this.electricity_1 = electricity_1;
            this.voltage_1 = voltage_1;
            this.electricity_2 = electricity_2;
            this.voltage_2 = voltage_2;
        }
    }
}