Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tests/mock_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,20 @@

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

PRODUCTS = {file.name: json.load(file.open()) for file in TESTDATA.glob("home_data_product_*.json")}
DEVICES = {file.name: json.load(file.open()) for file in TESTDATA.glob("home_data_device_*.json")}

# Products
A27_PRODUCT_DATA = json.load((TESTDATA / "home_data_product_a27.json").open())
SS07_PRODUCT_DATA = json.load((TESTDATA / "home_data_product_ss07.json").open())
A102_PRODUCT_DATA = json.load((TESTDATA / "home_data_product_a102.json").open())
A27_PRODUCT_DATA = PRODUCTS["home_data_product_a27.json"]
SS07_PRODUCT_DATA = PRODUCTS["home_data_product_ss07.json"]
A102_PRODUCT_DATA = PRODUCTS["home_data_product_a102.json"]
A114_PRODUCT_DATA = PRODUCTS["home_data_product_a114.json"]
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the variable name 'A114_PRODUCT_DATA' and the file reference 'home_data_product_a114.json' should use 'a144' instead of 'a114' to match the actual model number (roborock.vacuum.a144) of the Saros 10R device as defined in the codebase. This maintains consistency with the naming pattern used for other product data variables (e.g., A27_PRODUCT_DATA for model a27).

Suggested change
A114_PRODUCT_DATA = PRODUCTS["home_data_product_a114.json"]
A144_PRODUCT_DATA = PRODUCTS["home_data_product_a144.json"]

Copilot uses AI. Check for mistakes.

# Devices
S7_DEVICE_DATA = json.load((TESTDATA / "home_data_device_s7_maxv.json").open())
Q10_DEVICE_DATA = json.load((TESTDATA / "home_data_device_q10.json").open())
ZEO_ONE_DEVICE_DATA = json.load((TESTDATA / "home_data_device_zeo_one.json").open())
S7_DEVICE_DATA = DEVICES["home_data_device_s7_maxv.json"]
Q10_DEVICE_DATA = DEVICES["home_data_device_q10.json"]
ZEO_ONE_DEVICE_DATA = DEVICES["home_data_device_zeo_one.json"]
SAROS_10R_DEVICE_DATA = DEVICES["home_data_device_saros_10r.json"]


HOME_DATA_RAW: dict[str, Any] = {
Expand Down
35 changes: 35 additions & 0 deletions tests/testdata/home_data_device_saros_10r.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"duid": "device-id-saros-10r",
"name": "JC",
"localKey": "key123key123key1",
"productId": "product-saros-10r",
"fv": "02.50.56",
"activeTime": 1672364449,
"timeZoneId": "Europe/Berlin",
"iconUrl": "",
"share": false,
"online": true,
"pv": "1.0",
"tuyaMigrated": false,
"sn": "device-saros-10r-sn",
"featureSet": "4499197267967999",
"newFeatureSet": "0005075028ED3EDDCFFF8F7F7EFEFFFF",
"deviceStatus": {
"121": 8,
"122": 100,
"123": 102,
"124": 225,
"125": 100,
"126": 99,
"127": 99,
"128": 0,
"133": 1,
"135": 0,
"139": 0,
"120": 0,
"134": 0
},
"silentOtaSwitch": false,
"f": false,
"createTime": 1767044139
}
143 changes: 143 additions & 0 deletions tests/testdata/home_data_product_a114.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"id": "product-saros-10r",
"name": "Saros 10R",
"model": "roborock.vacuum.a144",
Comment on lines +1 to +4
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename uses 'a114' but the model inside the file is 'roborock.vacuum.a144'. The filename should be 'home_data_product_a144.json' to match the actual model number. This is confirmed by the codebase which defines ROBOROCK_SAROS_10R as 'roborock.vacuum.a144' in roborock/const.py and maps it to short model 'a144' in roborock/data/code_mappings.py.

Copilot uses AI. Check for mistakes.
"category": "robot.vacuum.cleaner",
"capability": 0,
"schema": [
{
"id": 101,
"name": "rpc_request",
"code": "rpc_request",
"mode": "rw",
"type": "RAW"
},
{
"id": 102,
"name": "rpc_response",
"code": "rpc_response",
"mode": "rw",
"type": "RAW"
},
{
"id": 120,
"name": "\u9519\u8bef\u4ee3\u7801",
"code": "error_code",
"mode": "ro",
"type": "ENUM",
"property": "{\"range\": [\"\"]}"
},
{
"id": 121,
"name": "\u8bbe\u5907\u72b6\u6001",
"code": "state",
"mode": "ro",
"type": "ENUM",
"property": "{\"range\": [\"\"]}"
},
{
"id": 122,
"name": "\u8bbe\u5907\u7535\u91cf",
"code": "battery",
"mode": "ro",
"type": "ENUM",
"property": "{\"range\": [\"\"]}"
},
{
"id": 123,
"name": "\u6e05\u626b\u6a21\u5f0f",
"code": "fan_power",
"mode": "rw",
"type": "ENUM",
"property": "{\"range\": [\"\"]}"
},
{
"id": 124,
"name": "\u62d6\u5730\u6a21\u5f0f",
"code": "water_box_mode",
"mode": "rw",
"type": "ENUM",
"property": "{\"range\": [\"\"]}"
},
{
"id": 125,
"name": "\u4e3b\u5237\u5bff\u547d",
"code": "main_brush_life",
"mode": "rw",
"type": "VALUE",
"property": "{\"max\": 100, \"min\": 0, \"step\": 1, \"unit\": \"null\", \"scale\": 1}"
},
{
"id": 126,
"name": "\u8fb9\u5237\u5bff\u547d",
"code": "side_brush_life",
"mode": "rw",
"type": "VALUE",
"property": "{\"max\": 100, \"min\": 0, \"step\": 1, \"unit\": \"null\", \"scale\": 1}"
},
{
"id": 127,
"name": "\u6ee4\u7f51\u5bff\u547d",
"code": "filter_life",
"mode": "rw",
"type": "VALUE",
"property": "{\"max\": 100, \"min\": 0, \"step\": 1, \"unit\": \"null\", \"scale\": 1}"
},
{
"id": 128,
"name": "\u989d\u5916\u72b6\u6001",
"code": "additional_props",
"mode": "ro",
"type": "RAW"
},
{
"id": 130,
"name": "\u5b8c\u6210\u4e8b\u4ef6",
"code": "task_complete",
"mode": "ro",
"type": "RAW"
},
{
"id": 131,
"name": "\u7535\u91cf\u4e0d\u8db3\u4efb\u52a1\u53d6\u6d88",
"code": "task_cancel_low_power",
"mode": "ro",
"type": "RAW"
},
{
"id": 132,
"name": "\u8fd0\u52a8\u4e2d\u4efb\u52a1\u53d6\u6d88",
"code": "task_cancel_in_motion",
"mode": "ro",
"type": "RAW"
},
{
"id": 133,
"name": "\u5145\u7535\u72b6\u6001",
"code": "charge_status",
"mode": "ro",
"type": "RAW"
},
{
"id": 134,
"name": "\u70d8\u5e72\u72b6\u6001",
"code": "drying_status",
"mode": "ro",
"type": "RAW"
},
{
"id": 135,
"name": "\u79bb\u7ebf\u539f\u56e0\u7ec6\u5206",
"code": "offline_status",
"mode": "ro",
"type": "RAW"
},
{
"id": 139,
"name": "\u56de\u57fa\u7ad9\u76ee\u7684",
"code": "back_type",
"mode": "ro",
"type": "RAW"
}
]
}