Skip to content
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

设备与集成内显示【Xiaomi Miot Auto未加载】 #1281

Closed
swzsweet opened this issue Aug 24, 2023 · 10 comments
Closed

设备与集成内显示【Xiaomi Miot Auto未加载】 #1281

swzsweet opened this issue Aug 24, 2023 · 10 comments

Comments

@swzsweet
Copy link

Device model / 设备型号

应该是N1 openwrt docker

Component version / 插件版本

系统信息内未显示 应该是 v0.7.11

HA core version / HA版本

2022.11.5

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

设备与集成内显示【Xiaomi Miot Auto未加载】
image
image

Entity attributes / 实体属性

无实体

Home Assistant Logs / 系统日志

Logger: homeassistant.setup
Source: setup.py:192
First occurred: 17:36:53 (1 occurrences)
Last logged: 17:36:53

Setup failed for custom integration xiaomi_miot: Unable to import component: cannot import name 'JsonObjectType' from 'homeassistant.util.json' (/usr/src/homeassistant/homeassistant/util/json.py)

@swzsweet
Copy link
Author

出现这个情况是在更新后,更新之前还能正常使用的

@swzsweet
Copy link
Author

以下是完成日志
2023-08-24 17:36:38.471 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration xiaomi_miot which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-08-24 17:36:53.428 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration xiaomi_miot: Unable to import component: cannot import name 'JsonObjectType' from 'homeassistant.util.json' (/usr/src/homeassistant/homeassistant/util/json.py)
2023-08-24 17:46:27.877 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration xiaomi_miot: cannot import name 'JsonObjectType' from 'homeassistant.util.json' (/usr/src/homeassistant/homeassistant/util/json.py)
2023-08-24 17:47:12.717 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration xiaomi_miot: cannot import name 'JsonObjectType' from 'homeassistant.util.json' (/usr/src/homeassistant/homeassistant/util/json.py)

@swzsweet
Copy link
Author

甚至我现在想要删除这个集成都不行

@al-one
Copy link
Owner

al-one commented Aug 24, 2023

升级HA到近期的版本,或者升级插件到 v0.7.12

@swzsweet
Copy link
Author

升级HA到近期的版本,或者升级插件到 v0.7.12

HA升级后问题解决

@chikehe
Copy link

chikehe commented Aug 24, 2023

HA Core 2022.11.1 升级到0.7.12后依旧报错

Logger: homeassistant.loader
Source: custom_components/xiaomi_miot/core/const.py:97
Integration: xiaomi_miot (documentation, issues)
First occurred: 11:10:11 PM (1 occurrences)
Last logged: 11:10:11 PM

Unexpected exception importing component custom_components.xiaomi_miot
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/xiaomi_miot/core/const.py", line 94, in
from homeassistant.core import ServiceResponse, SupportsResponse
ImportError: cannot import name 'ServiceResponse' from 'homeassistant.core' (/srv/homeassistant/lib/python3.9/site-packages/homeassistant/core.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 709, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/xiaomi_miot/init.py", line 39, in
from .core.const import *
File "/home/homeassistant/.homeassistant/custom_components/xiaomi_miot/core/const.py", line 97, in
ServiceResponse = JsonObjectType | None
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

@al-one
Copy link
Owner

al-one commented Aug 25, 2023

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

@chikehe 升级Python版本

@hiie
Copy link

hiie commented Aug 26, 2023

一样的问题。可以退回版本更新吗?更新python版本工程比较大

@al-one
Copy link
Owner

al-one commented Aug 27, 2023

更新至master分支。

@al-one al-one closed this as completed Sep 21, 2023
@fzip
Copy link

fzip commented Feb 24, 2024

我现在升级了11.5也会有这问题。请问怎么解决??请指点

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants