Skip to content

Commit

Permalink
fix nullable of samples
Browse files Browse the repository at this point in the history
  • Loading branch information
just-seba committed Oct 2, 2024
1 parent c271c46 commit 0f7e3ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions server/src/OpenEMS.Analytics/ElectricityMeterSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ElectricityMeterSample : IHasOwner
/// <summary>
/// Gets the <see cref="ElectricityMeter.CurrentPower"/>.
/// </summary>
public required Watt CurrentPower { get; init; }
public required Watt? CurrentPower { get; init; }

/// <summary>
/// Gets the <see cref="ElectricityMeter.CurrentPowerDirection"/>.
Expand All @@ -22,12 +22,12 @@ public class ElectricityMeterSample : IHasOwner
/// <summary>
/// Gets the <see cref="ElectricityMeter.TotalEnergyConsumption"/>.
/// </summary>
public required WattHours TotalEnergyConsumption { get; init; }
public required WattHours? TotalEnergyConsumption { get; init; }

/// <summary>
/// Gets the <see cref="ElectricityMeter.TotalEnergyFeedIn"/>.
/// </summary>
public required WattHours TotalEnergyFeedIn { get; init; }
public required WattHours? TotalEnergyFeedIn { get; init; }

/// <summary>
/// Gets the <see cref="ElectricityMeter.OwnedBy"/>.
Expand Down
4 changes: 2 additions & 2 deletions server/src/OpenEMS.Analytics/ProducerSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class ProducerSample : IHasOwner
/// <summary>
/// Gets the <see cref="Producer.CurrentPowerProduction"/>.
/// </summary>
public required Watt CurrentPowerProduction { get; init; }
public required Watt? CurrentPowerProduction { get; init; }

/// <summary>
/// Gets the <see cref="Producer.TotalEnergyProduction"/>.
/// </summary>
public required WattHours TotalEnergyProduction { get; init; }
public required WattHours? TotalEnergyProduction { get; init; }

/// <summary>
/// Gets the <see cref="Producer.OwnedBy"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
CurrentPower: 1200,
CurrentPowerDirection: Consume,
TotalEnergyConsumption: 400,
TotalEnergyFeedIn: 0,
OwnedBy: test-user
},
{
ElectricityMeterId: meter-2-id,
Timestamp: 2024-08-31 13:34:59 +0,
CurrentPower: 200,
CurrentPowerDirection: FeedIn,
TotalEnergyConsumption: 0,
TotalEnergyFeedIn: 150,
OwnedBy: test-user
}
Expand Down

0 comments on commit 0f7e3ae

Please sign in to comment.