We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 569e4c8 commit 40edd7cCopy full SHA for 40edd7c
1 file changed
ShellyPro3EmExporter/ShellyPro3EmConnection.cs
@@ -210,10 +210,26 @@ bool UpdateRegularMetrics(string requestResponse)
210
JsonDocument json = JsonDocument.Parse(requestResponse);
211
212
JsonElement paramsElement = json.RootElement.GetProperty("result");
213
-
+
214
+ if (meterReadings.Length < 1)
215
+ {
216
+ return false;
217
+ }
218
219
+ bool startingFromZero = meterReadings[0].meterIndex == 0;
220
221
foreach (MeterReading meterReading in meterReadings)
222
{
- string phase = indexToPhaseMap[meterReading.meterIndex - 1];
223
+ string phase;
224
225
+ if (startingFromZero)
226
227
+ phase = indexToPhaseMap[meterReading.meterIndex];
228
229
+ else
230
231
+ phase = indexToPhaseMap[meterReading.meterIndex - 1];
232
233
234
if (!meterReading.currentIgnored)
235
0 commit comments