From 176b2075fd284962388d6e11cd5a945f0ebbc161 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 4 Dec 2020 13:34:11 +1000 Subject: [PATCH 1/3] Added TMPS Values & fixed door bug --- custom_components/fordpass/sensor.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/custom_components/fordpass/sensor.py b/custom_components/fordpass/sensor.py index 591994f..e15a8e9 100644 --- a/custom_components/fordpass/sensor.py +++ b/custom_components/fordpass/sensor.py @@ -55,7 +55,9 @@ def get_value(self, ftype): return self.coordinator.data[self.sensor]["value"] elif self.sensor == "doorStatus": for key, value in self.coordinator.data[self.sensor].items(): - if (value["value"] != "Closed") or (value["value"] != "Invalid"): + if value["value"] == "Invalid": + continue + if (value["value"] != "Closed"): return "Open" return "Closed" elif self.sensor == "windowPosition": @@ -112,6 +114,13 @@ def get_value(self, ftype): elif self.sensor == "oil": return self.coordinator.data[self.sensor].items() elif self.sensor == "tirePressure": + if self.coordinator.data["TPMS"] != None: + return { + "leftFrontTirePressure": round(float(self.coordinator.data["TPMS"]["leftFrontTirePressure"]["value"]) * 0.1450377377), + "rightFrontTirePressure": round(float(self.coordinator.data["TPMS"]["rightFrontTirePressure"]["value"]) * 0.1450377377), + "outerLeftRearTirePressure": round(float(self.coordinator.data["TPMS"]["outerLeftRearTirePressure"]["value"]) * 0.1450377377), + "outerRightRearTirePressure": round(float(self.coordinator.data["TPMS"]["outerRightRearTirePressure"]["value"]) * 0.1450377377) + } return None elif self.sensor == "gps": return self.coordinator.data[self.sensor].items() From 555a42034b6290113aa2da0b52ae796281c1b9d4 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 4 Dec 2020 13:34:11 +1000 Subject: [PATCH 2/3] Added TMPS Values & fixed door bug --- custom_components/fordpass/sensor.py | 39 +++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/custom_components/fordpass/sensor.py b/custom_components/fordpass/sensor.py index 591994f..b0b4b05 100644 --- a/custom_components/fordpass/sensor.py +++ b/custom_components/fordpass/sensor.py @@ -55,7 +55,9 @@ def get_value(self, ftype): return self.coordinator.data[self.sensor]["value"] elif self.sensor == "doorStatus": for key, value in self.coordinator.data[self.sensor].items(): - if (value["value"] != "Closed") or (value["value"] != "Invalid"): + if value["value"] == "Invalid": + continue + if value["value"] != "Closed": return "Open" return "Closed" elif self.sensor == "windowPosition": @@ -112,6 +114,41 @@ def get_value(self, ftype): elif self.sensor == "oil": return self.coordinator.data[self.sensor].items() elif self.sensor == "tirePressure": + if self.coordinator.data["TPMS"] != None: + return { + "leftFrontTirePressure": round( + float( + self.coordinator.data["TPMS"]["leftFrontTirePressure"][ + "value" + ] + ) + * 0.1450377377 + ), + "rightFrontTirePressure": round( + float( + self.coordinator.data["TPMS"]["rightFrontTirePressure"][ + "value" + ] + ) + * 0.1450377377 + ), + "outerLeftRearTirePressure": round( + float( + self.coordinator.data["TPMS"][ + "outerLeftRearTirePressure" + ]["value"] + ) + * 0.1450377377 + ), + "outerRightRearTirePressure": round( + float( + self.coordinator.data["TPMS"][ + "outerRightRearTirePressure" + ]["value"] + ) + * 0.1450377377 + ), + } return None elif self.sensor == "gps": return self.coordinator.data[self.sensor].items() From f7227809d2deddea4fe060be1b0c3a7a3a581597 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 4 Dec 2020 21:30:26 +1000 Subject: [PATCH 3/3] Updated readme --- README.md | 2 +- info.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index deaf4bb..7efb337 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,9 @@ If you are experiencing any sign in issues, please trying clearing your tokens u - Car Tracker - Supports Multiple Regions - Electric Vehicle Support +- TPMS Sensors ## Coming Soon -- Code tidy up - Alarm event (Anyone have the json output for this event would be appreciated :) ) diff --git a/info.md b/info.md index d684136..6076726 100644 --- a/info.md +++ b/info.md @@ -1,5 +1,10 @@ # **Changelog** +### Version 1.09 +- Added individual TMPS Support +- Fixed door open bug + + ### Version 1.08 - Added Icons for each entity - Added "clear_tokens" service call