aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerg_samowzbudnik <uinarf@autistici.org>2021-06-13 10:56:02 +0200
committererg_samowzbudnik <uinarf@autistici.org>2021-06-13 10:56:02 +0200
commitbb8213171e37e8871e46d6a860c231289c299247 (patch)
tree7b4fb37f0b3ef3e7a029a01c768ad9f342a999c9
parentd2bfefcbbab8732d3a81521a3f80ef42b8ba3e85 (diff)
downloadRPGH-bb8213171e37e8871e46d6a860c231289c299247.tar.gz
RPGH-bb8213171e37e8871e46d6a860c231289c299247.tar.bz2
RPGH-bb8213171e37e8871e46d6a860c231289c299247.zip
added self to max_read in light class
-rw-r--r--monitor_unified.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/monitor_unified.py b/monitor_unified.py
index 0d9b9dc..dcae8de 100644
--- a/monitor_unified.py
+++ b/monitor_unified.py
@@ -341,11 +341,11 @@ class Light(Sensor):
# max reading a channel can hold
# on exposure 402ms:
- max_read = 65535
+ self.max_read = 65535
# on exposure 100ms:
- max_read_1 = 37177
+ self.max_read_1 = 37177
# on exposure 13.7ms:
- max_read_2 = 5047
+ self.max_read_2 = 5047
# commands
_ON = 0x03
@@ -448,7 +448,7 @@ class Light(Sensor):
lux = self.nan
# normally broadband maxes out before infrared which makes visible
# drop which is clearly wrong hence:
- elif ch0 == max_read or ch1 == max_read:
+ elif ch0 == self.max_read or ch1 == self.max_read:
lux = self.nan
else:
ratio = ch1/ch0