-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add env vars support to options #349
Add env vars support to options #349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use env vars, how would you specify the inverters?
Co-authored-by: Johann Kellerman <[email protected]>
Co-authored-by: Johann Kellerman <[email protected]>
Have not looked at this case. The idea behind was to pass MQTT config more easily when using Docker Compose with env vars. I will look into ways to pass inverter config as well but not sure how useful that would be. edit: Maybe a good way would be to pass a json object/list in the env vars where lists are specified - inverters, sensors, etc. This would be rather easy to implement. |
5e980f6
to
3feb369
Compare
@kellerza Discussed changes have been implemented and functionality verified! Seems to work on my side. I also added documentation on this matter. |
for inv in loads(os.getenv("INVERTERS", "[]")) | ||
] | ||
sensor_definitions: str = os.getenv("SENSOR_DEFINITIONS", "single-phase") | ||
sensors: list[str] = loads(os.getenv("SENSORS", "[]")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could potentially support simple comma separated strings here? split instead of loads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I think this is more consistent with other options. In my opinion it could be added as another way to input a list, but shouldn't replace the json format.
Added support of env vars for docker image