Update __init__.py

This commit is contained in:
Mitch Gallman
2021-05-04 20:38:15 -04:00
committed by GitHub
parent 0c88c333a1
commit f90347105b

View File

@@ -1052,12 +1052,10 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
with SMBus(i2cbus) as bus:
data = bus.read_i2c_block_data(i2caddr, i2creg, 8)
val = struct.unpack('f', bytearray(data[0:4]))
fval1 = val[0]
fval1 = struct.unpack('f', bytearray(data[0:4]))[0]
if fval1 != fval1:
fval1 = 0
val = struct.unpack('f', bytearray(data[4:8]))
fval2 = val[0]
fval2 = struct.unpack('f', bytearray(data[4:8]))[0]
if fval2 != fval2:
fval2 = 0