Found an unsupported model 'zhimi.airpurifier.rma1' for class 'AirPurifierMiot'
Describe the bug
A clear and concise description of what the bug is.
i had add new model 'zhimi.airpurifier.rma1' ,edit code in miio/integrations/airpurifier/zhimi/airpurifier_miot.py .
but have warning:
"Found an unsupported model 'zhimi.airpurifier.rma1' for class 'AirPurifierMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/ "
when call vac.status() can get device data <AirPurifierMiotStatus anion=None aqi=4 average_aqi=None xxxxxx >
Version information (please complete the following information):
- OS: [win10]
- python-miio: [0.5.11]
Device information:
If the issue is specific to a device [Use miiocli device --ip <ip address> --token <token> info]:
- Model: zhimi.airpurifier.rma1
- Hardware version: Xiaomi Smart Air Purifier 4 Lite
- Firmware version: v2.2.1
To Reproduce Steps to reproduce the behavior: 1.
vac = AirPurifierMiot(ip, token)
print(vac.supported_models)
info = vac.info()
print("info")
print(info)
[]
Found an unsupported model 'zhimi.airpurifier.rma1' for class 'AirPurifierMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/
info
Expected behavior
A clear and concise description of what you expected to happen.
run code with no warning
why AirPurifierMiot not have supported_models set ? but AirPurifier had set _supported_models = SUPPORTED_MODELS
Console output
If applicable, add console output to help explain your problem.
If the issue is about communication with a specific device, consider including the output using the --debug flag.
I add the code like this ( https://github.com/rytilahti/python-miio/pull/1399/files) but still have the warning
# https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:air-purifier:0000A007:zhimi-rma1:1
_MAPPING_RMA1 = {
# Air Purifier
"power": {"siid": 2, "piid": 1},
"mode": {"siid": 2, "piid": 4},
# Environment
"humidity": {"siid": 3, "piid": 1},
"aqi": {"siid": 3, "piid": 4},
"temperature": {"siid": 3, "piid": 7},
# Filter
"filter_life_remaining": {"siid": 4, "piid": 1},
"filter_hours_used": {"siid": 4, "piid": 3},
"filter_left_time": {"siid": 4, "piid": 4},
# Alarm
"buzzer": {"siid": 6, "piid": 1},
# Physical Control Locked
"child_lock": {"siid": 8, "piid": 1},
# custom-service
"motor_speed": {"siid": 9, "piid": 1},
"favorite_level": {"siid": 9, "piid": 2},
# aqi
"aqi_realtime_update_duration": {"siid": 11, "piid": 4},
# Screen
"led_brightness": {"siid": 13, "piid": 2},
}
_MAPPINGS = {
"zhimi.airpurifier.ma4": _MAPPING, # airpurifier 3
"zhimi.airpurifier.mb3": _MAPPING, # airpurifier 3h
"zhimi.airpurifier.va1": _MAPPING, # airpurifier proh
"zhimi.airpurifier.vb2": _MAPPING, # airpurifier proh
"zhimi.airpurifier.mb4": _MAPPING_MB4, # airpurifier 3c
"zhimi.airpurifier.rma1": _MAPPING_RMA1, # airpurifier 4 lite
"zhimi.airp.mb4a": _MAPPING_MB4, # airpurifier 3c
"zhimi.airp.mb5": _MAPPING_VA2, # airpurifier 4
"zhimi.airp.va2": _MAPPING_VA2, # airpurifier 4 pro
"zhimi.airp.vb4": _MAPPING_VB4, # airpurifier 4 pro
"zhimi.airp.rmb1": _MAPPING_RMB1, # airpurifier 4 lite
}
You could simply use the RMA1 mapping as the properties seem similar? The error you are getting is odd, is this using the latest release or the master? Here's what it says here, the values should be based on the mapping:
In [1]: from miio import AirPurifierMiot
In [2]: AirPurifierMiot.supported_models
Out[2]: dict_keys(['zhimi.airpurifier.ma4', 'zhimi.airpurifier.mb3', 'zhimi.airpurifier.va1', 'zhimi.airpurifier.vb2', 'zhimi.airpurifier.mb4', 'zhimi.airp.mb4a', 'zhimi.airp.mb5', 'zhimi.airp.va2', 'zhimi.airp.vb4', 'zhimi.airp.rmb1', 'zhimi.airpurifier.za1'])
edit: I just realized that the output is different from the class and from the instance, this is clearly a bug:
In [3]: dev = AirPurifierMiot("127.0.0.1", 32*" ")
In [4]: dev.supported_models
Out[4]: []
i instead Release 0.5.11 but this version not supported 'zhimi.airpurifier.rma1' 。 so i download github code and put it in my project。 when i add new model code ,it give me a warning 。 github code version master zhimi_miot: Rename fan_speed to speed (#1439) 日期: 2022年6月19日 23:45:29 提交者: GitHub