mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
Initial framework of the power service
This commit is contained in:
30
Power/Service/Models/PowerChannel.cs
Normal file
30
Power/Service/Models/PowerChannel.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using JetBrains.Annotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class PowerChannel
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonPropertyName("ch")]
|
||||
public long ChannelNumber { get; set; }
|
||||
|
||||
[JsonPropertyName("eImp_Ws")]
|
||||
public long ImportedEnergy { get; set; }
|
||||
|
||||
[JsonPropertyName("eExp_Ws")]
|
||||
public long ExportedEnergy { get; set; }
|
||||
|
||||
[JsonPropertyName("p_W")]
|
||||
public long RealPower { get; set; }
|
||||
|
||||
[JsonPropertyName("q_VAR")]
|
||||
public long ReactivePower { get; set; }
|
||||
|
||||
[JsonPropertyName("v_V")]
|
||||
public double Voltage { get; set; }
|
||||
}
|
||||
}
|
||||
21
Power/Service/Models/PowerSample.cs
Normal file
21
Power/Service/Models/PowerSample.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models
|
||||
{
|
||||
public class PowerSample
|
||||
{
|
||||
[JsonPropertyName("sensorId")]
|
||||
public string SensorId { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public DateTimeOffset Timestamp { get; set; }
|
||||
|
||||
[JsonPropertyName("channels")]
|
||||
public PowerChannel[] Channels { get; set; }
|
||||
|
||||
[JsonPropertyName("cts")]
|
||||
public Dictionary<string, double>[] CurrentTransformers { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user