avaldebe/PyPMS

PMS5003T/PMS5003ST signed temperature

avaldebe opened this issue · 0 comments

Just found out a English datasheet for the PMS5003ST, which says that the temperature is a signed integer. This total sense as the temperature can be negative.

Alas, the _unpack unpack method inhereted from PMS3003 decodes the message as unsigned integers.

@staticmethod
def _unpack(message: bytes) -> Tuple[int, ...]:
return struct.unpack(f">{len(message)//2}H", message)

Therefore, negative temperatures will show as huge values.