berezhinskiy / ecoflow_exporter

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

Support reading MQTT host and Rest Host from Env #46

Open enyachoke opened 7 months ago

enyachoke commented 7 months ago

I noticed that depending on the region, the API and MQTT endpoints may vary. My device for example connects to mqtt-s.ecoflow.com and api-s.ecoflow.com

berezhinskiy commented 6 months ago

@enyachoke In my opinion, it would be more advantageous to specify ECOFLOW_MQTT_HOST and ECOFLOW_REST_HOST within the same location as the other environment variables in the main() function, and subsequently pass them to the EcoflowAuthentication class. This approach will contribute to maintaining simplicity and readability in the code. Thanks

berezhinskiy commented 6 months ago

@enyachoke Additionally, kindly revise the README.md to incorporate the new environment variable into the Usage section.