Closed af950833 closed 6 years ago
Please update python-miio to the current master and try again! ;-)
Everything is OK after upgrade python-miio. All services are working well. Thank you so much :)
Perfect. Thanks for your time, too! Please close the issue.
2018-01-26 00:16:53 ERROR (MainThread) [homeassistant.components.fan] Error on device update! Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 217, in async_add_entity yield from entity.async_device_update(warning=False) File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 304, in async_device_update yield from self.async_update() File "/home/homeassistant/.homeassistant/custom_components/fan/xiaomi_airhumidifier.py", line 230, in async_update ATTR_TRANS_LEVEL: state.trans_level, AttributeError: 'AirHumidifierStatus' object has no attribute 'trans_level'
Because of such a upper error, I had to comment the chind_lock, trans_level and target_humidity. After that, it works well.
And I think that 'default name' and 'flatform' and services names have to be like the below DEFAULT_NAME = 'Xiaomi Air Humidifier' PLATFORM = 'xiaomi_airhumidifier'
SERVICE_SET_BUZZER_ON = 'xiaomi_airhumidifier_set_buzzer_on' SERVICE_SET_BUZZER_OFF = 'xiaomi_airhumidifier_set_buzzer_off' ERVICE_SET_LED_BRIGHTNESS = 'xiaomi_airhumidifier_set_led_brightness'