aboutsummaryrefslogtreecommitdiff
path: root/src/home/mqtt/payload/temphum.py
blob: c0b744e3f46a32e12256500332ecacf4f907d826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from .base_payload import MqttPayload

two_digits_precision = lambda x: round(x, 2)


class TempHumDataPayload(MqttPayload):
    FORMAT = '=ddb'
    UNPACKER = {
        'temp': two_digits_precision,
        'rh': two_digits_precision
    }

    temp: float
    rh: float
    error: int