mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-03-31 14:55:31 +08:00
fix: fan-level without value-list but with value-range (#808)
This commit is contained in:
parent
5adcb7ce00
commit
7901607648
@ -1205,6 +1205,13 @@ class _SpecModify:
|
||||
return None
|
||||
return value_range
|
||||
|
||||
def get_prop_value_list(self, siid: int, piid: int) -> Optional[list]:
|
||||
value_list = self.__get_prop_item(siid=siid, piid=piid,
|
||||
key='value-list')
|
||||
if not isinstance(value_list, list):
|
||||
return None
|
||||
return value_list
|
||||
|
||||
def __get_prop_item(self, siid: int, piid: int, key: str) -> Optional[str]:
|
||||
if not self._selected:
|
||||
return None
|
||||
@ -1485,6 +1492,10 @@ class MIoTSpecParser:
|
||||
siid=service['iid'], piid=property_['iid'])
|
||||
if custom_range:
|
||||
spec_prop.value_range = custom_range
|
||||
custom_list = self._spec_modify.get_prop_value_list(
|
||||
siid=service['iid'], piid=property_['iid'])
|
||||
if custom_list:
|
||||
spec_prop.value_list = custom_list
|
||||
# Parse service event
|
||||
for event in service.get('events', []):
|
||||
if (
|
||||
|
@ -49,3 +49,12 @@ urn:miot-spec-v2:device:airer:0000A00D:hyd-znlyj5:1:
|
||||
- 1
|
||||
- 1
|
||||
urn:miot-spec-v2:device:airer:0000A00D:hyd-znlyj5:2: urn:miot-spec-v2:device:airer:0000A00D:hyd-znlyj5:1
|
||||
urn:miot-spec-v2:device:bath-heater:0000A028:opple-acmoto:1:
|
||||
prop.5.2:
|
||||
value-list:
|
||||
- value: 1
|
||||
description: low
|
||||
- value: 128
|
||||
description: medium
|
||||
- value: 255
|
||||
description: high
|
||||
|
Loading…
x
Reference in New Issue
Block a user