-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
更新Home Assistant 2023.6.0后小米空调失效 #516
Comments
Same here with the Humidifier2 Logboek Details (FOUT) Unable to prepare setup for platform xiaomi_miot_raw.climate: Platform not found (Exception importing custom_components.xiaomi_miot_raw.climate). |
I have reverted to Homeassistant 2023.5.4 pending an update from the author. |
There will be no update from the author. |
It worked,thanks. |
請問yield from在那? |
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词 1:import asyncio |
謝謝你,解決了 |
mine still not working |
Open the ../custom_components/xiaomi_miot_raw folder, open each .py file under the folder to find two keywords to delete, |
yes i did but still not working.... |
还需要把basic_dev_class.py中的yield from改为await |
我把basic_dev_class.py中的yield from改为await后无法正常运行,改回去可以运行。 |
You can try to change the “yield from” in basic_dev_class.py to “await”. |
我这样做了就可以了。你看看日志有什么错误提示?
|
:( Logger: homeassistant.loader Unexpected exception importing platform custom_components.xiaomi_miot_raw.switch |
Logger: homeassistant.loader Unexpected exception importing platform custom_components.xiaomi_miot_raw.switch 你楼下这位按issues的两个方案修改均不成功,你可以帮忙看一下,我能力有限帮不了他,他这个日志就是把yield from改为await后报错。 |
这个问题发生的原因是目前版本的home assistant container用的是python 3.11,已经不支持python 3.10以及以前版本的@asyncio.coroutine/yield from的操作了,而是改用了async def/await的方式。这个小米插件是很久之前写的,所以部分地方还在用python3.10的方法。所以我们要做以下修改: 这样应该可以了,我就是这么做的。
|
|
受教了,感谢科普,目前能使用我就先不改了,我只删除了每个文件的这两个词:1: import asyncio 2: @asyncio.coroutine 然后重载插件就正常运行了。 |
我也能用了~ 謝謝!!! |
It helped me too, thank you guys! |
https://github.com/lekoOwO/xiaomi_miot_raw I've modified the code according to the previous suggestions if anyone need this |
Thx a lot. Clean & Dry feeling... :-) |
Hi lekoOwO, I have use your code with core 2023.9.3; when I do TTS still get unknow error :( pls help! thx~ |
更新Home Assistant 2023.6.0后小米空调失效,以下是日志,希望作者百忙之中更新一下,辛苦了。
日志1:
Logger: homeassistant.loader
Source: custom_components/xiaomi_miot_raw/basic_dev_class.py:684
Integration: Xiaomi MIoT (documentation, issues)
First occurred: 11:41:29 (48 occurrences)
Last logged: 12:43:36
Unexpected exception importing platform custom_components.xiaomi_miot_raw.select
Unexpected exception importing platform custom_components.xiaomi_miot_raw.number
Unexpected exception importing platform custom_components.xiaomi_miot_raw.light
Unexpected exception importing platform custom_components.xiaomi_miot_raw.sensor
Unexpected exception importing platform custom_components.xiaomi_miot_raw.binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/xiaomi_miot_raw/sensor.py", line 20, in
from .basic_dev_class import (
File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 63, in
class GenericMiotDevice(Entity):
File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 684, in GenericMiotDevice
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
日志2:
Logger: homeassistant.setup
Source: setup.py:374
First occurred: 11:41:29 (48 occurrences)
Last logged: 12:43:36
Unable to prepare setup for platform xiaomi_miot_raw.select: Platform not found (Exception importing custom_components.xiaomi_miot_raw.select).
Unable to prepare setup for platform xiaomi_miot_raw.number: Platform not found (Exception importing custom_components.xiaomi_miot_raw.number).
Unable to prepare setup for platform xiaomi_miot_raw.light: Platform not found (Exception importing custom_components.xiaomi_miot_raw.light).
Unable to prepare setup for platform xiaomi_miot_raw.sensor: Platform not found (Exception importing custom_components.xiaomi_miot_raw.sensor).
Unable to prepare setup for platform xiaomi_miot_raw.binary_sensor: Platform not found (Exception importing custom_components.xiaomi_miot_raw.binary_sensor).
The text was updated successfully, but these errors were encountered: