From bff7648019d7f6aab234f993fd64652f6845af3a Mon Sep 17 00:00:00 2001 From: SquidBytes Date: Thu, 9 May 2024 15:13:56 -0400 Subject: [PATCH 1/3] Implemented the fix to display charging when DC Fast charging --- custom_components/fordpass/sensor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/custom_components/fordpass/sensor.py b/custom_components/fordpass/sensor.py index b582fbc..0d952a6 100644 --- a/custom_components/fordpass/sensor.py +++ b/custom_components/fordpass/sensor.py @@ -373,8 +373,17 @@ def get_value(self, ftype): # Returning 0 in else - to prevent attribute from not displaying if "xevBatteryChargerVoltageOutput" in self.data and "xevBatteryChargerCurrentOutput" in self.data: + + # Get Battery Io Current for DC Charging calculation + if "xevBatteryIoCurrent" in self.data: + batt_amps = float(self.data.get("xevBatteryIoCurrent", {}).get("value", 0)) + + # AC Charging calculation if ch_volt != 0 and ch_amps != 0: cs["Charging kW"] = round((ch_volt * ch_amps) / 1000, 2) + # DC Charging calculation: Use absolute value for amperage to handle negative values + elif ch_volt != 0 and batt_amps != 0: + cs["Charging kW"] = round((ch_volt * abs(batt_amps)) / 1000, 2) else: cs["Charging kW"] = 0 From 1b56a3f4d31281ddf84bee35a6384bd4891a9ec7 Mon Sep 17 00:00:00 2001 From: SquidBytes Date: Thu, 9 May 2024 15:35:09 -0400 Subject: [PATCH 2/3] Switches declared twice in const.py. Fix was never added to a release --- custom_components/fordpass/const.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/custom_components/fordpass/const.py b/custom_components/fordpass/const.py index c48ef9f..b1d7a47 100644 --- a/custom_components/fordpass/const.py +++ b/custom_components/fordpass/const.py @@ -62,10 +62,12 @@ "events": {"icon": "mdi:calendar", "api_key": "events", "sensor_type": "single", "debug": True}, "metrics": {"icon": "mdi:chart-line", "api_key": "metrics", "sensor_type": "single", "debug": True}, "states": {"icon": "mdi:car", "api_key": "states", "sensor_type": "single", "debug": True}, - "vehicles": {"icon": "mdi:car-multiple", "api_key": "vehicles", "sensor_type": "single", "debug": True}, + "vehicles": {"icon": "mdi:car-multiple", "api_key": "vehicles", "sensor_type": "single", "debug": True} } -SWITCHES = {"ignition": {"icon": "hass:power"}, "guardmode": {"icon": "mdi:shield-key"}} +SWITCHES = { + "ignition": {"icon": "hass:power"}, + "guardmode": {"icon": "mdi:shield-key"}} WINDOW_POSITIONS = { "CLOSED": { @@ -80,11 +82,6 @@ }, } -SWITCHES = { - "ignition": {"icon": "hass:power"}, - # "guardmode": {"icon": "mdi:shield-key"} -} - REGIONS = { "UK&Europe": { "region": "1E8C7794-FF5F-49BC-9596-A1E0C86C5B19", From f14bfeed617ac602d43571bada1ce28ddd7ef27f Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 10 May 2024 08:12:25 +1000 Subject: [PATCH 3/3] small updates --- custom_components/fordpass/const.py | 3 ++- info.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/fordpass/const.py b/custom_components/fordpass/const.py index b1d7a47..da5d084 100644 --- a/custom_components/fordpass/const.py +++ b/custom_components/fordpass/const.py @@ -67,7 +67,8 @@ SWITCHES = { "ignition": {"icon": "hass:power"}, - "guardmode": {"icon": "mdi:shield-key"}} + #"guardmode": {"icon": "mdi:shield-key"} +} WINDOW_POSITIONS = { "CLOSED": { diff --git a/info.md b/info.md index fd9a7a7..416a6e5 100644 --- a/info.md +++ b/info.md @@ -1,6 +1,8 @@ ## **Changelog** ### Version 1.68 - Fix for missing locale +- Fix duplicate Switches dictionary +- Fix DC fast charging bug ### Version 1.67 - Temp fix for login issues (Uses different region login servers, may get blocked soon!) ### Version 1.66