Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add LFP Battery setting for car settings #4007

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/teslamate/settings/car_settings.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ defmodule TeslaMate.Settings.CarSettings do
field :req_not_unlocked, :boolean, default: false
field :free_supercharging, :boolean, default: false
field :use_streaming_api, :boolean, default: true
field :lfp_battery, :boolean, default: false

has_one :car, Car, foreign_key: :settings_id
end
Expand All @@ -19,7 +20,8 @@ defmodule TeslaMate.Settings.CarSettings do
:suspend_after_idle_min,
:req_not_unlocked,
:free_supercharging,
:use_streaming_api
:use_streaming_api,
:lfp_battery
]

@doc false
Expand Down
19 changes: 19 additions & 0 deletions lib/teslamate_web/live/settings_live/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,25 @@
</div>
</div>
</div>

<div class="columns is-mobile is-centered">
<div class="column">
<h2 class="title is-4"><%= gettext("Battery") %></h2>
<div class="field is-horizontal center-vertically">
<div class="field-label is-normal is-paddingless">
<%= label(f, :lfp_battery, gettext("LFP Battery"), class: "label") %>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<%= checkbox(f, :lfp_battery, class: "switch is-rounded is-success") %>
<%= label(f, :lfp_battery, nil) %>
</div>
</div>
</div>
</div>
</div>
</div>
</.form>
<% end %>

Expand Down
52 changes: 31 additions & 21 deletions priv/gettext/da/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ msgstr "ved at falde i søvn"
msgid "unavailable"
msgstr "ikke tilgængelig"

#: lib/teslamate_web/live/settings_live/index.html.heex:216
#: lib/teslamate_web/live/settings_live/index.html.heex:235
#, elixir-autogen, elixir-format
msgid "Length"
msgstr "Afstand"

#: lib/teslamate_web/live/settings_live/index.html.heex:231
#: lib/teslamate_web/live/settings_live/index.html.heex:250
#, elixir-autogen, elixir-format
msgid "Temperature"
msgstr "Temperatur"

#: lib/teslamate_web/live/settings_live/index.html.heex:213
#: lib/teslamate_web/live/settings_live/index.html.heex:232
#, elixir-autogen, elixir-format
msgid "Units"
msgstr "Enheder"
Expand Down Expand Up @@ -266,22 +266,22 @@ msgstr "Rækkevidde (nominel)"
msgid "Charger Power"
msgstr "Opladers effekt"

#: lib/teslamate_web/live/settings_live/index.html.heex:152
#: lib/teslamate_web/live/settings_live/index.html.heex:171
#, elixir-autogen, elixir-format
msgid "Preferred Range"
msgstr "Ønsket rækkevidde"

#: lib/teslamate_web/live/settings_live/index.html.heex:148
#: lib/teslamate_web/live/settings_live/index.html.heex:167
#, elixir-autogen, elixir-format
msgid "Range"
msgstr "Rækkevidde"

#: lib/teslamate_web/live/settings_live/index.html.heex:160
#: lib/teslamate_web/live/settings_live/index.html.heex:179
#, elixir-autogen, elixir-format
msgid "ideal"
msgstr "ideel"

#: lib/teslamate_web/live/settings_live/index.html.heex:161
#: lib/teslamate_web/live/settings_live/index.html.heex:180
#, elixir-autogen, elixir-format
msgid "rated"
msgstr "nominel"
Expand All @@ -291,7 +291,7 @@ msgstr "nominel"
msgid "Range (ideal)"
msgstr "Rækkevidde (ideel)"

#: lib/teslamate_web/live/settings_live/index.html.heex:151
#: lib/teslamate_web/live/settings_live/index.html.heex:170
#, elixir-autogen, elixir-format
msgid "The car's estimate of remaining range is based on a fixed energy consumption in Wh/km. The Wh/km factor is determined by Tesla and is not country specific whereas the rated range is based on regulatory tests in the different markets for that vehicle."
msgstr "Bilens overslag på den tilbageværende rækkevidde er baseret på et fast energiforbrug i Wh/km. Wh/km faktoren er bestem af Tesla og er ikke landespecifik, hvorimod den beregnede rækkevidde er baseret på myndighedernes testregler i de forskellige markeder for køretøjet."
Expand Down Expand Up @@ -322,7 +322,7 @@ msgid "Outside Temperature"
msgstr "Udetemperatur"

#: lib/teslamate_web/live/car_live/summary.html.heex:399
#: lib/teslamate_web/live/settings_live/index.html.heex:311
#: lib/teslamate_web/live/settings_live/index.html.heex:330
#, elixir-autogen, elixir-format
msgid "Version"
msgstr "Version"
Expand All @@ -342,19 +342,19 @@ msgstr "Ulåst"
msgid "Remaining Time"
msgstr "Tid tilbage"

#: lib/teslamate_web/live/settings_live/index.html.heex:286
#: lib/teslamate_web/live/settings_live/index.html.heex:305
#: lib/teslamate_web/templates/layout/root.html.heex:81
#, elixir-autogen, elixir-format
msgid "Dashboards"
msgstr "Oversigter"

#: lib/teslamate_web/live/settings_live/index.html.heex:264
#: lib/teslamate_web/live/settings_live/index.html.heex:283
#, elixir-autogen, elixir-format
msgid "URLs"
msgstr "URL'er"

#: lib/teslamate_web/live/settings_live/index.html.heex:178
#: lib/teslamate_web/live/settings_live/index.html.heex:267
#: lib/teslamate_web/live/settings_live/index.html.heex:197
#: lib/teslamate_web/live/settings_live/index.html.heex:286
#, elixir-autogen, elixir-format
msgid "Web App"
msgstr "Webapp"
Expand Down Expand Up @@ -421,12 +421,12 @@ msgstr "Gemt!"
msgid "Fetching vehicle data ..."
msgstr "Henter data for køretøjet ..."

#: lib/teslamate_web/live/settings_live/index.html.heex:193
#: lib/teslamate_web/live/settings_live/index.html.heex:212
#, elixir-autogen, elixir-format
msgid "Addresses"
msgstr "Adresser"

#: lib/teslamate_web/live/settings_live/index.html.heex:174
#: lib/teslamate_web/live/settings_live/index.html.heex:193
#, elixir-autogen, elixir-format
msgid "Language"
msgstr "Sprog"
Expand Down Expand Up @@ -475,7 +475,7 @@ msgstr "Opladningspris"
msgid "Free Supercharging"
msgstr "Gratis supercharging"

#: lib/teslamate_web/live/settings_live/index.html.heex:142
#: lib/teslamate_web/live/settings_live/index.html.heex:161
#, elixir-autogen, elixir-format
msgid "General Settings"
msgstr "Basale indstillinger"
Expand Down Expand Up @@ -533,17 +533,17 @@ msgstr "Kilometertal"
msgid "Streaming API"
msgstr "Streaming API"

#: lib/teslamate_web/live/settings_live/index.html.heex:332
#: lib/teslamate_web/live/settings_live/index.html.heex:351
#, elixir-autogen, elixir-format
msgid "Documentation"
msgstr "Dokumentation"

#: lib/teslamate_web/live/settings_live/index.html.heex:322
#: lib/teslamate_web/live/settings_live/index.html.heex:341
#, elixir-autogen, elixir-format
msgid "GitHub"
msgstr "GitHub"

#: lib/teslamate_web/live/settings_live/index.html.heex:317
#: lib/teslamate_web/live/settings_live/index.html.heex:336
#: lib/teslamate_web/templates/layout/root.html.heex:168
#, elixir-autogen, elixir-format
msgid "Update available"
Expand All @@ -570,7 +570,7 @@ msgstr "Pr. minut"
msgid "Software Update available (%{version})"
msgstr "Softwareopdatering tilgængelig (%{version})"

