fmartinou / teleinfo2mqtt

Publish teleinfo to mqtt topics
https://fmartinou.github.io/teleinfo2mqtt
MIT License
67 stars 18 forks source link

Add EMIT_INTERVAL parameter #5

Closed gtricot closed 3 years ago

gtricot commented 3 years ago

Hi @fmartinou,

First of all, thank you for that component. I'm new to HomeAssistant and it works like a charm. I forked your repo and created that PR because I'd like to configure the interval between 2 MQTT emissions (Update of my Teleinfo sensors every 5 or 10 seconds seems sufficient in my own opinion). Unfortunately, I don't know how to build a Docker image locally and test it before pushing my new code. Could you please help me to achieve that ?

Thank's.

fmartinou commented 3 years ago

Hi @gtricot ,

Thank you very much for your contribution!

To locally build the Docker image, you need to:

  1. Install Docker on your machine
  2. Build the image docker build -t teleinfo-mqtt-local . (run the command from the root folder of the project)
  3. Check the image docker run ... teleinfo-mqtt-local

Please notice that you don't need to build the image to be able to test the app. (you can just run the node.js app with npm start)

If you can just test your changes by running the node app itself, it will be ok.

I'll review your changes and will add comments if so.

fmartinou commented 3 years ago

FYI, the CI is managed by Travis: https://travis-ci.org/github/fmartinou/teleinfo-mqtt/builds/763571285 One unit test is failing; may you adjust it? Thanks!

fmartinou commented 3 years ago

Please forget my comment about failed unit tests; I didn't look at the logs in details. Actually, the UT are ok :) The build fails for another reason (an issue with docker credentials); there is no relation with your changes.

gtricot commented 3 years ago

After a little change (EMIT_INTERVAL in seconds), I tested my changes running the node app locally and it works as expected :

Could you please review my changes ?

fmartinou commented 3 years ago

I just published the release 3.1.0 wich includes your changes. Thank you for your contribution!