Skip to content

Commit c5830a4

Browse files
authored
Add PIR ADC Values to Test Fixtures (#1296)
1 parent 37cc4da commit c5830a4

File tree

5 files changed

+242
-34
lines changed

5 files changed

+242
-34
lines changed

devtools/dump_devinfo.py

+3
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,10 @@ async def get_legacy_fixture(
425425
Call(module="smartlife.iot.lightStrip", method="get_light_details"),
426426
Call(module="smartlife.iot.LAS", method="get_config"),
427427
Call(module="smartlife.iot.LAS", method="get_current_brt"),
428+
Call(module="smartlife.iot.LAS", method="get_dark_status"),
429+
Call(module="smartlife.iot.LAS", method="get_adc_value"),
428430
Call(module="smartlife.iot.PIR", method="get_config"),
431+
Call(module="smartlife.iot.PIR", method="get_adc_value"),
429432
]
430433

431434
successes = []

tests/fixtures/ES20M(US)_1.0_1.0.11.json

+62-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
{
2+
"cnCloud": {
3+
"get_info": {
4+
"binded": 1,
5+
"cld_connection": 1,
6+
"err_code": 0,
7+
"fwDlPage": "",
8+
"fwNotifyType": -1,
9+
"illegalType": 0,
10+
"server": "n-devs.tplinkcloud.com",
11+
"stopConnect": 0,
12+
"tcspInfo": "",
13+
"tcspStatus": 1,
14+
"username": "#MASKED_NAME#"
15+
},
16+
"get_intl_fw_list": {
17+
"err_code": 0,
18+
"fw_list": []
19+
}
20+
},
21+
"schedule": {
22+
"get_next_action": {
23+
"err_code": 0,
24+
"type": -1
25+
},
26+
"get_rules": {
27+
"enable": 1,
28+
"err_code": 0,
29+
"rule_list": [],
30+
"version": 2
31+
}
32+
},
233
"smartlife.iot.LAS": {
34+
"get_adc_value": {
35+
"err_code": 0,
36+
"type": 2,
37+
"value": 0
38+
},
339
"get_config": {
440
"devs": [
541
{
@@ -47,10 +83,18 @@
4783
},
4884
"get_current_brt": {
4985
"err_code": 0,
50-
"value": 16
86+
"value": 0
87+
},
88+
"get_dark_status": {
89+
"bDark": 1,
90+
"err_code": 0
5191
}
5292
},
5393
"smartlife.iot.PIR": {
94+
"get_adc_value": {
95+
"err_code": 0,
96+
"value": 2107
97+
},
5498
"get_config": {
5599
"array": [
56100
80,
@@ -59,23 +103,32 @@
59103
0
60104
],
61105
"cold_time": 120000,
62-
"enable": 1,
106+
"enable": 0,
63107
"err_code": 0,
64108
"max_adc": 4095,
65109
"min_adc": 0,
66-
"trigger_index": 0,
110+
"trigger_index": 1,
67111
"version": "1.0"
68112
}
69113
},
70114
"smartlife.iot.dimmer": {
115+
"get_default_behavior": {
116+
"double_click": {
117+
"mode": "unknown"
118+
},
119+
"err_code": 0,
120+
"long_press": {
121+
"mode": "unknown"
122+
}
123+
},
71124
"get_dimmer_parameters": {
72125
"bulb_type": 1,
73126
"err_code": 0,
74127
"fadeOffTime": 0,
75128
"fadeOnTime": 0,
76129
"gentleOffTime": 10000,
77130
"gentleOnTime": 3000,
78-
"minThreshold": 17,
131+
"minThreshold": 5,
79132
"rampRate": 30
80133
}
81134
},
@@ -92,17 +145,17 @@
92145
"hw_ver": "1.0",
93146
"icon_hash": "",
94147
"latitude_i": 0,
95-
"led_off": 1,
148+
"led_off": 0,
96149
"longitude_i": 0,
97-
"mac": "B0:A7:B9:00:00:00",
150+
"mac": "28:87:BA:00:00:00",
98151
"mic_type": "IOT.SMARTPLUGSWITCH",
99152
"model": "ES20M(US)",
100153
"next_action": {
101154
"type": -1
102155
},
103156
"obd_src": "tplink",
104157
"oemId": "00000000000000000000000000000000",
105-
"on_time": 6,
158+
"on_time": 0,
106159
"preferred_state": [
107160
{
108161
"brightness": 100,
@@ -121,8 +174,8 @@
121174
"index": 3
122175
}
123176
],
124-
"relay_state": 1,
125-
"rssi": -40,
177+
"relay_state": 0,
178+
"rssi": -57,
126179
"status": "new",
127180
"sw_ver": "1.0.11 Build 240514 Rel.110351",
128181
"updating": 0

tests/fixtures/KL135(US)_1.0_1.0.15.json

+68-21
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,71 @@
11
{
2+
"smartlife.iot.common.cloud": {
3+
"get_info": {
4+
"binded": 1,
5+
"cld_connection": 1,
6+
"err_code": 0,
7+
"fwDlPage": "",
8+
"fwNotifyType": -1,
9+
"illegalType": 0,
10+
"server": "n-devs.tplinkcloud.com",
11+
"stopConnect": 0,
12+
"tcspInfo": "",
13+
"tcspStatus": 1,
14+
"username": "#MASKED_NAME#"
15+
},
16+
"get_intl_fw_list": {
17+
"err_code": 0,
18+
"fw_list": []
19+
}
20+
},
221
"smartlife.iot.common.emeter": {
322
"get_realtime": {
423
"err_code": 0,
5-
"power_mw": 0,
6-
"total_wh": 25
24+
"power_mw": 10800,
25+
"total_wh": 48
26+
}
27+
},
28+
"smartlife.iot.common.schedule": {
29+
"get_next_action": {
30+
"err_code": 0,
31+
"type": -1
32+
},
33+
"get_rules": {
34+
"enable": 0,
35+
"err_code": 0,
36+
"rule_list": [],
37+
"version": 2
738
}
839
},
940
"smartlife.iot.smartbulb.lightingservice": {
10-
"get_light_state": {
11-
"dft_on_state": {
12-
"brightness": 98,
13-
"color_temp": 6500,
14-
"hue": 28,
15-
"mode": "normal",
16-
"saturation": 72
41+
"get_default_behavior": {
42+
"err_code": 0,
43+
"hard_on": {
44+
"mode": "last_status"
1745
},
46+
"re_power_type": "always_on",
47+
"soft_on": {
48+
"mode": "last_status"
49+
}
50+
},
51+
"get_light_details": {
52+
"color_rendering_index": 90,
53+
"err_code": 0,
54+
"incandescent_equivalent": 60,
55+
"lamp_beam_angle": 220,
56+
"max_lumens": 800,
57+
"max_voltage": 120,
58+
"min_voltage": 100,
59+
"wattage": 10
60+
},
61+
"get_light_state": {
62+
"brightness": 100,
63+
"color_temp": 2700,
1864
"err_code": 0,
19-
"on_off": 0
65+
"hue": 0,
66+
"mode": "normal",
67+
"on_off": 1,
68+
"saturation": 0
2069
}
2170
},
2271
"system": {
@@ -40,24 +89,22 @@
4089
"is_variable_color_temp": 1,
4190
"latitude_i": 0,
4291
"light_state": {
43-
"dft_on_state": {
44-
"brightness": 98,
45-
"color_temp": 6500,
46-
"hue": 28,
47-
"mode": "normal",
48-
"saturation": 72
49-
},
50-
"on_off": 0
92+
"brightness": 100,
93+
"color_temp": 2700,
94+
"hue": 0,
95+
"mode": "normal",
96+
"on_off": 1,
97+
"saturation": 0
5198
},
5299
"longitude_i": 0,
53-
"mic_mac": "000000000000",
100+
"mic_mac": "54AF97000000",
54101
"mic_type": "IOT.SMARTBULB",
55102
"model": "KL135(US)",
56103
"obd_src": "tplink",
57104
"oemId": "00000000000000000000000000000000",
58105
"preferred_state": [
59106
{
60-
"brightness": 50,
107+
"brightness": 100,
61108
"color_temp": 2700,
62109
"hue": 0,
63110
"index": 0,
@@ -85,7 +132,7 @@
85132
"saturation": 100
86133
}
87134
],
88-
"rssi": -41,
135+
"rssi": -69,
89136
"status": "new",
90137
"sw_ver": "1.0.15 Build 240429 Rel.154143"
91138
}

tests/fixtures/KS200M(US)_1.0_1.0.10.json

+61-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
{
2+
"cnCloud": {
3+
"get_info": {
4+
"binded": 1,
5+
"cld_connection": 1,
6+
"err_code": 0,
7+
"fwDlPage": "",
8+
"fwNotifyType": -1,
9+
"illegalType": 0,
10+
"server": "n-devs.tplinkcloud.com",
11+
"stopConnect": 0,
12+
"tcspInfo": "",
13+
"tcspStatus": 1,
14+
"username": "#MASKED_NAME#"
15+
},
16+
"get_intl_fw_list": {
17+
"err_code": 0,
18+
"fw_list": [
19+
{
20+
"fwLocation": 0,
21+
"fwReleaseDate": "2024-06-19",
22+
"fwReleaseLog": "Modifications and Bug Fixes:\n1. Added \"Hold on\" feature, now you can quickly double-click the switch to keep it on without being affected by the Smart Control rules.\n2. Fixed a bug where Motion & Dark rules could still be triggered under bright light conditions.\n3. Fixed some minor bugs.",
23+
"fwReleaseLogUrl": "undefined yet",
24+
"fwTitle": "Hi, a new firmware with bug fixes and performance improvement is available for your KS200M.",
25+
"fwType": 2,
26+
"fwUrl": "http://download.tplinkcloud.com/firmware/KS200M_FCC_1.0.12_Build_240507_Rel.143458_2024-05-07_14.37.42_1718767325443.bin",
27+
"fwVer": "1.0.12 Build 240507 Rel.143458"
28+
}
29+
]
30+
}
31+
},
32+
"schedule": {
33+
"get_next_action": {
34+
"err_code": 0,
35+
"type": -1
36+
},
37+
"get_rules": {
38+
"enable": 1,
39+
"err_code": 0,
40+
"rule_list": [],
41+
"version": 2
42+
}
43+
},
244
"smartlife.iot.LAS": {
45+
"get_adc_value": {
46+
"err_code": 0,
47+
"type": 2,
48+
"value": 0
49+
},
350
"get_config": {
451
"devs": [
552
{
@@ -44,9 +91,21 @@
4491
],
4592
"err_code": 0,
4693
"ver": "1.0"
94+
},
95+
"get_current_brt": {
96+
"err_code": 0,
97+
"value": 0
98+
},
99+
"get_dark_status": {
100+
"bDark": 1,
101+
"err_code": 0
47102
}
48103
},
49104
"smartlife.iot.PIR": {
105+
"get_adc_value": {
106+
"err_code": 0,
107+
"value": 2025
108+
},
50109
"get_config": {
51110
"array": [
52111
80,
@@ -59,7 +118,7 @@
59118
"err_code": 0,
60119
"max_adc": 4095,
61120
"min_adc": 0,
62-
"trigger_index": 0,
121+
"trigger_index": 2,
63122
"version": "1.0"
64123
}
65124
},
@@ -87,7 +146,7 @@
87146
"oemId": "00000000000000000000000000000000",
88147
"on_time": 0,
89148
"relay_state": 0,
90-
"rssi": -39,
149+
"rssi": -38,
91150
"status": "new",
92151
"sw_ver": "1.0.10 Build 221019 Rel.194527",
93152
"updating": 0

0 commit comments

Comments
 (0)