feat: get battery SOH from API

This commit is contained in:
Florian Bezannier
2024-01-08 08:57:16 +01:00
committed by Florian BEZANNIER
parent c56aad4204
commit 08f03e3a53
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ The official API is documented [here](https://developer.groupe-psa.io/webapi/b2c
- [Installation on Raspberry Pi with docker-compose (external Tutorial)](https://return2.net/opel-peugeot-electric-vehicle-set-charging-threshold-limit/)
## II. Use the API
Look at [API documentation](./docs/psa_api.md)
Look at [API documentation](./docs/psacc_api)
## III. Use the dashboard
+5 -1
View File
@@ -55,4 +55,8 @@
http://localhost:5000/settings/electricity_config?night_price=0.2
http://127.0.0.1:5000/settings/general?currency=%C2%A3
http://localhost:5000/settings/general?currency=%C2%A3
15. Get battery SOH
http://localhost:5000/battery/soh/<vin>
+5
View File
@@ -182,3 +182,8 @@ def settings_section(section: str):
def settings():
return json_response(APP.config.json())
@app.route('/battery/soh/<string:vin>')
def db(vin: str):
soh = Database.get_last_soh_by_vin(vin)
return jsonify({"soh": soh})