blob: f99b3077be1471035e574d2c29137992574c47c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
from .base_payload import MqttPayload
_mult_100 = lambda n: int(n*100)
_div_100 = lambda n: n/100
class Temperature(MqttPayload):
FORMAT = 'IhH'
PACKER = {
'temp': _mult_100,
'rh': _mult_100,
}
UNPACKER = {
'temp': _div_100,
'rh': _div_100,
}
time: int
temp: float
rh: float
|