From e92224f89e555fa36c79bbed0cdf7892851c2fa3 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 1 Apr 2024 17:36:45 +0200 Subject: [PATCH] Fixed missing check on light and pressure sensors --- sbapp/sideband/sense.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbapp/sideband/sense.py b/sbapp/sideband/sense.py index ecf8ea0..ff7f1ae 100644 --- a/sbapp/sideband/sense.py +++ b/sbapp/sideband/sense.py @@ -595,7 +595,7 @@ class Pressure(Sensor): 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) @@ -1129,7 +1129,7 @@ class AmbientLight(Sensor): 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)