catch BCD errors
This commit is contained in:
parent
f32c7fc8b8
commit
9b61266439
1 changed files with 5 additions and 2 deletions
|
@ -66,7 +66,10 @@ class lacross(rawsensor):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def Create(data):
|
def Create(data):
|
||||||
if len(data[0]) >= 5 and len(data[0]) <= 8 and crc8(data[0]) == 0:
|
if (len(data[0]) < 5) or (crc8(data[0]) <> 0):
|
||||||
|
return
|
||||||
|
if (data[0][1] & 0x0F > 9) or (data[0][2] >> 4 > 9) or (data[0][2] & 0x0F > 9):
|
||||||
|
return
|
||||||
return lacross(data)
|
return lacross(data)
|
||||||
|
|
||||||
class emt7110(rawsensor):
|
class emt7110(rawsensor):
|
||||||
|
|
Loading…
Reference in a new issue