-
Notifications
You must be signed in to change notification settings - Fork 30
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
Remove @requires_credentials decorator #61
Conversation
It looks like the Renault API is inconsistent in reporting chargingInstantaneousPower. The CLI assumes that it is reported as Watt, but in my case it is reported as kiloWatt. The result is that the value for Charge Rate is to small by the factor 1000. Therefore I added a new cli argument --kw for the status command which interprets chargingInstantaneousPower as kW. The default behaviour without --km argument the same as the current behaviour.
I'm not sure that removing the decorator was the desired outcome of #10, only that it would use the credentials store from the object it's being used within. I'm willing to hear the argument for removing it wholesale, though? |
Added new cli argument --kw for status command
The decorator only works when there is a "singleton" credential store. For example, if you create a custom store, add the credentials to that store, then run the code with the decorator, then the decorator will generator a new singleton, find if empty and reject the method. I couldn't find a way to access the custom store rather than the singleton from the requires_credentials method. If you have a way for the decorator to use the "local" CredentialStore instead of the "global/singleton" CredentialStore then that's great... |
Hi @jamesremuscat |
This is a fix for issue #10