Skip to content

Commit

Permalink
Merge pull request #234 from itchannel/1.42
Browse files Browse the repository at this point in the history
1.42
  • Loading branch information
itchannel authored Jan 5, 2023
2 parents 1ae7458 + dc5904a commit 9cfcc60
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/fordpass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async def _async_update_data(self):
data["messages"] = await self._hass.async_add_executor_job(
self.vehicle.messages
)

_LOGGER.debug(data)
# If data has now been fetched but was previously unavailable, log and reset
if not self._available:
_LOGGER.info("Restored connection to FordPass for %s", self.vin)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/fordpass/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"integration_type": "device",
"documentation": "https://github.com/itchannel/fordpass-ha",
"issue_tracker": "https://github.com/itchannel/fordpass-ha/issues",
"version": "0.1.41",
"version": "0.1.42",
"requirements": [],
"ssdp": [],
"zeroconf": [],
Expand Down
10 changes: 6 additions & 4 deletions custom_components/fordpass/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
for key, value in SENSORS.items():
sensor = CarSensor(entry, key, config_entry.options)
# Add support for only adding compatible sensors for the given vehicle
_LOGGER.debug(sensor.coordinator.data)
if key == "zoneLighting":
if "zoneLighting" in sensor.coordinator.data:
async_add_entities([sensor], True)
Expand Down Expand Up @@ -202,19 +201,22 @@ def get_value(self, ftype):
return self.coordinator.data[self.sensor].items()
elif self.sensor == "tirePressure":
if self.coordinator.data["TPMS"] != None:

if self.fordoptions[CONF_PRESSURE_UNIT] == "PSI":
sval = 0.1450377377
rval = 1
decimal = 0
if self.fordoptions[CONF_PRESSURE_UNIT] == "BAR":
elif self.fordoptions[CONF_PRESSURE_UNIT] == "BAR":
sval = 0.01
rval = 0.0689475729
decimal = 2
else:
elif self.fordoptions[CONF_PRESSURE_UNIT] == "kPa":
sval = 1
rval = 6.8947572932
decimal = 0
else:
sval = 1
rval = 1
decimal = 0
tirepress = {}
for key, value in self.coordinator.data["TPMS"].items():
if "TirePressure" in key and value is not None and value is not '':
Expand Down
3 changes: 2 additions & 1 deletion info.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

## **Changelog**
### Version 1.42
- Fix incorrect tire pressure units (Thanks @costr for debugging)
### Version 1.41
- Fix options error in HA 2023
### Version 1.40
Expand Down

0 comments on commit 9cfcc60

Please sign in to comment.