-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtest_daikin_alira_x.py
76 lines (73 loc) · 1.95 KB
/
test_daikin_alira_x.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import pytest
from pydaikin.daikin_brp069 import DaikinBRP069
@pytest.mark.parametrize(
'body,values',
[
(
'ret=KO,type=aircon,reg=eu,dst=1',
dict(),
),
# Response for all fan swing modes http://192.168.3.84/aircon/get_control_info
(
'ret=OK,pow=1,mode=4,stemp=20.0,f_rate=B,f_dir_ud=0,f_dir_lr=0',
dict(
pow='1',
mode='4',
stemp='20.0',
f_rate='B',
f_dir_ud='0',
f_dir_lr='0',
f_dir='0',
),
),
(
'ret=OK,pow=1,mode=4,stemp=20.0,f_rate=B,f_dir_ud=S,f_dir_lr=0',
dict(
pow='1',
mode='4',
stemp='20.0',
f_rate='B',
f_dir_ud='S',
f_dir_lr='0',
f_dir='1',
),
),
(
'ret=OK,pow=1,mode=4,stemp=20.0,f_rate=B,f_dir_ud=0,f_dir_lr=S',
dict(
pow='1',
mode='4',
stemp='20.0',
f_rate='B',
f_dir_ud='0',
f_dir_lr='S',
f_dir='2',
),
),
(
'ret=OK,pow=1,mode=4,stemp=20.0,f_rate=B,f_dir_ud=S,f_dir_lr=S',
dict(
pow='1',
mode='4',
stemp='20.0',
f_rate='B',
f_dir_ud='S',
f_dir_lr='S',
f_dir='3',
),
),
# Test for BRP069
(
'ret=OK,pow=1,mode=4,stemp=20.0,f_rate=B,f_dir=2',
dict(
pow='1',
mode='4',
stemp='20.0',
f_rate='B',
f_dir='2',
),
),
],
)
def test_parse_response(body: str, values: dict):
assert DaikinBRP069.parse_response(body) == values