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
