Skip to content

Commit

Permalink
Merge pull request #54 from itchannel/1.0.9-Update
Browse files Browse the repository at this point in the history
1.0.9 update
  • Loading branch information
itchannel committed Dec 4, 2020
2 parents 4395f4f + 0ff027d commit cf8c3fd
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 :) )
39 changes: 38 additions & 1 deletion custom_components/fordpass/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions info.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit cf8c3fd

Please sign in to comment.