xiaomi_miot_raw
xiaomi_miot_raw copied to clipboard
更新Home Assistant 2023.6.0后小米空调失效
更新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 "
日志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).
Same here with the Humidifier2
Logboek Details (FOUT) Logger: homeassistant.setup Source: setup.py:374 First occurred: 10:29:13 (23 occurrences) Last logged: 10:31:35
Unable to prepare setup for platform xiaomi_miot_raw.climate: Platform not found (Exception importing custom_components.xiaomi_miot_raw.climate). Unable to prepare setup for platform xiaomi_miot_raw.fan: Platform not found (Exception importing custom_components.xiaomi_miot_raw.fan). 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.select: Platform not found (Exception importing custom_components.xiaomi_miot_raw.select). Unable to prepare setup for platform xiaomi_miot_raw.binary_sensor: Platform not found (Exception importing custom_components.xiaomi_miot_raw.binary_sensor).
Same here with the Humidifier2
Logboek Details (FOUT) Logger: homeassistant.setup Source: setup.py:374 First occurred: 10:29:13 (23 occurrences) Last logged: 10:31:35
Unable to prepare setup for platform xiaomi_miot_raw.climate: Platform not found (Exception importing custom_components.xiaomi_miot_raw.climate). Unable to prepare setup for platform xiaomi_miot_raw.fan: Platform not found (Exception importing custom_components.xiaomi_miot_raw.fan). 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.select: Platform not found (Exception importing custom_components.xiaomi_miot_raw.select). Unable to prepare setup for platform xiaomi_miot_raw.binary_sensor: Platform not found (Exception importing custom_components.xiaomi_miot_raw.binary_sensor).
I have reverted to Homeassistant 2023.5.4 pending an update from the author.
Same here with the Humidifier2 Logboek Details (FOUT) Logger: homeassistant.setup Source: setup.py:374 First occurred: 10:29:13 (23 occurrences) Last logged: 10:31:35 Unable to prepare setup for platform xiaomi_miot_raw.climate: Platform not found (Exception importing custom_components.xiaomi_miot_raw.climate). Unable to prepare setup for platform xiaomi_miot_raw.fan: Platform not found (Exception importing custom_components.xiaomi_miot_raw.fan). 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.select: Platform not found (Exception importing custom_components.xiaomi_miot_raw.select). Unable to prepare setup for platform xiaomi_miot_raw.binary_sensor: Platform not found (Exception importing custom_components.xiaomi_miot_raw.binary_sensor).
I have reverted to Homeassistant 2023.5.4 pending an update from the author.
There will be no update from the author. Here's a workaround: https://github.com/ha0y/xiaomi_miot_raw/issues/518#issuecomment-1582633668
Same here with the Humidifier2 Logboek Details (FOUT) Logger: homeassistant.setup Source: setup.py:374 First occurred: 10:29:13 (23 occurrences) Last logged: 10:31:35 Unable to prepare setup for platform xiaomi_miot_raw.climate: Platform not found (Exception importing custom_components.xiaomi_miot_raw.climate). Unable to prepare setup for platform xiaomi_miot_raw.fan: Platform not found (Exception importing custom_components.xiaomi_miot_raw.fan). 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.select: Platform not found (Exception importing custom_components.xiaomi_miot_raw.select). Unable to prepare setup for platform xiaomi_miot_raw.binary_sensor: Platform not found (Exception importing custom_components.xiaomi_miot_raw.binary_sensor).
I have reverted to Homeassistant 2023.5.4 pending an update from the author.
There will be no update from the author. Here's a workaround: #518 (comment)
It worked,thanks.
按图修改就可以了
按图修改就可以了
已修复,非常感谢。
請問yield from在那?
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词
1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词
1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
謝謝你,解決了
mine still not working
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, 1: import asyncio 2: @asyncio.coroutine Then reload the addon.
yes i did but still not working....
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词
1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
还需要把basic_dev_class.py中的yield from改为await
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词 1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
还需要把basic_dev_class.py中的yield from改为await
我把basic_dev_class.py中的yield from改为await后无法正常运行,改回去可以运行。
yes i did but still not working....
You can try to change the “yield from” in basic_dev_class.py to “await”.
我这样做了就可以了。你看看日志有什么错误提示?
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词 1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
还需要把basic_dev_class.py中的yield from改为await
我把basic_dev_class.py中的yield from改为await后无法正常运行,改回去可以运行。
:(
Logger: homeassistant.loader Source: custom_components/xiaomi_miot_raw/switch.py:16 Integration: Xiaomi MIoT (documentation, issues) First occurred: 2:08:49 PM (4 occurrences) Last logged: 2:08:50 PM
Unexpected exception importing platform custom_components.xiaomi_miot_raw.switch
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 "
我这样做了就可以了。你看看日志有什么错误提示?
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词 1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
还需要把basic_dev_class.py中的yield from改为await
我把basic_dev_class.py中的yield from改为await后无法正常运行,改回去可以运行。
Logger: homeassistant.loader Source: custom_components/xiaomi_miot_raw/switch.py:16 Integration: Xiaomi MIoT (documentation, issues) First occurred: 2:08:49 PM (4 occurrences) Last logged: 2:08:50 PM
Unexpected exception importing platform custom_components.xiaomi_miot_raw.switch 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/switch.py", line 16, in from .basic_dev_class import ( File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 705 await getattr(device, method["method"])(**params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'await' outside async function
你楼下这位按issues的两个方案修改均不成功,你可以帮忙看一下,我能力有限帮不了他,他这个日志就是把yield from改为await后报错。
这个问题发生的原因是目前版本的home assistant container用的是python 3.11,已经不支持python 3.10以及以前版本的@asyncio.coroutine/yield from的操作了,而是改用了async def/await的方式。这个小米插件是很久之前写的,所以部分地方还在用python3.10的方法。所以我们要做以下修改: 1、删除所有.py文件中的@asyncio.coroutine这一行,但是仅仅删除这行还不够,你还要看看这一行下面的函数定义中有没有: async def ....这样的定义函数方式,大部分文件是有这样写的,但是在最重要的basic_dev_class.py里面的第685行直接写了def...而不是async def...,所以要把这个地方改成async def... 2、将yield from改为await
这样应该可以了,我就是这么做的。
我这样做了就可以了。你看看日志有什么错误提示?
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词 1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
还需要把basic_dev_class.py中的yield from改为await
我把basic_dev_class.py中的yield from改为await后无法正常运行,改回去可以运行。
Logger: homeassistant.loader Source: custom_components/xiaomi_miot_raw/switch.py:16 Integration: Xiaomi MIoT (documentation, issues) First occurred: 2:08:49 PM (4 occurrences) Last logged: 2:08:50 PM
Unexpected exception importing platform custom_components.xiaomi_miot_raw.switch 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/switch.py", line 16, in from .basic_dev_class import ( File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 705 await getattr(device, method["method"])(**params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'await' outside async function
你楼下这位按issues的两个方案修改均不成功,你可以帮忙看一下,我能力有限帮不了他,他这个日志就是把yield from改为await后报错。
-
change "yield from" to "await"
-
change line 685 of basic_dev_class.py from " def async_service_handler(self, service):" to "async def async_service_handler(self, service): "
:(
Logger: homeassistant.loader Source: custom_components/xiaomi_miot_raw/switch.py:16 Integration: Xiaomi MIoT (documentation, issues) First occurred: 2:08:49 PM (4 occurrences) Last logged: 2:08:50 PM
Unexpected exception importing platform custom_components.xiaomi_miot_raw.switch 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/switch.py", line 16, in from .basic_dev_class import ( File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 705 await getattr(device, method["method"])(**params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'await' outside async function
这个问题发生的原因是目前版本的home assistant container用的是python 3.11,已经不支持python 3.10以及以前版本的@asyncio.coroutine/yield from的操作了,而是改用了async def/await的方式。这个小米插件是很久之前写的,所以部分地方还在用python3.10的方法。所以我们要做以下修改: 1、删除所有.py文件中的@asyncio.coroutine这一行,但是仅仅删除这行还不够,你还要看看这一行下面的函数定义中有没有: async def ....这样的定义函数方式,大部分文件是有这样写的,但是在最重要的basic_dev_class.py里面的第685行直接写了def...而不是async def...,所以要把这个地方改成async def... 2、将yield from改为await
这样应该可以了,我就是这么做的。
我这样做了就可以了。你看看日志有什么错误提示?
請問yield from在那?
我使用的另外一种方案,把../custom_components/xiaomi_miot_raw文件夹下每一个.py文件打开查找删除下面两个关键词 1:import asyncio 2:@asyncio.coroutine 删除后重载即可。
还需要把basic_dev_class.py中的yield from改为await
我把basic_dev_class.py中的yield from改为await后无法正常运行,改回去可以运行。
Logger: homeassistant.loader Source: custom_components/xiaomi_miot_raw/switch.py:16 Integration: Xiaomi MIoT (documentation, issues) First occurred: 2:08:49 PM (4 occurrences) Last logged: 2:08:50 PM Unexpected exception importing platform custom_components.xiaomi_miot_raw.switch 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/switch.py", line 16, in from .basic_dev_class import ( File "/config/custom_components/xiaomi_miot_raw/basic_dev_class.py", line 705 await getattr(device, method["method"])(**params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'await' outside async function 你楼下这位按issues的两个方案修改均不成功,你可以帮忙看一下,我能力有限帮不了他,他这个日志就是把yield from改为await后报错。
受教了,感谢科普,目前能使用我就先不改了,我只删除了每个文件的这两个词: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
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... :-)