Skip to content

Commit

Permalink
Diesel debug change
Browse files Browse the repository at this point in the history
  • Loading branch information
itchannel committed Feb 16, 2023
1 parent a4a500e commit 929f25e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions custom_components/fordpass/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if sensor.coordinator.data["elVehDTE"] != None:
sensors.append(sensor)
elif key == "dieselSystemStatus":
if "dieselSystemStatus" in sensor.coordinator.data:
if "filterRegenerationStatus" in sensor.coordinator.data["dieselSystemStatus"]:
sensors.append(sensor)
if sensor.coordinator.data.get("dieselSystemStatus", {}).get("filterRegenerationStatus"):
sensors.append(sensor)
elif key == "exhaustFluidLevel":
if "exhaustFluidLevel" in sensor.coordinator.data:
if "exhaustFluidLevel" in sensor.coordinator.data["dieselSystemStatus"]:
sensors.append(sensor)
if sensor.coordinator.data.get("dieselSystemStatus", {}).get("exhaustFluidLevel"):
sensors.append(sensor)
else:
sensors.append(sensor)
async_add_entities(sensors, True)
Expand Down

0 comments on commit 929f25e

Please sign in to comment.