使用的是 ma4 运行后产生错误,无法生成实体,日志如下:
Using ma4, but can not get it running and generate entity. Logs:
2021-02-07 23:33:44 ERROR (MainThread) [homeassistant.components.climate] miio_duy: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
await task
File "/config/custom_components/miio_duy/climate.py", line 220, in async_update
self._last_on_operation = HVACMode[state.mode.name].value
File "/config/custom_components/miio_duy/climate.py", line 476, in mode
return OperationMode(self.data['mode'])
File "/usr/local/lib/python3.8/enum.py", line 339, in __call__
return cls.__new__(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in __new__
raise ve_exc
ValueError: 'automode' is not a valid OperationMode
没找到好的修复方法。
开启空调的状态下重启hass即可。
Restart hass while the ac is on solve the problem.