Skip to content

Commit 8f49cf6

Browse files
committed
chore: Add Saros 10R API response data
Add the home data API product info and device info for a Saros 10R, captured from diagnostics. Some followup up considerations: - This is building a parallel world to device_info.yaml so we may want to converge these (e.g. allow either diagnostic or CLI based contributions in the same format) - The product naming is not very readable since its using the model name which may be hard to read, so we can consider renaming the files.
1 parent 0c4b90a commit 8f49cf6

File tree

3 files changed

+195
-6
lines changed

3 files changed

+195
-6
lines changed

tests/mock_data.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,26 @@
124124

125125
TESTDATA = pathlib.Path("tests/testdata")
126126

127+
PRODUCTS = {
128+
file.name: json.load(file.open())
129+
for file in TESTDATA.glob("home_data_product_*.json")
130+
}
131+
DEVICES = {
132+
file.name: json.load(file.open())
133+
for file in TESTDATA.glob("home_data_device_*.json")
134+
}
135+
127136
# Products
128-
A27_PRODUCT_DATA = json.load((TESTDATA / "home_data_product_a27.json").open())
129-
SS07_PRODUCT_DATA = json.load((TESTDATA / "home_data_product_ss07.json").open())
130-
A102_PRODUCT_DATA = json.load((TESTDATA / "home_data_product_a102.json").open())
137+
A27_PRODUCT_DATA = PRODUCTS["home_data_product_a27.json"]
138+
SS07_PRODUCT_DATA = PRODUCTS["home_data_product_ss07.json"]
139+
A102_PRODUCT_DATA = PRODUCTS["home_data_product_a102.json"]
140+
A114_PRODUCT_DATA = PRODUCTS["home_data_product_a114.json"]
131141

132142
# Devices
133-
S7_DEVICE_DATA = json.load((TESTDATA / "home_data_device_s7_maxv.json").open())
134-
Q10_DEVICE_DATA = json.load((TESTDATA / "home_data_device_q10.json").open())
135-
ZEO_ONE_DEVICE_DATA = json.load((TESTDATA / "home_data_device_zeo_one.json").open())
143+
S7_DEVICE_DATA = DEVICES["home_data_device_s7_maxv.json"]
144+
Q10_DEVICE_DATA = DEVICES["home_data_device_q10.json"]
145+
ZEO_ONE_DEVICE_DATA = DEVICES["home_data_device_zeo_one.json"]
146+
SAROS_10R_DEVICE_DATA = DEVICES["home_data_device_saros_10r.json"]
136147

137148

