Skip to content

Commit

Permalink
feat: get battery SOH from API
Browse files Browse the repository at this point in the history
  • Loading branch information
flobz committed Jan 8, 2024
1 parent c56aad4 commit 08f03e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion docs/psa_api.md → docs/psacc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 5 additions & 0 deletions psa_car_controller/web/view/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit 08f03e3

Please sign in to comment.