Add test data for Zeo and Dyad devices to Roborock (#117054)

This commit is contained in:
Luke Lashley 2024-05-08 18:16:48 -04:00 committed by GitHub
parent b60c90e5ee
commit 412e9bb072
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 701 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import logging
from typing import Any from typing import Any
from roborock import HomeDataRoom, RoborockException, RoborockInvalidCredentials from roborock import HomeDataRoom, RoborockException, RoborockInvalidCredentials
from roborock.code_mappings import RoborockCategory
from roborock.containers import DeviceData, HomeDataDevice, HomeDataProduct, UserData from roborock.containers import DeviceData, HomeDataDevice, HomeDataProduct, UserData
from roborock.version_1_apis.roborock_mqtt_client_v1 import RoborockMqttClientV1 from roborock.version_1_apis.roborock_mqtt_client_v1 import RoborockMqttClientV1
from roborock.web_api import RoborockApiClient from roborock.web_api import RoborockApiClient
@ -96,6 +97,7 @@ def build_setup_functions(
hass, user_data, device, product_info[device.product_id], home_data_rooms hass, user_data, device, product_info[device.product_id], home_data_rooms
) )
for device in device_map.values() for device in device_map.values()
if product_info[device.product_id].category == RoborockCategory.VACUUM
] ]

View file

