[Bug]: Precision of xiaomi temperature
MichalLytek opened this issue · comments
I think that this is a difference in how the information is obtained.
- The TelinkFlasher is connecting to the device and "asking" for the temperature. In BLE terms, this is called reading the characteristics.
- BLE monitor is passively listening to BLE broadcasts. This won't require to set up a connection, the sensor is just broadcasting every x minutes its current temperature.
The passive BLE advertisements are with one digit precision. It actually sends an integer (zero precision) and divides that by 10 making it 1 digit precision. So it is not possible to get 2 digit precision, unless you make a connection (which is out of the scope of BLE monitor.
def obj1004(xobj):
"""Temperature"""
if len(xobj) == 2:
(temp,) = T_STRUCT.unpack(xobj)
return {"temperature": temp / 10}
else:
return {}