-
Notifications
You must be signed in to change notification settings - Fork 39
Add a backup key in the configuration #84
Comments
Yeah, good idea. I had the same idea a few weeks ago. I will try to implement this feature, but I need your help. If your quota is depleted, which http code will be returned? EDIT: If you don't know yet, enable debug log and upload your log. |
I found it in the logs, it's 403 Forbidden. |
Nice, I will take a look. |
Are you able to test a dev release as single docker image, outside HA OS ? |
I can try. I just need to run the docker image? or what are the steps? |
Yes, I test the changes know and create a dev build later today. |
Here you go. Start your docker container like this:
Please test today and tomorrow. If everything works, I will merge into main. |
I got this in the logs:
Is it something wrong with the variables I'm using maybe? This is how I run the docker container:
|
Your json seems to be invalid. Your pasted command works for me without any errors. Double check the command filled with your real values. Maybe your password contains a |
weird, I validated both jsons, and the passwords have just letters and numbers |
Thats odd... but okay, it works. |
Got it, so if the quota from the default one is depleted, it will switch to the other one immediately, but only until the next day. |
Noep, it will switch if the key is depleted. Then it will try the "other" key. Either the default, or the backup key, depending on what were used last. |
Done, it works!
|
Nice, then it should revert to the default key tomorrow |
I stopped my docker container for a few hours and when I started it again I get this in the logs: The backup key has only 2k requests, and it's not midnight yet. UPDATE: I think I caught a bug, here's how to reproduce it:
Expected result would be to gracefully switch from default to backup at startup, but instead it will crash with the errors in the log above. EDIT: File removed. Contains sensitive data. |
Thanks a lot! I will take a look later. |
Should be fixed. Please pull the image again and test some more! |
It works now, I depleted my default key quota then restarted the addin and it continued with the backup key.
|
We should test a few more times, so take your time. I will merge in the next days, if everything works. |
I found another bug. If both keys are extended, the addon crashes. Are you able to reproduce this behaviour ? |
I reworked the whole vcc api backup key section, as this was a real mess. In the next release, you will be able to specify multiple vcc-api-keys in your config. You can save as much keys as you want, not only one backup key. This seems to be a far better solution for me. Your config will look like this:
|
Indeed, it's a better solution at least from the users's point of view because you're not limited to 2 keys. I didn't had time in the last 2 days but tonight I'll pull the latest image and test again, I'll update you tomorrow on how it goes. |
+1 for multiple keys! I'm going to try out it as well! |
Nice. I've created 4 applications and added all primary api keys (what are the secondary keys for?). My refresh rate is set to 60. I want updates every minute :) When I start the container, I've used 28 request for the first update. How many requests does it perform every cycle? |
The secondary keys are not used. I don't know what they are for. |
This function is available starting release v1.8.0. |
I set my addon to refresh every 90 seconds, but sometimes this depletes the quota, it depends on how much I drive in that day. Would it be possible to add a "backup key" as well in the configuration for situations like this? I created another app in my Volvo account so this way I could use shorter intervals.
The main reason I don't use the default 300 seconds interval is because I need to detect as soon as possible when I'm starting the car to log the battery/fuel levels when a trip starts.
The text was updated successfully, but these errors were encountered: