339 Commits

Author SHA1 Message Date
Wouter Hermans a3887390c1 feat: add optional dark mode feature (#5065)
* Add optional dark mode feature

This PR adds an optional dark mode to TeslaMate with three appearance options:
- Light (default): Always use light theme
- Follow System: Automatically match OS/browser dark mode preference
- Dark: Always use dark theme

Key features:
- Database-persisted theme preference in GlobalSettings
- Comprehensive dark mode styling for all UI components
- Monochrome map tiles in dark mode (Tesla-inspired aesthetic)
- Instant theme switching without page reload
- No flash of wrong theme on page load
- Defaults to light mode for existing users

Technical implementation:
- New theme_mode field in settings table (migration included)
- CSS custom properties for theme colors
- JavaScript theme detection and system preference monitoring
- LiveView hook for instant theme changes
- Inverted OSM map tiles with grayscale filter for dark mode

Maintains backward compatibility - existing installations will
default to light mode and users can opt-in to dark mode.

* Run treefmt to fix code formatting

* Extract translation strings for theme settings

* Add Dutch, French, and German translations for theme settings

- Dutch: Thema, Weergave, Licht, Donker, Volg systeem
- French: Thème, Apparence, Clair, Sombre, Suivre le système
- German: Design, Darstellung, Hell, Dunkel, Systemeinstellung folgen

* Address review feedback: default to system theme, add tests and documentation

* Fix white background showing at bottom in dark mode

* Make footer sticky at bottom of viewport

* Remove WARP.md from .gitignore

* Fix visibility of inverted light buttons in dark mode

Improved contrast for edit/delete buttons in Geo-Fences table
by adding proper dark mode styling for is-inverted is-light buttons.

Co-Authored-By: Warp <agent@warp.dev>

* Add icon color inheritance for inverted light buttons

Ensure edit (blue) and delete (red) button icons are colored properly.

Co-Authored-By: Warp <agent@warp.dev>

* CI: use master as default branch in reusable workflows

Fix paths-filter and PR triggers by replacing hardcoded 'main' with 'master'.

Co-Authored-By: Warp <agent@warp.dev>

* Revert CI branch changes per maintainer request

Restore 'main' references in reusable workflows. No CI changes in this PR.

Co-Authored-By: Warp <agent@warp.dev>

* Dark mode: hide empty table header background in car summary

Add .thead-transparent class to the summary table and override thead bg to match
card surface, avoiding the apparent 'divider' under the title in dark mode.

Co-Authored-By: Warp <agent@warp.dev>

* Dark mode: fix tabs hover/active styles for boxed tabs in Settings

Ensure hover doesn’t turn tabs white; use surface/surface-light colors and proper borders for .tabs.is-boxed.

Co-Authored-By: Warp <agent@warp.dev>

* Dark mode: override Bulma active navbar dropdown item background

Ensure .navbar-dropdown .navbar-item.is-active uses dark surface color instead of light-mode whitesmoke.

Co-Authored-By: Warp <agent@warp.dev>

---------

Co-authored-by: Warp <agent@warp.dev>
2026-01-22 11:20:50 +01:00
Jakob Lichterfeld 11cbe9eff5 style: fix typo in test error message description 2025-12-02 13:15:49 +01:00
jaypark0006 f31eab70d7 feat: support proxy for openstreet API (#4970)
* feat: support proxy for openstreet API

Signed-off-by: jaypark0006 <163750793+jaypark0006@users.noreply.github.com>

* test: fix test

Signed-off-by: jaypark0006 <163750793+jaypark0006@users.noreply.github.com>

* refactor: rename proxy name to nominatim_proxy

Signed-off-by: jaypark0006 <163750793+jaypark0006@users.noreply.github.com>

* refactor: turning @pools into a function

Signed-off-by: jaypark0006 <163750793+jaypark0006@users.noreply.github.com>

* docs: add NOMINATIM_PROXY for proxy OpenStreetMap api

Signed-off-by: jaypark0006 <163750793+jaypark0006@users.noreply.github.com>

---------

Signed-off-by: jaypark0006 <163750793+jaypark0006@users.noreply.github.com>
2025-10-13 09:36:45 +02:00
JakobLichterfeld 9d94d7e8e8 feat(webview): update wording to View car location on Google Maps for clarity (#4875)
* feat(webview): update wording to View car location on Google Maps for clarity

* docs: update changelog

* test: update test according to new wording
2025-08-15 20:21:39 +02:00
JakobLichterfeld b985ab2f45 ux: change Google Maps Button Link to icon to ensure a consistent UX (#4838)
* ux: change Google Maps Button Link to icon to ensure a consistent UX

* test: correct test for car location on Google Maps link

* docs: update changelog

* chore(i18n): update POT files

* docs: update changelog

* docs: update changelog
2025-07-21 13:56:33 +02:00
Matthias Wirtz 0eefeac20b feat: add total ascent & descent to the drive table, introduce slope-adjusted efficiency metric in drives dashboard (#4798)
* slope-adjusted efficiency

* docs: update changelog

* docs: include migration time in changelog

* docs: update changelog

* build: bump minor version

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2025-07-19 11:07:02 +02:00
Calvin Huang 97563e2175 feat(webview): add Google Maps link for car's current location (#4781)
* Add Google Maps link for car's current location

- Add Google Maps link in car summary view
- Link opens car's current location in new tab
- Follows existing external link patterns
- Uses consistent Bulma styling

Co-Authored-By: Calvin Huang <c@lvin.me>

* Fix HTML div structure in summary template

- Remove extra closing div that caused compilation error
- Properly nest card-content div structure

Co-Authored-By: Calvin Huang <c@lvin.me>

* Add test for Google Maps link in car summary view

- Test verifies link presence with correct coordinates
- Test validates href URL format and security attributes
- Test ensures proper CSS styling and link text
- Follows existing TeslaMate testing patterns with online_event() helper
- Uses Floki for HTML parsing and attribute verification

Co-Authored-By: Calvin Huang <c@lvin.me>

* style: linter findings

* Update POT files for translation

- Run mix gettext.extract --merge to update translation files
- Addresses PR comment feedback about updating pot files
- No new translatable strings added from Google Maps feature

Co-Authored-By: Calvin Huang <c@lvin.me>

* docs: update changelog

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2025-07-09 09:24:46 +02:00
allivshits 718ec1a4b1 feat(mqtt): always publish healthy status and disable retain to prevent stale healthy status via mqtt (#4817)
* Always publish and do not retain 'healthy' topic

* fix linter errors & explicitly cleanup retained messages for do_not_retain topics

* fix tests broken by change in healthy topic retantion strategy

* docs: update changelog

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2025-07-08 18:46:17 +02:00
JakobLichterfeld 2a922e321c feat: update to Phoenix HTML 4.1, bump dependencies (#4277)
* feat: update to Phenix HTML 4.1

* fix: updating to the new Gettext.Backend approach

* chore: update pot files ro locale version 45.0.0

* fix: downgrade cloack back to 1.1.2

* revert: merge of mix.lock

* fix: new syntax for field name generation for phx-feedback-for

* Revert "fix: new syntax for field name generation for phx-feedback-for"

This reverts commit 4d95e4f1c9.

* fix: downgrade floki back to 0.35.2

* Revert "fix: downgrade floki back to 0.35.2"

This reverts commit a4f0b6bf4b.

* fix: ensure floki nil is handled

* style: linter findings

* Revert "fix: ensure floki nil is handled"

* fix: new syntax for field name generation for phx-feedback-for

* debug: floki paramter error

* Revert "debug: floki paramter error"

This reverts commit 61920267ed.

* fix: Remove unnecessary code in settings_test.exs which breaks floki 0.36+
2024-10-27 08:17:49 +01:00
Jakob Lichterfeld 00fdadcd06 feat: add LFP Battery setting for car settings (#4007) -> master 2024-07-05 19:11:12 +02:00
mark3-dev c90cde871d feat: Add ability to enable and disable data collection for cars (#3993)
* Add ability to enable and disable cars

* Add default value for enabled in car_settings.

* Fix unit tests.

* Fix formatting.

* Update text to be more descriptive

* Update lables.
2024-07-05 09:01:16 +02:00
jlestel b900a98d08 feat: Respect Retry-After header on 429 response code (#3943)
* Respect 429 response code instructions

* format

* up

* up

---------

Co-authored-by: Julien <julien@citio.digital>
2024-06-07 10:10:35 +02:00
Wilfried Chauveau 0db778e06c feat: Update TeslaFi importer to accept newer export formats (#3431)
* Update TeslaFi importer to accept newer export formats

* Update documentation
2024-05-24 09:01:50 +02:00
Brian May c684252940 Publish extra active_route fields to mqtt output (#3789)
This refactors the existing code to make it more maintainable.

Nil values are published as "nil" string. This ensures that they will
get published, and ensures that MQTT doesn't drop the retained data.

Fixes #3748
2024-04-05 17:29:00 +11:00
Brian May b5285d2ace Add location topic (lat and long in one json blob) (#3729)
* Add location topic

Fixes #3660.

* doc: update mqtt topics with new location topic

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2024-03-18 08:36:21 +01:00
Michael Vestergaard 46b971070a Fix agressive switch to offline when stream gets offline message (#3672)
* Changed when stream reports offline to fetch data and let result decide the real state instead of switching directly to offline.

* Adjusted test
2024-03-16 11:52:55 +01:00
Brian May 8353b8e988 Make tests non-async (#3738)
It appears to fix most of the random test errors.

Fixes: #3736
2024-03-15 09:09:05 +11:00
Long Zheng 78fe8116ad Add navigation active route drive state data (#3657)
* Add navigation active route drive state data

* Add active_route data to MQTT

* Update MQTT documentation

* Fix streaming test drive state
2024-02-08 08:45:42 +01:00
marvelm da819054f6 feat: Upgrade web development framework to Phoenix 1.7 (#3615)
* Upgrade to phoenix 1.7.0
The minimal changes necessary to compile the application

* Import Phoenix.Component instead of LiveView

* Fix compilation warnings

* mix format

* Update tests to trim newline characters

* mix gettext.extract --merge

* style: correct linting

* rebuild gettext

* fix: correct spacing before unit for energy added

* fix: use unicode character for whitespace

* fix: spacing with witespace

* fix: use numeric value for charge_energy_added in charging test

* fix: avoid warning about unsued function, which is actually used in plug

* fix: use whitespace in test before charge_energy_added

---------

Co-authored-by: JakobLichterfeld <jakob-lichterfeld@gmx.de>
2024-02-07 19:23:53 +01:00
Michael Vestergaard 1857f25d0f Handle stream getting the message "Vehicle is offline" and change the state to offline in vehicle (#3508) 2024-01-19 14:09:59 +01:00
Nir Klinger b5fa0242a3 Fix an issue when car is could enter sleep mode while dog mode is enabled (#3538)
* Fix an issue when car is could enter sleep mode while dog mode is enabled.

* Update pot files

* revert change

* Fix tests

* Fix tests and issue when try to sleep was not showing

* Fix lint issue
2023-12-12 13:18:03 +01:00
Brian May b643b45ca0 Add charging_state to VehicleSummary (#3471)
* Add charging_state to VehicleSummary

Fixes: #3078

* WIP
2023-11-23 09:06:51 +01:00
JakobLichterfeld 20f1574d29 Revert "ci: Fix failed elixir tests (#3428)" (#3440)
This reverts commit c00dbaaa5b.
2023-11-16 18:04:52 +01:00
Nir Klinger c00dbaaa5b ci: Fix failed elixir tests (#3428)
* Fix failed tests
2023-11-16 16:28:33 +01:00
Adrian Kumpf c0937bc3a3 Fix formatting 2023-11-12 19:41:23 +01:00
Adrian Kumpf 9df62aee54 Update repo URL 2023-11-12 19:30:36 +01:00
Adrian Kumpf b545eaf8f4 Remove donation links 2023-11-12 19:26:52 +01:00
Adrian Kumpf 0e7887e5e4 Fix warnings on Elixir 1.16 2023-11-12 19:12:48 +01:00
Adrian Kumpf 2ac9ac49bd Update srtm to 0.8.0 2023-11-12 19:12:47 +01:00
Adrian Kumpf faa002bab4 Trim geo fence name 2023-11-12 17:51:28 +01:00
Adrian Kumpf b2b0c4555d Format code 2023-06-11 00:58:26 +02:00
Adrian Kumpf e243645abb Add Dialyzer 2023-06-10 18:44:18 +02:00
Adrian Kumpf 8756c66bca Fix typos 2023-02-03 21:20:10 +01:00
Martin Hüser 8377f361ce fix gpx format (#2925)
some tools, e.g. Garmin Basecamp, expect a proper namespace
definition in the xml root element and are more sensitive to
xml schema violations.

Track point elevation is specified to be an element of type
xsd:decimal in the gpx schema. But Teslamate renders an
empty element <ele></ele> when no elevation data is present.
This fix does not render an <ele> element when no elevation
is present

Also the gpx schema requires a "creator" attribute on the
gpx root element.
2023-01-13 14:00:36 +01:00
Adrian Kumpf a413e8ce2c Add setting to select tire pressure units 2022-07-18 11:35:14 +02:00
Adrian Kumpf a0e12c3808 Store marketing names
... and identify new Model S and X.

Closes #2494, #2496
2022-04-22 15:42:25 +02:00
Adrian Kumpf 0d6e288c70 Encrypt API tokens (#2360)
Store API tokens encrypted in the database.

During the database migration a randomly generated key will be used encrypt the tokens if no ENCRYPTION_KEY environment variable was provided.

If the application is started without the presence of an ENCRYPTION_KEY (or if the key failed to decrypt the existing tokens), the UI will display a warning with further instructions.
2022-02-18 17:03:13 +01:00
cwanja 66254de906 Update summary.html.heex (#2390)
* Update summary.html.heex

Create a link on the summary page to link to Not a Tesla App release notes page per discussion request #2367 

Full disclosure - not proficient in Elixir, but understand HTML and capable of digging through other code and comparing. Just not sure how the `@summary.version` is going to be treated in the link text.

* Fix string interpolation

* Update tests

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>
2022-01-28 12:16:17 +01:00
Adrian Kumpf 6c53788738 Don't suspend logging while downloading an update
Fixes #2194
2022-01-22 13:00:50 +01:00
Adrian Kumpf 8aa772872a Remove support for logins with username/password 2022-01-21 19:09:32 +01:00
Adrian Kumpf b4ad1ff2cd Remove unnecessary id attributes 2022-01-01 17:29:36 +01:00
Adrian Kumpf 977f423014 Use new Chinese endpoints
Related to #2214
2021-12-13 19:08:22 +01:00
Adrian Kumpf 0e4e551489 Fix flaky test 2021-11-12 19:27:41 +01:00
Adrian Kumpf 1992af38c3 Show token sign-up form by default 2021-11-12 17:39:20 +01:00
Adrian Kumpf 451b23634c Sign out if API repeatedly returns 401 response 2021-11-05 18:53:50 +01:00
magine 91dca9525b Fix typos in suspend tests (#2103) 2021-10-31 17:30:20 +01:00
Adrian Kumpf 835326f8b3 Add NOT NULL constraint to charging_processes.start_date
Fixes #2088
2021-10-22 12:46:22 +02:00
Adrian Kumpf 6c0c0eeaa9 Display marketing names
Related to #2030
2021-10-06 12:25:18 +02:00
Adrian Kumpf ec8b604c00 Discard stale stream data when falling asleep 2021-09-29 19:25:29 +02:00
Adrian Kumpf e4f0cb9767 Unify wording 2021-09-27 19:19:27 +02:00