fix: tofan.airrtc.wk01 thermostat and air conditioner service (#1160)
Some checks failed
Tests / check-rule-format (push) Failing after 5s
Validate / validate-hassfest (push) Failing after 6s
Validate / validate-hacs (push) Failing after 12s
Validate / validate-lint (push) Failing after 5s
Validate / validate-setup (push) Failing after 7s

This commit is contained in:
Li Shuzhen
2025-06-19 17:07:31 +08:00
committed by GitHub
parent 5179e97e38
commit 028399c0b1
4 changed files with 179 additions and 2 deletions

View File

@ -629,11 +629,14 @@ class MIoTClient:
mips = self._mips_local.get(device_gw['group_id'], None) mips = self._mips_local.get(device_gw['group_id'], None)
if mips is None: if mips is None:
_LOGGER.error( _LOGGER.error(
'no gw route, %s, try control through cloud', 'no gateway route, %s, try control through cloud',
device_gw) device_gw)
else: else:
result = await mips.set_prop_async( result = await mips.set_prop_async(
did=did, siid=siid, piid=piid, value=value) did=did, siid=siid, piid=piid, value=value)
_LOGGER.debug(
'gateway set prop, %s.%d.%d, %s -> %s',
did, siid, piid, value, result)
rc = (result or {}).get( rc = (result or {}).get(
'code', MIoTErrorCode.CODE_MIPS_INVALID_RESULT.value) 'code', MIoTErrorCode.CODE_MIPS_INVALID_RESULT.value)
if rc in [0, 1]: if rc in [0, 1]:
@ -663,7 +666,7 @@ class MIoTClient:
{'did': did, 'siid': siid, 'piid': piid, 'value': value} {'did': did, 'siid': siid, 'piid': piid, 'value': value}
]) ])
_LOGGER.debug( _LOGGER.debug(
'set prop response, %s.%d.%d, %s, result, %s', 'cloud set prop, %s.%d.%d, %s -> %s',
did, siid, piid, value, result) did, siid, piid, value, result)
if result and len(result) == 1: if result and len(result) == 1:
rc = result[0].get( rc = result[0].get(

View File

@ -261,6 +261,17 @@
"service:004:property:007": "минимальная температура цели " "service:004:property:007": "минимальная температура цели "
} }
}, },
"urn:miot-spec-v2:device:thermostat:0000A031:tofan-wk01": {
"en": {
"service:002": "Thermostat",
"service:002:property:002": "Air Conditioner Mode",
"service:004": "Air Conditioner"
},
"zh_cn": {
"service:002": "地暖",
"service:004": "空调"
}
},
"urn:miot-spec-v2:device:vacuum:0000A006:ijai-v1": { "urn:miot-spec-v2:device:vacuum:0000A006:ijai-v1": {
"zh_cn": { "zh_cn": {
"service:007:property:005:valuelist:000": "安静", "service:007:property:005:valuelist:000": "安静",

View File

@ -19,6 +19,165 @@
] ]
} }
], ],
"urn:miot-spec-v2:device:thermostat:0000A031:tofan-wk01:1:0000C822": [
{
"iid": 2,
"type": "urn:miot-spec-v2:service:thermostat:0000784A:tofan-wk01:1",
"description": "Thermostat",
"properties": [
{
"iid": 1,
"type": "urn:miot-spec-v2:property:on:00000006:tofan-wk01:1",
"description": "Switch Status",
"format": "bool",
"access": [
"read",
"write",
"notify"
]
},
{
"iid": 2,
"type": "urn:miot-spec-v2:property:mode-a:00000008:tofan-wk01:1",
"description": "Mode",
"format": "uint8",
"access": [
"read",
"write",
"notify"
],
"value-list": [
{
"value": 0,
"description": "Auto"
},
{
"value": 1,
"description": "Cool"
},
{
"value": 2,
"description": "Heat"
},
{
"value": 3,
"description": "Fan"
},
{
"value": 4,
"description": "Dry"
}
]
},
{
"iid": 3,
"type": "urn:miot-spec-v2:property:fault:00000009:tofan-wk01:1",
"description": "Device Fault",
"format": "uint8",
"access": [
"read",
"notify"
],
"value-list": [
{
"value": 0,
"description": "No Faults"
}
]
},
{
"iid": 4,
"type": "urn:miot-spec-v2:property:target-temperature:00000021:tofan-wk01:1",
"description": "Target Temperature",
"format": "uint8",
"access": [
"read",
"write",
"notify"
],
"unit": "celsius",
"value-range": [
16,
35,
1
]
}
],
"actions": [
{
"iid": 1,
"type": "urn:miot-spec-v2:action:toggle:00002811:tofan-wk01:1",
"description": "Toggle",
"in": [],
"out": []
}
]
},
{
"iid": 4,
"type": "urn:miot-spec-v2:service:air-conditioner:0000780F:tofan-wk01:1",
"description": "Air Conditioner",
"properties": [
{
"iid": 1,
"type": "urn:miot-spec-v2:property:on:00000006:tofan-wk01:1",
"description": "Switch Status",
"format": "bool",
"access": [
"read",
"write",
"notify"
]
},
{
"iid": 2,
"type": "urn:miot-spec-v2:property:target-temperature:00000021:tofan-wk01:1",
"description": "Target Temperature",
"format": "uint8",
"access": [
"read",
"write",
"notify"
],
"unit": "celsius",
"value-range": [
16,
32,
1
]
},
{
"iid": 3,
"type": "urn:miot-spec-v2:property:fan-level:00000016:tofan-wk01:1",
"description": "Fan Level",
"format": "uint8",
"access": [
"read",
"write",
"notify"
],
"value-list": [
{
"value": 0,
"description": "Auto"
},
{
"value": 2,
"description": "Low"
},
{
"value": 3,
"description": "Medium"
},
{
"value": 4,
"description": "High"
}
]
}
]
}
],
"urn:miot-spec-v2:device:water-heater:0000A02A:xiaomi-yms2:1": [ "urn:miot-spec-v2:device:water-heater:0000A02A:xiaomi-yms2:1": [
{ {
"iid": 2, "iid": 2,

View File

@ -44,3 +44,7 @@ urn:miot-spec-v2:device:motion-sensor:0000A014:xiaomi-pir1:
urn:miot-spec-v2:device:router:0000A036:xiaomi-rd03: urn:miot-spec-v2:device:router:0000A036:xiaomi-rd03:
services: services:
- '*' - '*'
urn:miot-spec-v2:device:thermostat:0000A031:tofan-wk01:
services:
- '2'
- '4'