-
-
Notifications
You must be signed in to change notification settings - Fork 13
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 cache control configuration and initialization #81
Conversation
Thank you! I think this could work. I uploaded the version including this PR to dev tag on docker. Could you test it? |
Tested dev branch (set cacheMaxAge=30 in env) together with master evcc branch services:
tesla-ble-http-proxy:
image: wimaha/tesla-ble-http-proxy:dev
environment:
- cacheMaxAge=30 # Important to set this to anything more than 0
- httpListenAddress=:5687
container_name: tesla-ble-http-proxy
volumes:
- ~/TeslaBleHttpProxy/key:/key
- /var/run/dbus:/var/run/dbus
restart: always
privileged: true
network_mode: host
cap_add:
- NET_ADMIN
- SYS_ADMIN
ports:
- "5687:8080" and evcc snipet # ...
interval: 3s
# ...
vehicles:
- name: vehicle_1
title: blauer e-Golf
type: custom
soc:
source: http
uri: http://etera:5687/api/1/vehicles/xxx/vehicle_data?endpoints=charge_state
method: GET
jq: .response.response.charge_state.battery_level
timeout: 30s
# cache: 30s # <--- this is not set as it would only mess with the second layer of caching provided by evcc
range:
source: http
uri: http://etera:5687/api/1/vehicles/xxx/vehicle_data?endpoints=charge_state
method: GET
jq: .response.response.charge_state.battery_range
timeout: 30s
capacity: 44
# ... And success, looks like caching is working :^) It might be worth to consider the default value of cache max age, right now its 0 but maybe it would be good to either set it to maybe 5s; or add documentation how to run it with different settings. |
I will leave the cache to default 0 and updated the readme. |
Thank you for testing! |
@@ -4,7 +4,7 @@ You can optionally set environment variables to override the default behavior. | |||
|
|||
## logLevel | |||
|
|||
This is the log level. (Default: info) | |||
This is the log level. Options: debug, info, warn, error, fatal (Default: info) |
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.
Is it not only "debug"
or ""
?
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.
oh, the other options are available but not implemented.
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.
I've updated the readme. Thank you!
Implements #80