138149
HOME_DATA_RAW: dict[str, Any] = {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"duid": "device-id-saros-10r",
3+
"name": "JC",
4+
"localKey": "key123key123key1",
5+
"productId": "product-saros-10r",
6+
"fv": "02.50.56",
7+
"activeTime": 1672364449,
8+
"timeZoneId": "Europe/Berlin",
9+
"iconUrl": "",
10+
"share": false,
11+
"online": true,
12+
"pv": "1.0",
13+
"tuyaMigrated": false,
14+
"sn": "device-saros-10r-sn",
15+
"featureSet": "4499197267967999",
16+
"newFeatureSet": "0005075028ED3EDDCFFF8F7F7EFEFFFF",
17+
"deviceStatus": {
18+
"121": 8,
19+
"122": 100,
20+
"123": 102,
21+
"124": 225,
22+
"125": 100,
23+
"126": 99,
24+
"127": 99,
25+
"128": 0,
26+
"133": 1,
27+
"135": 0,
28+
"139": 0,
29+
"120": 0,
30+
"134": 0
31+
},
32+
"silentOtaSwitch": false,
33+
"f": false,
34+
"createTime": 1767044139
35+
}
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"id": "product-saros-10r",
3+
"name": "Saros 10R",
4+
"model": "roborock.vacuum.a144",
5+
"category": "robot.vacuum.cleaner",
6+
"capability": 0,
7+
"schema": [
8+
{
9+
"id": 101,
10+
"name": "rpc_request",
11+
"code": "rpc_request",
12+
"mode": "rw",
13+
"type": "RAW"
14+
},
15+
{
16+
"id": 102,
17+
"name": "rpc_response",
18+
"code": "rpc_response",
19+
"mode": "rw",
20+
"type": "RAW"
21+
},
22+
{
23+
"id": 120,
24+
"name": "\u9519\u8bef\u4ee3\u7801",
25+
"code": "error_code",
26+
"mode": "ro",
27+
"type": "ENUM",
28+
"property": "{\"range\": [\"\"]}"
29+
},
30+
{
31+
"id": 121,
32+
"name": "\u8bbe\u5907\u72b6\u6001",
33+
"code": "state",
34+
"mode": "ro",
35+
"type": "ENUM",
36+
"property": "{\"range\": [\"\"]}"
37+
},
38+
{
39+
"id": 122,
40+
"name": "\u8bbe\u5907\u7535\u91cf",
41+
"code": "battery",
42+
"mode": "ro",
43+
"type": "ENUM",
44+
"property": "{\"range\": [\"\"]}"
45+
},
46+
{
47+
"id": 123,
48+
"name": "\u6e05\u626b\u6a21\u5f0f",
49+
"code": "fan_power",
50+
"mode": "rw",
51+
"type": "ENUM",
52+
"property": "{\"range\": [\"\"]}"
53+
},
54+
{
55+
"id": 124,
56+
"name": "\u62d6\u5730\u6a21\u5f0f",
57+
"code": "water_box_mode",
58+
"mode": "rw",
59+
"type": "ENUM",
60+
"property": "{\"range\": [\"\"]}"
61+
},
62+
{
63+
"id": 125,
64+
"name": "\u4e3b\u5237\u5bff\u547d",
65+
"code": "main_brush_life",
66+
"mode": "rw",
67+
"type": "VALUE",
68+
"property": "{\"max\": 100, \"min\": 0, \"step\": 1, \"unit\": \"null\", \"scale\": 1}"
69+
},
70+
{
71+
"id": 126,
72+
"name": "\u8fb9\u5237\u5bff\u547d",
73+
"code": "side_brush_life",
74+
"mode": "rw",
75+
"type": "VALUE",
76+
"property": "{\"max\": 100, \"min\": 0, \"step\": 1, \"unit\": \"null\", \"scale\": 1}"
77+
},
78+
{
79+
"id": 127,
80+
"name": "\u6ee4\u7f51\u5bff\u547d",
81+
"code": "filter_life",
82+
"mode": "rw",
83+
"type": "VALUE",
84+
"property": "{\"max\": 100, \"min\": 0, \"step\": 1, \"unit\": \"null\", \"scale\": 1}"
85+
},
86+
{
87+
"id": 128,
88+
"name": "\u989d\u5916\u72b6\u6001",
89+
"code": "additional_props",
90+
"mode": "ro",
91+
"type": "RAW"
92+
},
93+
{
94+
"id": 130,
95+
"name": "\u5b8c\u6210\u4e8b\u4ef6",
96+
"code": "task_complete",
97+
"mode": "ro",
98+
"type": "RAW"
99+
},
100+
{
101+
"id": 131,
102+
"name": "\u7535\u91cf\u4e0d\u8db3\u4efb\u52a1\u53d6\u6d88",
103+
"code": "task_cancel_low_power",
104+
"mode": "ro",
105+
"type": "RAW"
106+
},
107+
{
108+
"id": 132,
109+
"name": "\u8fd0\u52a8\u4e2d\u4efb\u52a1\u53d6\u6d88",
110+
"code": "task_cancel_in_motion",
111+
"mode": "ro",
112+
"type": "RAW"
113+
},
114+
{
115+
"id": 133,
116+
"name": "\u5145\u7535\u72b6\u6001",
117+
"code": "charge_status",
118+
"mode": "ro",
119+
"type": "RAW"
120+
},
121+
{
122+
"id": 134,
123+
"name": "\u70d8\u5e72\u72b6\u6001",
124+
"code": "drying_status",
125+
"mode": "ro",
126+
"type": "RAW"
127+
},
128+
{
129+
"id": 135,
130+
"name": "\u79bb\u7ebf\u539f\u56e0\u7ec6\u5206",
131+
"code": "offline_status",
132+
"mode": "ro",
133+
"type": "RAW"
134+
},
135+
{
136+
"id": 139,
137+
"name": "\u56de\u57fa\u7ad9\u76ee\u7684",
138+
"code": "back_type",
139+
"mode": "ro",
140+
"type": "RAW"
141+
}
142+
]
143+
}

0 commit comments

Comments
 (0)