diff --git a/custom_components/xiaomi_home/miot/miot_spec.py b/custom_components/xiaomi_home/miot/miot_spec.py index 859453b..ebf1759 100644 --- a/custom_components/xiaomi_home/miot/miot_spec.py +++ b/custom_components/xiaomi_home/miot/miot_spec.py @@ -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 ( diff --git a/custom_components/xiaomi_home/miot/specs/spec_modify.yaml b/custom_components/xiaomi_home/miot/specs/spec_modify.yaml index 131ef59..58ba8ef 100644 --- a/custom_components/xiaomi_home/miot/specs/spec_modify.yaml +++ b/custom_components/xiaomi_home/miot/specs/spec_modify.yaml @@ -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