mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-15 14:01:14 +08:00
fix: hyd.airer.znlyj5 current-position value-range
This commit is contained in:
parent
e319eecfc7
commit
319f4fb189
@ -1198,6 +1198,13 @@ class _SpecModify:
|
||||
return None
|
||||
return access
|
||||
|
||||
def get_prop_value_range(self, siid: int, piid: int) -> Optional[list]:
|
||||
value_range = self.__get_prop_item(siid=siid, piid=piid,
|
||||
key='value-range')
|
||||
if not isinstance(value_range, list):
|
||||
return None
|
||||
return value_range
|
||||
|
||||
def __get_prop_item(self, siid: int, piid: int, key: str) -> Optional[str]:
|
||||
if not self._selected:
|
||||
return None
|
||||
@ -1474,6 +1481,10 @@ class MIoTSpecParser:
|
||||
siid=service['iid'], piid=property_['iid'])
|
||||
if custom_access:
|
||||
spec_prop.access = custom_access
|
||||
custom_range = self._spec_modify.get_prop_value_range(
|
||||
siid=service['iid'], piid=property_['iid'])
|
||||
if custom_range:
|
||||
spec_prop.value_range = custom_range
|
||||
# Parse service event
|
||||
for event in service.get('events', []):
|
||||
if (
|
||||
|
||||
@ -42,3 +42,10 @@ urn:miot-spec-v2:device:router:0000A036:xiaomi-rd08:1:
|
||||
name: upload-speed
|
||||
icon: mdi:upload
|
||||
unit: B/s
|
||||
urn:miot-spec-v2:device:airer:0000A00D:hyd-znlyj5:1:
|
||||
prop.2.3:
|
||||
value-range:
|
||||
- 0
|
||||
- 1
|
||||
- 1
|
||||
urn:miot-spec-v2:device:airer:0000A00D:hyd-znlyj5:2: urn:miot-spec-v2:device:airer:0000A00D:hyd-znlyj5:1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user