diff --git a/README.md b/README.md index 8535745..cb8f357 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/psa_api.md b/docs/psacc_api.md similarity index 91% rename from docs/psa_api.md rename to docs/psacc_api.md index ce59ccf..339b86b 100644 --- a/docs/psa_api.md +++ b/docs/psacc_api.md @@ -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/ \ No newline at end of file diff --git a/psa_car_controller/web/view/api.py b/psa_car_controller/web/view/api.py index 6393b41..4bd123c 100644 --- a/psa_car_controller/web/view/api.py +++ b/psa_car_controller/web/view/api.py @@ -182,3 +182,8 @@ def settings_section(section: str): def settings(): return json_response(APP.config.json()) + +@app.route('/battery/soh/') +def db(vin: str): + soh = Database.get_last_soh_by_vin(vin) + return jsonify({"soh": soh})