From 822f2d6b95ee190ae35e3ba4e3d1a5b8adae2060 Mon Sep 17 00:00:00 2001 From: Atrox Date: Wed, 3 Apr 2024 12:58:17 +0200 Subject: [PATCH] publish center_display_state to mqtt --- lib/teslamate/mqtt/pubsub/vehicle_subscriber.ex | 3 ++- lib/teslamate/vehicles/vehicle/summary.ex | 5 +++-- website/docs/integrations/mqtt.md | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/teslamate/mqtt/pubsub/vehicle_subscriber.ex b/lib/teslamate/mqtt/pubsub/vehicle_subscriber.ex index c770e714c93..407924c9bc7 100644 --- a/lib/teslamate/mqtt/pubsub/vehicle_subscriber.ex +++ b/lib/teslamate/mqtt/pubsub/vehicle_subscriber.ex @@ -45,7 +45,8 @@ defmodule TeslaMate.Mqtt.PubSub.VehicleSubscriber do @always_published ~w(charge_energy_added charger_actual_current charger_phases charger_power charger_voltage scheduled_charging_start_time - time_to_full_charge shift_state geofence trim_badging)a + time_to_full_charge shift_state geofence trim_badging + center_display_state)a def handle_info(%Summary{} = summary, state) do summary diff --git a/lib/teslamate/vehicles/vehicle/summary.ex b/lib/teslamate/vehicles/vehicle/summary.ex index 1ead0a5becb..094b5d1fa42 100644 --- a/lib/teslamate/vehicles/vehicle/summary.ex +++ b/lib/teslamate/vehicles/vehicle/summary.ex @@ -15,7 +15,7 @@ defmodule TeslaMate.Vehicles.Vehicle.Summary do model trim_badging exterior_color wheel_type spoiler_type trunk_open frunk_open elevation power charge_current_request charge_current_request_max tpms_pressure_fl tpms_pressure_fr tpms_pressure_rl tpms_pressure_rr tpms_soft_warning_fl tpms_soft_warning_fr tpms_soft_warning_rl tpms_soft_warning_rr climate_keeper_mode - active_route_destination active_route_latitude active_route_longitude + active_route_destination active_route_latitude active_route_longitude center_display_state )a def into(nil, %{state: :start, healthy?: healthy?, car: car}) do @@ -133,7 +133,8 @@ defmodule TeslaMate.Vehicles.Vehicle.Summary do tpms_soft_warning_fl: get_in_struct(vehicle, [:vehicle_state, :tpms_soft_warning_fl]), tpms_soft_warning_fr: get_in_struct(vehicle, [:vehicle_state, :tpms_soft_warning_fr]), tpms_soft_warning_rl: get_in_struct(vehicle, [:vehicle_state, :tpms_soft_warning_rl]), - tpms_soft_warning_rr: get_in_struct(vehicle, [:vehicle_state, :tpms_soft_warning_rr]) + tpms_soft_warning_rr: get_in_struct(vehicle, [:vehicle_state, :tpms_soft_warning_rr]), + center_display_state: get_in_struct(vehicle, [:vehicle_state, :center_display_state]) } end diff --git a/website/docs/integrations/mqtt.md b/website/docs/integrations/mqtt.md index 07d643fa7a9..78c973382e5 100644 --- a/website/docs/integrations/mqtt.md +++ b/website/docs/integrations/mqtt.md @@ -79,6 +79,7 @@ Vehicle data will be published to the following topics: | `teslamate/cars/$car_id/active_route_destination` | Home | Navigation destination name | | `teslamate/cars/$car_id/active_route_latitude` | 35.278131 | Navigation destination latitude | | `teslamate/cars/$car_id/active_route_longitude` | 29.744801 | Navigation destination longitude | +| `teslamate/cars/$car_id/center_display_state` | 0 | Center Display State | :::note `$car_id` usually starts at 1