Closed rixxxx closed 1 year ago
Hello @rixxxx, Thanks for the PR. Could you add a unit test for this as described in the contribute section in the README?
Hi,
Sure, I'll add the tests.
Hi @rixxxx, any news?
Hi, test added.
@rixxxx you should just run black. It will solve all the format issues.
hopefully its now ok
it is :tada: thanks again for the PR
Shelly 3EM running Tasmota sends following. This patch enables mqtt-exporter to extract values from lists.
Before: DEBUG:mqtt-exporter:Failed to convert Power: Can't parse '[148, 133, 106]' to a number.
Now: DEBUG:mqtt-exporter:parsing list Power: [104, 133, 107] DEBUG:mqtt-exporter:new value for mqtt_ENERGY_Power_0: 104 DEBUG:mqtt-exporter:new value for mqtt_ENERGY_Power_1: 133 DEBUG:mqtt-exporter:new value for mqtt_ENERGY_Power_2: 107
MQTT message: { "Time": "2023-01-28T01:08:31", "ENERGY": { "TotalStartTime": "2023-01-23T23:19:38", "Total": 2.785, "Yesterday": 1.748, "Today": 1.037, "TodaySumImport": 1.037, "TodaySumExport": 0, "ExportActive": [ 0, 0, 0 ], "Period": [ 12, 11, 9 ], "Power": [ 97, 133, 107 ], "ApparentPower": [ 153, 182, 214 ], "ReactivePower": [ 118, 125, 186 ], "Factor": [ 0.64, 0.73, 0.5 ], "Frequency": [ 50, 50, 50 ], "Voltage": [ 231, 227, 234 ], "Current": [ 0.66, 0.803, 0.917 ], "CurrentNeutral": 0.011 } }