embyt / enocean-mqtt

Receives messages from an enOcean serial interface (USB) and provides selected messages to an MQTT broker.
GNU General Public License v3.0
42 stars 21 forks source link

Using Environment Variables #28

Closed duylong closed 2 years ago

duylong commented 2 years ago

Hello,

It would be interesting to be able to use environment variables for certain options such as debug for example. I use them in a Docker environment.

I did this while waiting in the enoceanmqtt.py file :

    if os.getenv('DEBUG') == True:
        conf['debug'] = True

    # setup logger
duylong commented 2 years ago

It would be interesting to specify the level logs to be displayed by default by an environment variable.

romor commented 2 years ago

Not sure about this.

There is already the configuration file for most settings as well as command line arguments like --debug for increased logging output. To introduce a third method for configuration might raise more confusion than benefit?