module: respect shutdown settings when writing command

- this fixes a serious flaw where until now this library never powered the sensor down
- not noticable directly as the sensor still takes measurements but wastes power in between
This commit is contained in:
cn committed 2019-09-19 00:50:44 +02:00
1 parent 2610387dae
commit 5cf6d2aad5
3 files changed
+134 -128

No files matched your search

+1 -1
View File
@@ -64,7 +64,7 @@ class Veml6070(object):
assembles the command byte for the current state
"""
cmd = (self.shutdown & 0x01) << 0 # SD
cmd = (self.integration_time & 0x03) << 2 # IT
cmd = cmd | (self.integration_time & 0x03) << 2 # IT
cmd = ((cmd | 0x02) & 0x3F) # reserved bits
return cmd