mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-25 01:25:37 -05:00
Power service updates
- Upgrade to .NET 8 - Remove ApplicationInsights - Add OpenTelemetry
This commit is contained in:
@@ -1,30 +1,29 @@
|
||||
using JetBrains.Annotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models;
|
||||
|
||||
[PublicAPI]
|
||||
public class PowerChannel
|
||||
{
|
||||
[PublicAPI]
|
||||
public class PowerChannel
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonPropertyName("ch")]
|
||||
public long ChannelNumber { get; set; }
|
||||
[JsonPropertyName("ch")]
|
||||
public long ChannelNumber { get; set; }
|
||||
|
||||
[JsonPropertyName("eImp_Ws")]
|
||||
public long ImportedEnergy { get; set; }
|
||||
[JsonPropertyName("eImp_Ws")]
|
||||
public long ImportedEnergy { get; set; }
|
||||
|
||||
[JsonPropertyName("eExp_Ws")]
|
||||
public long ExportedEnergy { get; set; }
|
||||
[JsonPropertyName("eExp_Ws")]
|
||||
public long ExportedEnergy { get; set; }
|
||||
|
||||
[JsonPropertyName("p_W")]
|
||||
public long RealPower { get; set; }
|
||||
[JsonPropertyName("p_W")]
|
||||
public long RealPower { get; set; }
|
||||
|
||||
[JsonPropertyName("q_VAR")]
|
||||
public long ReactivePower { get; set; }
|
||||
[JsonPropertyName("q_VAR")]
|
||||
public long ReactivePower { get; set; }
|
||||
|
||||
[JsonPropertyName("v_V")]
|
||||
public double Voltage { get; set; }
|
||||
}
|
||||
}
|
||||
[JsonPropertyName("v_V")]
|
||||
public double Voltage { get; set; }
|
||||
}
|
||||
@@ -3,21 +3,20 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models;
|
||||
|
||||
[PublicAPI]
|
||||
public class PowerSample
|
||||
{
|
||||
[PublicAPI]
|
||||
public class PowerSample
|
||||
{
|
||||
[JsonPropertyName("sensorId")]
|
||||
public string SensorId { get; set; }
|
||||
[JsonPropertyName("sensorId")]
|
||||
public string SensorId { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public DateTimeOffset Timestamp { get; set; }
|
||||
[JsonPropertyName("timestamp")]
|
||||
public DateTimeOffset Timestamp { get; set; }
|
||||
|
||||
[JsonPropertyName("channels")]
|
||||
public PowerChannel[] Channels { get; set; }
|
||||
[JsonPropertyName("channels")]
|
||||
public PowerChannel[] Channels { get; set; }
|
||||
|
||||
[JsonPropertyName("cts")]
|
||||
public Dictionary<string, double>[] CurrentTransformers { get; set; }
|
||||
}
|
||||
}
|
||||
[JsonPropertyName("cts")]
|
||||
public Dictionary<string, double>[] CurrentTransformers { get; set; }
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models;
|
||||
|
||||
[PublicAPI]
|
||||
public class PowerStatus
|
||||
{
|
||||
[PublicAPI]
|
||||
public class PowerStatus
|
||||
{
|
||||
public DateTimeOffset Timestamp { get; set; } = DateTimeOffset.UtcNow;
|
||||
public long Generation { get; set; }
|
||||
public long Consumption { get; set; }
|
||||
}
|
||||
}
|
||||
public DateTimeOffset Timestamp { get; set; } = DateTimeOffset.UtcNow;
|
||||
public long Generation { get; set; }
|
||||
public long Consumption { get; set; }
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models
|
||||
namespace ChrisKaczor.HomeMonitor.Power.Service.Models;
|
||||
|
||||
[PublicAPI]
|
||||
public class PowerStatusGrouped
|
||||
{
|
||||
[PublicAPI]
|
||||
public class PowerStatusGrouped
|
||||
{
|
||||
public DateTimeOffset Bucket { get; set; }
|
||||
public long AverageGeneration { get; set; }
|
||||
public long AverageConsumption { get; set; }
|
||||
}
|
||||
}
|
||||
public DateTimeOffset Bucket { get; set; }
|
||||
public long AverageGeneration { get; set; }
|
||||
public long AverageConsumption { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user