berezhinskiy / ecoflow_exporter

Prometheus exporter for EcoFlow portable power stations
GNU General Public License v3.0
184 stars 27 forks source link

Drop all non-int/float values (fixes #48) #57

Open tris opened 2 weeks ago

tris commented 2 weeks ago

This fixes the crash that occurs for me with a Delta 2 Max with 2 x Delta 2 Max Smart Extra Battery attached.

I also threw in a fix for this issue with paho-mqtt:

Traceback (most recent call last):
  File "/ecoflow_exporter.py", line 365, in <module>
    main()
  File "/ecoflow_exporter.py", line 350, in main
    EcoflowMQTT(message_queue, device_sn, auth.mqtt_username, auth.mqtt_password, auth.mqtt_url, auth.mqtt_port, auth.mqtt_client_id, timeout_seconds)
  File "/ecoflow_exporter.py", line 112, in __init__
    self.connect()
  File "/ecoflow_exporter.py", line 123, in connect
    self.client = mqtt.Client(self.client_id)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 772, in __init__
    raise ValueError(
ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details

@berezhinskiy -- could you cut a new release after this one? Thanks!