From d7656a6d5c39531efaf75827d8fc29da40c77c48 Mon Sep 17 00:00:00 2001 From: cwanja <54645561+cwanja@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:57:28 -0500 Subject: [PATCH 1/6] Update state.ex Added fields to catpreu cabin overheat protection --- lib/tesla_api/vehicle/state.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tesla_api/vehicle/state.ex b/lib/tesla_api/vehicle/state.ex index 6220e9ddd7..0b68521703 100644 --- a/lib/tesla_api/vehicle/state.ex +++ b/lib/tesla_api/vehicle/state.ex @@ -98,6 +98,8 @@ defmodule TeslaApi.Vehicle.State do :battery_heater, :battery_heater_no_power, :climate_keeper_mode, + :cabin_overheat_protection, + :cabin_overheat_protection_actively_cooling, :defrost_mode, :driver_temp_setting, :fan_status, @@ -133,6 +135,8 @@ defmodule TeslaApi.Vehicle.State do battery_heater: climate["battery_heater"], battery_heater_no_power: climate["battery_heater_no_power"], climate_keeper_mode: climate["climate_keeper_mode"], + cabin_overheat_protection: climate["cabin_overheat_protection"], + cabin_overheat_protection_actively_cooling: claimte["cabin_overheat_protection_actively_cooling"], defrost_mode: climate["defrost_mode"], driver_temp_setting: climate["driver_temp_setting"], fan_status: climate["fan_status"], From ab6199088fdb5108c46ca2f2c1f8115b9c377989 Mon Sep 17 00:00:00 2001 From: cwanja <54645561+cwanja@users.noreply.github.com> Date: Wed, 16 Aug 2023 13:02:34 -0500 Subject: [PATCH 2/6] Update position.ex Added cabin overheat protection. --- lib/teslamate/log/position.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/teslamate/log/position.ex b/lib/teslamate/log/position.ex index 9f7f9af459..4a3d05f6a9 100644 --- a/lib/teslamate/log/position.ex +++ b/lib/teslamate/log/position.ex @@ -9,7 +9,6 @@ defmodule TeslaMate.Log.Position do field :latitude, :decimal, read_after_writes: true field :longitude, :decimal, read_after_writes: true field :elevation, :integer - field :speed, :integer field :power, :integer field :odometer, :float @@ -29,6 +28,8 @@ defmodule TeslaMate.Log.Position do field :is_climate_on, :boolean field :is_rear_defroster_on, :boolean field :is_front_defroster_on, :boolean + field :cabin_overheat_protection, :boolean + field :cabin_overheat_protection_actively_cooling, :boolean field :tpms_pressure_fl, :decimal field :tpms_pressure_fr, :decimal field :tpms_pressure_rl, :decimal @@ -66,6 +67,8 @@ defmodule TeslaMate.Log.Position do :is_climate_on, :is_rear_defroster_on, :is_front_defroster_on, + :cabin_overheat_protection, + :cabin_overheat_protection_actively_cooling, :tpms_pressure_fl, :tpms_pressure_fr, :tpms_pressure_rl, From f63e6a8e7d7bdb8b8efbb6143aa37799526a3e36 Mon Sep 17 00:00:00 2001 From: cwanja <54645561+cwanja@users.noreply.github.com> Date: Wed, 16 Aug 2023 13:08:22 -0500 Subject: [PATCH 3/6] Update vehicle.ex Added climate overheat protection status. --- lib/teslamate/vehicles/vehicle.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/teslamate/vehicles/vehicle.ex b/lib/teslamate/vehicles/vehicle.ex index 147be4d8de..2ef9fd4ce8 100644 --- a/lib/teslamate/vehicles/vehicle.ex +++ b/lib/teslamate/vehicles/vehicle.ex @@ -1160,7 +1160,9 @@ defmodule TeslaMate.Vehicles.Vehicle do climate = %Climate{ outside_temp: position.outside_temp, - inside_temp: position.inside_temp + inside_temp: position.inside_temp, + cabin_overheat_protection: position.cabin_overheat_protection, + cabin_overheat_protection_actively_cooling: position.cabin_overheat_protection_actively_cooling } vehicle_state = %VehicleState{ @@ -1261,6 +1263,8 @@ defmodule TeslaMate.Vehicles.Vehicle do passenger_temp_setting: vehicle.climate_state.passenger_temp_setting, is_rear_defroster_on: vehicle.climate_state.is_rear_defroster_on, is_front_defroster_on: vehicle.climate_state.is_front_defroster_on, + cabin_overheat_protection: vehicle.climate_state.cabin_overheat_protection, + cabin_overheat_protection_actively_cooling: vehicle.climate_state.cabin_overheat_protection_actively_cooling battery_heater_on: vehicle.charge_state.battery_heater_on, battery_heater: vehicle.climate_state.battery_heater, battery_heater_no_power: vehicle.climate_state.battery_heater_no_power, From 979054a9ffaa9d39226964bdfa939c32a9bcb33f Mon Sep 17 00:00:00 2001 From: cwanja <54645561+cwanja@users.noreply.github.com> Date: Wed, 16 Aug 2023 13:10:27 -0500 Subject: [PATCH 4/6] Update summary.ex Added cabin overheat protection. --- lib/teslamate/vehicles/vehicle/summary.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/teslamate/vehicles/vehicle/summary.ex b/lib/teslamate/vehicles/vehicle/summary.ex index ccf85e574b..e65dcc7fae 100644 --- a/lib/teslamate/vehicles/vehicle/summary.ex +++ b/lib/teslamate/vehicles/vehicle/summary.ex @@ -106,6 +106,8 @@ defmodule TeslaMate.Vehicles.Vehicle.Summary do is_preconditioning: get_in_struct(vehicle, [:climate_state, :is_preconditioning]), outside_temp: get_in_struct(vehicle, [:climate_state, :outside_temp]), inside_temp: get_in_struct(vehicle, [:climate_state, :inside_temp]), + cabin_overheat_protection: get_in_struct(vehicle, [:climate_state, :cabin_overheat_protection]), + cabin_overheat_protection_actively_cooling: get_in_struct(vehicle, [:climate_state, :cabin_overheat_protection_actively_cooling]), # Vehicle State odometer: get_in_struct(vehicle, [:vehicle_state, :odometer]) |> miles_to_km(2), From fa3d2b91c2de77573d73fed7a244fd982f7b61c5 Mon Sep 17 00:00:00 2001 From: cwanja <54645561+cwanja@users.noreply.github.com> Date: Wed, 16 Aug 2023 15:05:07 -0500 Subject: [PATCH 5/6] Update state.ex Fixed typo for climate --- lib/tesla_api/vehicle/state.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tesla_api/vehicle/state.ex b/lib/tesla_api/vehicle/state.ex index 0b68521703..03a2cd9388 100644 --- a/lib/tesla_api/vehicle/state.ex +++ b/lib/tesla_api/vehicle/state.ex @@ -136,7 +136,7 @@ defmodule TeslaApi.Vehicle.State do battery_heater_no_power: climate["battery_heater_no_power"], climate_keeper_mode: climate["climate_keeper_mode"], cabin_overheat_protection: climate["cabin_overheat_protection"], - cabin_overheat_protection_actively_cooling: claimte["cabin_overheat_protection_actively_cooling"], + cabin_overheat_protection_actively_cooling: climate["cabin_overheat_protection_actively_cooling"], defrost_mode: climate["defrost_mode"], driver_temp_setting: climate["driver_temp_setting"], fan_status: climate["fan_status"], From 50a11ca3fe26d7939de64e098222941a8dfd5335 Mon Sep 17 00:00:00 2001 From: cwanja <54645561+cwanja@users.noreply.github.com> Date: Wed, 16 Aug 2023 15:28:12 -0500 Subject: [PATCH 6/6] Update vehicle.ex Fixed missing comma. --- lib/teslamate/vehicles/vehicle.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/teslamate/vehicles/vehicle.ex b/lib/teslamate/vehicles/vehicle.ex index 2ef9fd4ce8..3601f9fc6c 100644 --- a/lib/teslamate/vehicles/vehicle.ex +++ b/lib/teslamate/vehicles/vehicle.ex @@ -1264,7 +1264,7 @@ defmodule TeslaMate.Vehicles.Vehicle do is_rear_defroster_on: vehicle.climate_state.is_rear_defroster_on, is_front_defroster_on: vehicle.climate_state.is_front_defroster_on, cabin_overheat_protection: vehicle.climate_state.cabin_overheat_protection, - cabin_overheat_protection_actively_cooling: vehicle.climate_state.cabin_overheat_protection_actively_cooling + cabin_overheat_protection_actively_cooling: vehicle.climate_state.cabin_overheat_protection_actively_cooling, battery_heater_on: vehicle.charge_state.battery_heater_on, battery_heater: vehicle.climate_state.battery_heater, battery_heater_no_power: vehicle.climate_state.battery_heater_no_power,