Fix vesync purifier 131 tests (#142860)

This commit is contained in:
cdnninja 2025-04-14 05:58:54 -06:00 committed by GitHub
parent b5f15b6d67
commit f84f6aa713
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 39 additions and 14 deletions

View File

@ -27,7 +27,11 @@ DEVICE_FIXTURES: dict[str, list[tuple[str, str, str]]] = {
("post", "/cloud/v2/deviceManaged/bypassV2", "device-detail.json")
],
"Air Purifier 131s": [
("post", "/131airPurifier/v1/device/deviceDetail", "purifier-detail.json")
(
"post",
"/131airPurifier/v1/device/deviceDetail",
"air-purifier-131s-detail.json",
)
],
"Air Purifier 200s": [
("post", "/cloud/v2/deviceManaged/bypassV2", "device-detail.json")

View File

@ -0,0 +1,25 @@
{
"code": 0,
"msg": "request success",
"traceId": "1744558015",
"screenStatus": "on",
"filterLife": {
"change": false,
"useHour": 3034,
"percent": 25
},
"activeTime": 0,
"timer": null,
"scheduleCount": 0,
"schedule": null,
"levelNew": 0,
"airQuality": "excellent",
"level": null,
"mode": "sleep",
"deviceName": "Levoit 131S Air Purifier",
"currentFirmVersion": "2.0.58",
"childLock": "off",
"deviceStatus": "on",
"deviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/airpurifier131_240.png",
"connectionStatus": "online"
}

View File

@ -1,10 +0,0 @@
{
"code": 0,
"deviceStatus": "on",
"activeTime": 50,
"filterLife": 90,
"screenStatus": "on",
"mode": "auto",
"level": 2,
"airQuality": 95
}

View File

@ -78,11 +78,17 @@
# name: test_fan_state[Air Purifier 131s][fan.air_purifier_131s]
StateSnapshot({
'attributes': ReadOnlyDict({
'active_time': 0,
'friendly_name': 'Air Purifier 131s',
'mode': 'sleep',
'percentage': None,
'percentage_step': 33.333333333333336,
'preset_mode': 'sleep',
'preset_modes': list([
'auto',
'sleep',
]),
'screen_status': 'on',
'supported_features': <FanEntityFeature: 57>,
}),
'context': <ANY>,
@ -90,7 +96,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
'state': 'on',
})
# ---
# name: test_fan_state[Air Purifier 200s][devices]

View File

@ -114,7 +114,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
'state': 'excellent',
})
# ---
# name: test_sensor_state[Air Purifier 131s][sensor.air_purifier_131s_filter_lifetime]
@ -129,7 +129,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
'state': '25',
})
# ---
# name: test_sensor_state[Air Purifier 200s][devices]