Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMS5003T/PMS5003ST signed temperature #8

Closed
avaldebe opened this issue Apr 16, 2020 · 0 comments
Closed

PMS5003T/PMS5003ST signed temperature #8

avaldebe opened this issue Apr 16, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@avaldebe
Copy link
Owner

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.

@avaldebe avaldebe added the bug Something isn't working label Apr 16, 2020
@avaldebe avaldebe changed the title signed temperature PMS5003T/PMS5003ST PMS5003T/PMS5003ST signed temperature Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant