Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path to evogateway.cfg as a parameter at startup #63

Open
ericbieri opened this issue Dec 31, 2023 · 3 comments
Open

Path to evogateway.cfg as a parameter at startup #63

ericbieri opened this issue Dec 31, 2023 · 3 comments

Comments

@ericbieri
Copy link

Hi, first of all thanks for the effort you have put into the evoGateway project!

I would like to run evoGateway in a docker container (docker compose). I would make the configuration files externally accessible as a volume. For this to work, the configuration file evogateway.cfg would have to be in a separate directory (not project root), e.g. /config/evogateway.cfg.

As far as I can see (I am not a python expert), the location is defined in the constant CONFIG_FILE = "evogateway.cfg" (https://github.com/smar000/evoGateway/blob/master/evogateway.py#L86).

Would it be possible for you to adapt the code so that the path of this file can be passed as a parameter when starting the application?

Cheers Eric

@smar000
Copy link
Owner

smar000 commented Jan 1, 2024

Sure, I will look at adding it next time I do an update. In the meantime you could try replacing the line 68 with something like the following (not tested!):


import argparse
parser = argparse.ArgumentParser(description="evoGateway - MQTT Gateway for evohome")
parser.add_argument("-c","--config", help="Specify config file", required=False)
args=vars(parser.parse_args())

CONFIG_FILE = args["config"] if "config" in args else "evogateway.cfg"

The config file can be passed with e.g. -c evogateway.cfg

@ericbieri
Copy link
Author

Hi smar000, cool thanks in advance for adding this feature and a happy and successful year 2024 to you. ;-)

@smar000
Copy link
Owner

smar000 commented Jan 2, 2024

Most welcome, and happy new year to you too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants