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

Corrected a missmatch between the verbose environnement flag and read value #304

Open
wants to merge 1 commit into
base: 2.7.8
Choose a base branch
from

Conversation

egguy
Copy link
Contributor

@egguy egguy commented Feb 28, 2023

When setting the environment flag gverbose to True or False, there is no change.

The problem stems from this line:

if os.getenv('gverbose') != None : self.verbose = self.getenv('verbose')

If the env var gverbose is detected, it reads the env var verbose, but verbose is not set, so the verbose mode stays False.

If you set both the env var to :

gverbose=True
verbose=True

It starts to work

This patch corrects this problem Tested after the patch, you only need to set gverbose for the verbose logging to work.

@johanmeijer
Copy link
Owner

Thanks will merge this soon.

@rany2
Copy link

rany2 commented Mar 15, 2023

@johanmeijer I realized that this method of manually specifying environment key is so error-prone. In my fork I have this process automated via a custom configparser with option of specifying a custom env key in case of conflict (like influxdb/mqtt username/pass) https://github.com/rany2/grott/blob/master/grottconf.py#L25-L66

johanmeijer added a commit that referenced this pull request Mar 17, 2023
- added first MIN support 
- added some field to SPA layout 
- fix bug with gverbose environment (see pr: #304)
- fix bug in devider for batery SOC (see pr: #305)
johanmeijer added a commit that referenced this pull request Mar 17, 2023
- added first MIN support 
- added some field to SPA layout 
- fix bug with gverbose environment (see pr: #304)
- fix bug in devider for batery SOC (see pr: #305)
@johanmeijer
Copy link
Owner

I changed the error according the gverbose manually.

I like the idea of the automatic generation off the environmental variables and will pick to up in a next release (needs some more test work from my side).

johanmeijer added a commit that referenced this pull request Mar 19, 2023
- added first MIN support 
- added some field to SPA layout 
- fix bug with gverbose environment (see pr: #304)
- fix bug in devider for batery SOC (see pr: #305)
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

Successfully merging this pull request may close these issues.

3 participants