Skip to content

Commit

Permalink
Fixed missing check on light and pressure sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Apr 1, 2024
1 parent 18698da commit e92224f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sbapp/sideband/sense.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def render(self, relative_to=None):
delta = None
if relative_to and "pressure" in relative_to.sensors:
rs = relative_to.sensors["pressure"]
if "mbar" in rs.data and rs.data["mbar"] != None:
if rs.data != None and "mbar" in rs.data and rs.data["mbar"] != None:
if self.data["mbar"] != None:
delta = round(rs.data["mbar"] - self.data["mbar"], 1)

Expand Down Expand Up @@ -1129,7 +1129,7 @@ def render(self, relative_to=None):
delta = None
if relative_to and "ambient_light" in relative_to.sensors:
rs = relative_to.sensors["ambient_light"]
if "lux" in rs.data and rs.data["lux"] != None:
if rs.data != None and "lux" in rs.data and rs.data["lux"] != None:
if self.data["lux"] != None:
delta = round(rs.data["lux"] - self.data["lux"], 2)

Expand Down

0 comments on commit e92224f

Please sign in to comment.