1
0
mirror of https://github.com/cmur2/python-veml6070.git synced 2025-06-26 12:30:19 +02:00

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
2019-09-18 22:11:53 +02:00
parent 2610387dae
commit 5cf6d2aad5
3 changed files with 134 additions and 128 deletions

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