Skip to content

Commit be831ec

Browse files
committed
Mask integration time byte to fix Python 3.x fail
1 parent 1838768 commit be831ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/as7262/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _decode(self, value):
8383
return value / 2.8
8484

8585
def _encode(self, value):
86-
return int(value * 2.8)
86+
return int(value * 2.8) & 0xff
8787

8888

8989
_as7262 = Device(0x49, i2c_dev=as7262VirtualRegisterBus(1), bit_width=8, registers=(

0 commit comments

Comments
 (0)