Skip to content

Commit

Permalink
Optimized status
Browse files Browse the repository at this point in the history
  • Loading branch information
wimaha committed Dec 29, 2024
1 parent cc0c4f2 commit dc11424
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions templates/definition/vehicle/tesla-ble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ render: |
scale: 1.60934
timeout: 30s
status:
source: combined
plugged:
source: http
uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state
jq: .response.response.charge_state.charging_state != "Disconnected"
timeout: 30s
charging:
source: http
uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state
jq: .response.response.charge_state.charging_state == "Charging"
timeout: 30s
source: http
uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state
method: GET
jq: (if (.response.response.charge_state.charging_state == "Charging") then "C"
elif (.response.response.charge_state.charging_state == "Stopped") then "B"
elif (.response.response.charge_state.charging_state == "NoPower") then "B"
elif (.response.response.charge_state.charging_state == "Complete") then "B"
else "A" end)
timeout: 30s

0 comments on commit dc11424

Please sign in to comment.