Newer
Older
SensorHub / SensorHub.TempHumi / TempHumiDatasJson.cs
root on 17 Sep 2021 851 bytes 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.TempHumi
{
    public class TempHumiDatasJson : DatasJson
    {
        [JsonProperty("temperature", DefaultValueHandling = DefaultValueHandling.Ignore)]
        [DefaultValue(-127.0f)]
        public float temperature { get; set; }

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

        public TempHumiDatasJson(string uptime, float temperature, float humidity)
        {
            this.uptime = uptime;
            this.temperature = temperature;
            this.humidity = humidity;
        }
    }
}