#: lib/teslamate_web/live/settings_live/index.html.heex:350
#: lib/teslamate_web/live/settings_live/index.html.heex:369
#, elixir-autogen, elixir-format
msgid "Sign out"
msgstr "Log Ud"
Expand Down Expand Up @@ -630,7 +630,7 @@ msgstr ""
msgid "To ensure that your <strong>Tesla API tokens are stored securely</strong>, an encryption key must be provided to TeslaMate via the <code>ENCRYPTION_KEY</code> environment variable. Otherwise, a <strong>login will be required after every restart</strong>."
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:246
#: lib/teslamate_web/live/settings_live/index.html.heex:265
#, elixir-autogen, elixir-format
msgid "Tire Pressure"
msgstr ""
Expand Down Expand Up @@ -659,3 +659,13 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "You are using the API key (%{token}) provided by %{url}. It will allow your TeslaMate to access the official Tesla Fleet API and Tesla Telemetry streaming."
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:141
#, elixir-autogen, elixir-format
msgid "Battery"
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:144
#, elixir-autogen, elixir-format
msgid "LFP Battery"
msgstr ""
52 changes: 31 additions & 21 deletions priv/gettext/de/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ msgstr "schläft ein"
msgid "unavailable"
msgstr "nicht verfügbar"

#: lib/teslamate_web/live/settings_live/index.html.heex:216
#: lib/teslamate_web/live/settings_live/index.html.heex:235
#, elixir-autogen, elixir-format
msgid "Length"
msgstr "Länge"

#: lib/teslamate_web/live/settings_live/index.html.heex:231
#: lib/teslamate_web/live/settings_live/index.html.heex:250
#, elixir-autogen, elixir-format
msgid "Temperature"
msgstr "Temperatur"

#: lib/teslamate_web/live/settings_live/index.html.heex:213
#: lib/teslamate_web/live/settings_live/index.html.heex:232
#, elixir-autogen, elixir-format
msgid "Units"
msgstr "Einheiten"
Expand Down Expand Up @@ -266,22 +266,22 @@ msgstr "Reichweite (rated)"
msgid "Charger Power"
msgstr "Ladeleistung"

#: lib/teslamate_web/live/settings_live/index.html.heex:152
#: lib/teslamate_web/live/settings_live/index.html.heex:171
#, elixir-autogen, elixir-format
msgid "Preferred Range"
msgstr "Bevorzugte Reichweite"

#: lib/teslamate_web/live/settings_live/index.html.heex:148
#: lib/teslamate_web/live/settings_live/index.html.heex:167
#, elixir-autogen, elixir-format
msgid "Range"
msgstr "Reichweite"

#: lib/teslamate_web/live/settings_live/index.html.heex:160
#: lib/teslamate_web/live/settings_live/index.html.heex:179
#, elixir-autogen, elixir-format
msgid "ideal"
msgstr "ideal"

#: lib/teslamate_web/live/settings_live/index.html.heex:161
#: lib/teslamate_web/live/settings_live/index.html.heex:180
#, elixir-autogen, elixir-format
msgid "rated"
msgstr "rated"
Expand All @@ -291,7 +291,7 @@ msgstr "rated"
msgid "Range (ideal)"
msgstr "Reichweite (ideal)"

#: lib/teslamate_web/live/settings_live/index.html.heex:151
#: lib/teslamate_web/live/settings_live/index.html.heex:170
#, elixir-autogen, elixir-format
msgid "The car's estimate of remaining range is based on a fixed energy consumption in Wh/km. The Wh/km factor is determined by Tesla and is not country specific whereas the rated range is based on regulatory tests in the different markets for that vehicle."
msgstr "Die Schätzung der verbleibenden Reichweite basiert auf einem fixen Energieverbrauch in Wh/km. Der Wh/km-Faktor wird von Tesla bestimmt und ist nicht länderspezifisch, wohingegen die 'rated' Reichweite auf regulatorischen Tests in den verschiedenen Märkten für dieses Fahrzeug basiert."
Expand Down Expand Up @@ -322,7 +322,7 @@ msgid "Outside Temperature"
msgstr "Außentemperatur"

#: lib/teslamate_web/live/car_live/summary.html.heex:399
#: lib/teslamate_web/live/settings_live/index.html.heex:311
#: lib/teslamate_web/live/settings_live/index.html.heex:330
#, elixir-autogen, elixir-format
msgid "Version"
msgstr ""
Expand All @@ -342,19 +342,19 @@ msgstr "nicht verschlossen"
msgid "Remaining Time"
msgstr "Restlaufzeit"

