Skip to content

Tesla#2746

Merged
LKuemmel merged 3 commits intoopenWB:masterfrom
benderl:tesla
Sep 16, 2025
Merged

Tesla#2746
LKuemmel merged 3 commits intoopenWB:masterfrom
benderl:tesla

Conversation

@benderl
Copy link
Contributor

@benderl benderl commented Sep 10, 2025

minor fixes:

  • switch to f-strings
  • format soc timestamp in seconds

changed:

  • fetch soc if car is not online

@benderl benderl marked this pull request as draft September 10, 2025 06:00
@benderl benderl self-assigned this Sep 10, 2025
# convert miles to km
range = float(response["response"]["charge_state"]["battery_range"]) * 1.60934
soc_timestamp = float(response["response"]["charge_state"]["timestamp"])
range = int(float(response["response"]["charge_state"]["battery_range"]) * 1.60934)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welche Bedeutung hat 1.60934? -> Konstante mit sprechendem Namen bitte...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steht in Zeile 48.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steht in Zeile 48.

ja.... als Kommentar... ;o)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genau. Und da das die einzige Stelle ist, an der die Zahl verwendet wird, sehe ich keinen Bedarf für eine Konstante, die dann irgendwo losgelöst vom Kontext definiert wird.

@benderl benderl marked this pull request as ready for review September 16, 2025 07:13
@benderl benderl requested a review from LKuemmel September 16, 2025 07:13
@LKuemmel LKuemmel merged commit 2ce24d7 into openWB:master Sep 16, 2025
1 check passed
@benderl benderl deleted the tesla branch September 16, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants