Skip to content

Commit d9cc3f8

Browse files
committed
Deserialize also testMeasurement used for testing different scenarios
1 parent 33a013b commit d9cc3f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Tibber.Sdk/RealTimeMeasurementListener.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ private async Task SubscribeStream(Guid homeId, int subscriptionId, Cancellation
177177
Trace.WriteLine($"subscribe to {homeId}");
178178

179179
await ExecuteStreamRequest(
180+
//$@"{{""payload"":{{""query"":""subscription{{testMeasurement(count:2, complete:false){{timestamp,power,powerReactive,powerProduction,powerProductionReactive,accumulatedConsumption,accumulatedConsumptionLastHour,accumulatedProduction,accumulatedProductionLastHour,accumulatedCost,accumulatedReward,currency,minPower,averagePower,maxPower,minPowerProduction,maxPowerProduction,voltagePhase1,voltagePhase2,voltagePhase3,currentL1,currentL2,currentL3,lastMeterConsumption,lastMeterProduction,powerFactor,signalStrength}}}}"",""variables"":{{}},""extensions"":{{}}}},""type"":""subscribe"",""id"":""{subscriptionId}""}}",
180181
$@"{{""payload"":{{""query"":""subscription{{liveMeasurement(homeId:\""{homeId}\""){{timestamp,power,powerReactive,powerProduction,powerProductionReactive,accumulatedConsumption,accumulatedConsumptionLastHour,accumulatedProduction,accumulatedProductionLastHour,accumulatedCost,accumulatedReward,currency,minPower,averagePower,maxPower,minPowerProduction,maxPowerProduction,voltagePhase1,voltagePhase2,voltagePhase3,currentL1,currentL2,currentL3,lastMeterConsumption,lastMeterProduction,powerFactor,signalStrength}}}}"",""variables"":{{}},""extensions"":{{}}}},""type"":""subscribe"",""id"":""{subscriptionId}""}}",
181182
cancellationToken);
182183

@@ -517,6 +518,9 @@ private class WebSocketData
517518
{
518519
[JsonProperty("liveMeasurement")]
519520
public RealTimeMeasurement RealTimeMeasurement { get; set; }
521+
522+
[JsonProperty("testMeasurement")]
523+
public RealTimeMeasurement TestMeasurement { set { RealTimeMeasurement = value; } }
520524
}
521525

522526
private class HomeStreamObserverCollection

0 commit comments

Comments
 (0)