@ -224,7 +224,599 @@ HOME_DATA_RAW = {
"desc": None, "desc": None,
}, },
], ],
} },
{
"id": "dyad_product",
"name": "Roborock Dyad Pro",
"model": "roborock.wetdryvac.a56",
"category": "roborock.wetdryvac",
"capability": 2,
"schema": [
{
"id": "134",
"name": "烘干状态",
"code": "drying_status",
"mode": "ro",
"type": "RAW",
},
{
"id": "200",
"name": "启停",
"code": "start",
"mode": "rw",
"type": "VALUE",
},
{
"id": "201",
"name": "状态",
"code": "status",
"mode": "ro",
"type": "VALUE",
},
{
"id": "202",
"name": "自清洁模式",
"code": "self_clean_mode",
"mode": "rw",
"type": "VALUE",
},
{
"id": "203",
"name": "自清洁强度",
"code": "self_clean_level",
"mode": "rw",
"type": "VALUE",
},
{
"id": "204",
"name": "烘干强度",
"code": "warm_level",
"mode": "rw",
"type": "VALUE",
},
{
"id": "205",
"name": "洗地模式",
"code": "clean_mode",
"mode": "rw",
"type": "VALUE",
},
{
"id": "206",
"name": "吸力",
"code": "suction",
"mode": "rw",
"type": "VALUE",
},
{
"id": "207",
"name": "水量",
"code": "water_level",
"mode": "rw",
"type": "VALUE",
},
{
"id": "208",
"name": "滚刷转速",
"code": "brush_speed",
"mode": "rw",
"type": "VALUE",
},
{
"id": "209",
"name": "电量",
"code": "power",
"mode": "ro",
"type": "VALUE",
},
{
"id": "210",
"name": "预约时间",
"code": "countdown_time",
"mode": "rw",
"type": "VALUE",
},
{
"id": "212",
"name": "自动自清洁",
"code": "auto_self_clean_set",
"mode": "rw",
"type": "VALUE",
},
{
"id": "213",
"name": "自动烘干",
"code": "auto_dry",
"mode": "rw",
"type": "VALUE",
},
{
"id": "214",
"name": "滤网已工作时间",
"code": "mesh_left",
"mode": "ro",
"type": "VALUE",
},
{
"id": "215",
"name": "滚刷已工作时间",
"code": "brush_left",
"mode": "ro",
"type": "VALUE",
},
{
"id": "216",
"name": "错误值",
"code": "error",
"mode": "ro",
"type": "VALUE",
},
{
"id": "218",
"name": "滤网重置",
"code": "mesh_reset",
"mode": "rw",
"type": "VALUE",
},
{
"id": "219",
"name": "滚刷重置",
"code": "brush_reset",
"mode": "rw",
"type": "VALUE",
},
{
"id": "221",
"name": "音量",
"code": "volume_set",
"mode": "rw",
"type": "VALUE",
},
{
"id": "222",
"name": "直立解锁自动运行开关",
"code": "stand_lock_auto_run",
"mode": "rw",
"type": "VALUE",
},
{
"id": "223",
"name": "自动自清洁 - 模式",
"code": "auto_self_clean_set_mode",
"mode": "rw",
"type": "VALUE",
},
{
"id": "224",
"name": "自动烘干 - 模式",
"code": "auto_dry_mode",
"mode": "rw",
"type": "VALUE",
},
{
"id": "225",
"name": "静音烘干时长",
"code": "silent_dry_duration",
"mode": "rw",
"type": "VALUE",
},
{
"id": "226",
"name": "勿扰模式开关",
"code": "silent_mode",
"mode": "rw",
"type": "VALUE",
},
{
"id": "227",
"name": "勿扰开启时间",
"code": "silent_mode_start_time",
"mode": "rw",
"type": "VALUE",
},
{
"id": "228",
"name": "勿扰结束时间",
"code": "silent_mode_end_time",
"mode": "rw",
"type": "VALUE",
},
{
"id": "229",
"name": "近30天每天洗地时长",
"code": "recent_run_time",
"mode": "rw",
"type": "STRING",
},
{
"id": "230",
"name": "洗地总时长",
"code": "total_run_time",
"mode": "rw",
"type": "VALUE",
},
{
"id": "235",
"name": "featureinfo",
"code": "feature_info",
"mode": "ro",
"type": "VALUE",
},
{
"id": "236",
"name": "恢复初始设置",
"code": "recover_settings",
"mode": "rw",
"type": "VALUE",
},
{
"id": "237",
"name": "烘干倒计时",
"code": "dry_countdown",
"mode": "ro",
"type": "VALUE",
},
{
"id": "10000",
"name": "ID点数据查询",
"code": "id_query",
"mode": "rw",
"type": "STRING",
},
{
"id": "10001",
"name": "防串货",
"code": "f_c",
"mode": "ro",
"type": "STRING",
},
{
"id": "10002",
"name": "定时任务",
"code": "schedule_task",
"mode": "rw",
"type": "STRING",
},
{
"id": "10003",
"name": "语音包切换",
"code": "snd_switch",
"mode": "rw",
"type": "STRING",
},
{
"id": "10004",
"name": "语音包/OBA信息",
"code": "snd_state",
"mode": "rw",
"type": "STRING",
},
{
"id": "10005",
"name": "产品信息",
"code": "product_info",
"mode": "ro",
"type": "STRING",
},
{
"id": "10006",
"name": "隐私协议",
"code": "privacy_info",
"mode": "rw",
"type": "STRING",
},
{
"id": "10007",
"name": "OTA info",
"code": "ota_nfo",
"mode": "ro",
"type": "STRING",
},
{
"id": "10101",
"name": "rpc req",
"code": "rpc_req",
"mode": "wo",
"type": "STRING",
},
{
"id": "10102",
"name": "rpc resp",
"code": "rpc_resp",
"mode": "ro",
"type": "STRING",
},
],
},
{
"id": "zeo_id",
"name": "Zeo One",
"model": "roborock.wm.a102",
"category": "roborock.wm",
"capability": 2,
"schema": [
{
"id": "134",
"name": "烘干状态",
"code": "drying_status",
"mode": "ro",
"type": "RAW",
},
{
"id": "200",
"name": "启动",
"code": "start",
"mode": "rw",
"type": "BOOL",
},
{
"id": "201",
"name": "暂停",
"code": "pause",
"mode": "rw",
"type": "BOOL",
},
{
"id": "202",
"name": "关机",
"code": "shutdown",
"mode": "rw",
"type": "BOOL",
},
{
"id": "203",
"name": "状态",
"code": "status",
"mode": "ro",
"type": "VALUE",
},
{
"id": "204",
"name": "模式",
"code": "mode",
"mode": "rw",
"type": "VALUE",
},
{
"id": "205",
"name": "程序",
"code": "program",
"mode": "rw",
"type": "VALUE",
},
{
"id": "206",
"name": "童锁",
"code": "child_lock",
"mode": "rw",
"type": "BOOL",
},
{
"id": "207",
"name": "洗涤温度",
"code": "temp",
"mode": "rw",
"type": "VALUE",
},
{
"id": "208",
"name": "漂洗次数",
"code": "rinse_times",
"mode": "rw",
"type": "VALUE",
},
{
"id": "209",
"name": "滚筒转速",
"code": "spin_level",
"mode": "rw",
"type": "VALUE",
},
{
"id": "210",
"name": "干燥度",
"code": "drying_mode",
"mode": "rw",
"type": "VALUE",
},
{
"id": "211",
"name": "自动投放-洗衣液",
"code": "detergent_set",
"mode": "rw",
"type": "BOOL",
},
{
"id": "212",
"name": "自动投放-柔顺剂",
"code": "softener_set",
"mode": "rw",
"type": "BOOL",
},
{
"id": "213",
"name": "洗衣液投放量",
"code": "detergent_type",
"mode": "rw",
"type": "VALUE",
},
{
"id": "214",
"name": "柔顺剂投放量",
"code": "softener_type",
"mode": "rw",
"type": "VALUE",
},
{
"id": "217",
"name": "预约时间",
"code": "countdown",
"mode": "rw",
"type": "VALUE",
},
{
"id": "218",
"name": "洗衣剩余时间",
"code": "washing_left",
"mode": "ro",
"type": "VALUE",
},
{
"id": "219",
"name": "门锁状态",
"code": "doorlock_state",
"mode": "ro",
"type": "BOOL",
},
{
"id": "220",
"name": "故障",
"code": "error",
"mode": "ro",
"type": "VALUE",
},
{
"id": "221",
"name": "云程序设置",
"code": "custom_param_save",
"mode": "rw",
"type": "VALUE",
},
{
"id": "222",
"name": "云程序读取",
"code": "custom_param_get",
"mode": "ro",
"type": "VALUE",
},
{
"id": "223",
"name": "提示音",
"code": "sound_set",
"mode": "rw",
"type": "BOOL",
},
{
"id": "224",
"name": "距离上次筒自洁次数",
"code": "times_after_clean",
"mode": "ro",
"type": "VALUE",
},
{
"id": "225",
"name": "记忆洗衣偏好开关",
"code": "default_setting",
"mode": "rw",
"type": "BOOL",
},
{
"id": "226",
"name": "洗衣液用尽",
"code": "detergent_empty",
"mode": "ro",
"type": "BOOL",
},
{
"id": "227",
"name": "柔顺剂用尽",
"code": "softener_empty",
"mode": "ro",
"type": "BOOL",
},
{
"id": "229",
"name": "筒灯设定",
"code": "light_setting",
"mode": "rw",
"type": "BOOL",
},
{
"id": "230",
"name": "洗衣液投放量(单次)",
"code": "detergent_volume",
"mode": "rw",
"type": "VALUE",
},
{
"id": "231",
"name": "柔顺剂投放量(单次)",
"code": "softener_volume",
"mode": "rw",
"type": "VALUE",
},
{
"id": "232",
"name": "远程控制授权",
"code": "app_authorization",
"mode": "rw",
"type": "VALUE",
},
{
"id": "10000",
"name": "ID点查询",
"code": "id_query",
"mode": "rw",
"type": "STRING",
},
{
"id": "10001",
"name": "防串货",
"code": "f_c",
"mode": "ro",
"type": "STRING",
},
{
"id": "10004",
"name": "语音包/OBA信息",
"code": "snd_state",
"mode": "rw",
"type": "STRING",
},
{
"id": "10005",
"name": "产品信息",
"code": "product_info",
"mode": "ro",
"type": "STRING",
},
{
"id": "10006",
"name": "隐私协议",
"code": "privacy_info",
"mode": "rw",
"type": "STRING",
},
{
"id": "10007",
"name": "OTA info",
"code": "ota_nfo",
"mode": "rw",
"type": "STRING",
},
{
"id": "10008",
"name": "洗衣记录",
"code": "washing_log",
"mode": "ro",
"type": "BOOL",
},
{
"id": "10101",
"name": "rpc req",
"code": "rpc_req",
"mode": "wo",
"type": "STRING",
},
{
"id": "10102",
"name": "rpc resp",
"code": "rpc_resp",
"mode": "ro",
"type": "STRING",
},
],
},
], ],
"devices": [ "devices": [
{ {
@ -304,7 +896,112 @@ HOME_DATA_RAW = {
"silentOtaSwitch": True, "silentOtaSwitch": True,
}, },
], ],
"receivedDevices": [], "receivedDevices": [
{
"duid": "dyad_duid",
"name": "Dyad Pro",
"localKey": "abc",
"fv": "01.12.34",
"productId": "dyad_product",
"activeTime": 1700754026,
"timeZoneId": "Europe/Stockholm",
"iconUrl": "",
"share": True,
"shareTime": 1701367095,
"online": True,
"pv": "A01",
"tuyaMigrated": False,
"deviceStatus": {
"10002": "",
"202": 0,
"235": 0,
"214": 513,
"225": 360,
"212": 1,
"228": 360,
"209": 100,
"10001": '{"f":"t"}',
"237": 0,
"10007": '{"mqttOtaData":{"mqttOtaStatus":{"status":"IDLE"}}}',
"227": 1320,
"10005": '{"sn":"dyad_sn","ssid":"dyad_ssid","timezone":"Europe/Stockholm","posix_timezone":"CET-1CEST,M3.5.0,M10.5.0/3","ip":"1.123.12.1","mac":"b0:4a:33:33:33:33","oba":{"language":"en","name":"A.03.0291_CE","bom":"A.03.0291","location":"de","wifiplan":"EU","timezone":"CET-1CEST,M3.5.0,M10.5.0/3;Europe/Berlin","logserver":"awsde0","featureset":"0"}"}',
"213": 1,
"207": 4,
"10004": '{"sid_in_use":25,"sid_version":5,"location":"de","bom":"A.03.0291","language":"en"}',
"206": 3,
"216": 0,
"221": 100,
"222": 0,
"223": 2,
"203": 2,
"230": 352,
"205": 1,
"210": 0,
"200": 0,
"226": 0,
"208": 1,
"229": "000,000,003,000,005,000,000,000,003,000,005,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,012,003,000,000",
"201": 3,
"215": 513,
"204": 1,
"224": 1,
},
"silentOtaSwitch": False,
"f": False,
},
{
"duid": "zeo_duid",
"name": "Zeo One",
"localKey": "zeo_local_key",
"fv": "01.00.94",
"productId": "zeo_id",
"activeTime": 1699964128,
"timeZoneId": "Europe/Berlin",
"iconUrl": "",
"share": True,
"shareTime": 1712763572,
"online": True,
"pv": "A01",
"tuyaMigrated": False,
"sn": "zeo_sn",
"featureSet": "0",
"newFeatureSet": "40",
"deviceStatus": {
"208": 2,
"205": 33,
"221": 0,
"226": 0,
"10001": '{"f":"t"}',
"214": 2,
"225": 0,
"232": 0,
"222": 347414,
"206": 0,
"200": 1,
"219": 0,
"223": 0,
"220": 0,
"201": 0,
"202": 1,
"10005": '{"sn":"zeo_sn","ssid":"internet","timezone":"Europe/Berlin","posix_timezone":"CET-1CEST,M3.5.0,M10.5.0/3","ip":"192.111.11.11","mac":"b0:4a:00:00:00:00","rssi":-57,"oba":{"language":"en","name":"A.03.0403_CE","bom":"A.03.0403","location":"de","wifiplan":"EU","timezone":"CET-1CEST,M3.5.0,M10.5.0/3;Europe/Berlin","logserver":"awsde0","loglevel":"4","featureset":"0"}}',
"211": 1,
"210": 1,
"217": 0,
"203": 7,
"213": 2,
"209": 7,
"224": 21,
"218": 227,
"212": 1,
"207": 4,
"204": 1,
"10007": '{"mqttOtaData":{"mqttOtaStatus":{"status":"IDLE"}}}',
"227": 1,
},
"silentOtaSwitch": False,
"f": False,
},
],
"rooms": [ "rooms": [
{"id": 2362048, "name": "Example room 1"}, {"id": 2362048, "name": "Example room 1"},
{"id": 2362044, "name": "Example room 2"}, {"id": 2362044, "name": "Example room 2"},