#: lib/teslamate_web/live/settings_live/index.html.heex:286
#: lib/teslamate_web/live/settings_live/index.html.heex:305
#: lib/teslamate_web/templates/layout/root.html.heex:81
#, elixir-autogen, elixir-format
msgid "Dashboards"
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:264
#: lib/teslamate_web/live/settings_live/index.html.heex:283
#, elixir-autogen, elixir-format
msgid "URLs"
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:178
#: lib/teslamate_web/live/settings_live/index.html.heex:267
#: lib/teslamate_web/live/settings_live/index.html.heex:197
#: lib/teslamate_web/live/settings_live/index.html.heex:286
#, elixir-autogen, elixir-format
msgid "Web App"
msgstr ""
Expand Down Expand Up @@ -421,12 +421,12 @@ msgstr "Gespeichert!"
msgid "Fetching vehicle data ..."
msgstr "Fahrzeugdaten werden abgerufen ..."

#: lib/teslamate_web/live/settings_live/index.html.heex:193
#: lib/teslamate_web/live/settings_live/index.html.heex:212
#, elixir-autogen, elixir-format
msgid "Addresses"
msgstr "Adressen"

#: lib/teslamate_web/live/settings_live/index.html.heex:174
#: lib/teslamate_web/live/settings_live/index.html.heex:193
#, elixir-autogen, elixir-format
msgid "Language"
msgstr "Sprache"
Expand Down Expand Up @@ -475,7 +475,7 @@ msgstr "Ladekosten"
msgid "Free Supercharging"
msgstr "Gratis Supercharger-Nutzung"

#: lib/teslamate_web/live/settings_live/index.html.heex:142
#: lib/teslamate_web/live/settings_live/index.html.heex:161
#, elixir-autogen, elixir-format
msgid "General Settings"
msgstr "Allgemeine Einstellungen"
Expand Down Expand Up @@ -533,17 +533,17 @@ msgstr "Kilometerstand"
msgid "Streaming API"
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:332
#: lib/teslamate_web/live/settings_live/index.html.heex:351
#, elixir-autogen, elixir-format
msgid "Documentation"
msgstr "Dokumentation"

#: lib/teslamate_web/live/settings_live/index.html.heex:322
#: lib/teslamate_web/live/settings_live/index.html.heex:341
#, elixir-autogen, elixir-format
msgid "GitHub"
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:317
#: lib/teslamate_web/live/settings_live/index.html.heex:336
#: lib/teslamate_web/templates/layout/root.html.heex:168
#, elixir-autogen, elixir-format
msgid "Update available"
Expand All @@ -570,7 +570,7 @@ msgstr "Pro Minute"
msgid "Software Update available (%{version})"
msgstr "Software Update verfügbar (%{version})"

#: lib/teslamate_web/live/settings_live/index.html.heex:350
#: lib/teslamate_web/live/settings_live/index.html.heex:369
#, elixir-autogen, elixir-format
msgid "Sign out"
msgstr "Abmelden"
Expand Down Expand Up @@ -630,7 +630,7 @@ msgstr "Der automatisch generierte Verschlüsselungscode, der für die aktuelle
msgid "To ensure that your <strong>Tesla API tokens are stored securely</strong>, an encryption key must be provided to TeslaMate via the <code>ENCRYPTION_KEY</code> environment variable. Otherwise, a <strong>login will be required after every restart</strong>."
msgstr "Um sicherzustellen, dass deine <strong>Tesla-API-Tokens sicher gespeichert</strong> werden, muss TeslaMate ein Verschlüsselungscode mittels der Umgebungsvariable <code>ENCRYPTION_KEY</code> übergeben werden."

#: lib/teslamate_web/live/settings_live/index.html.heex:246
#: lib/teslamate_web/live/settings_live/index.html.heex:265
#, elixir-autogen, elixir-format
msgid "Tire Pressure"
msgstr "Reifendruck"
Expand Down Expand Up @@ -659,3 +659,13 @@ msgstr "Erwartete Endzeit"
#, elixir-autogen, elixir-format, fuzzy
msgid "You are using the API key (%{token}) provided by %{url}. It will allow your TeslaMate to access the official Tesla Fleet API and Tesla Telemetry streaming."
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:141
#, elixir-autogen, elixir-format
msgid "Battery"
msgstr ""

#: lib/teslamate_web/live/settings_live/index.html.heex:144
#, elixir-autogen, elixir-format
msgid "LFP Battery"
msgstr ""
Loading
Loading