Kommentare hinzugefügt, Code strukturiert
This commit is contained in:
@@ -48,13 +48,18 @@ for zeile in inhalt:
|
||||
kosten_zeile = verbrauch * kosten_pro_kwh
|
||||
kosten_gesamt = kosten_gesamt + kosten_zeile
|
||||
verbrauch_gesamt = verbrauch_gesamt + verbrauch
|
||||
|
||||
# Kilometerstand ermitteln und anfügen
|
||||
datum_von = datum_umrechnen.umrechnen(spalte[1].strip() + ' ' + spalte[2].strip())
|
||||
|
||||
# Homeassistant API rufen
|
||||
api_response = api_call.send_request(datum_von)
|
||||
|
||||
apitext = api_response.text
|
||||
position = apitext.find("state")
|
||||
kilometer = apitext[position+8:position+13]
|
||||
|
||||
# Prometheus API rufen
|
||||
if kilometer == '':
|
||||
kilometer = api_prometheus.api_prom(datum_von)
|
||||
if kilometer == '':
|
||||
|
||||
Reference in New Issue
Block a user