fix too close status
This commit is contained in:
@ -9,13 +9,16 @@ Temperature, 2
|
||||
Status, 1
|
||||
|
||||
|
||||
import base64
|
||||
import struct
|
||||
|
||||
payload = 'DQYCjAAAAAE='
|
||||
frame = base64.b64decode(payload)
|
||||
|
||||
battery = struct.unpack('<H', frame[0:2])[0]
|
||||
distance = struct.unpack('<H', frame[2:4])[0]
|
||||
interrupt: frame[4:5]
|
||||
temperature: frame[5:7]
|
||||
status: struct.unpack('<H', frame[7:8])[0]
|
||||
battery = struct.unpack('>H', frame[0:2])[0]
|
||||
distance = struct.unpack('>H', frame[2:4])[0]
|
||||
status = struct.unpack('?', frame[7:8])[0]
|
||||
|
||||
print(f"{battery=}, {distance=}, {status=}")
|
||||
|
||||
payload = 'DRgAAAAAAAE='
|
||||
|
Reference in New Issue
Block a user