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

您好关于重启ha后 ds_air无法使用的问题 #30

Open
Helloookimi opened this issue Mar 16, 2022 · 10 comments
Open

您好关于重启ha后 ds_air无法使用的问题 #30

Helloookimi opened this issue Mar 16, 2022 · 10 comments

Comments

@Helloookimi
Copy link

首先非常感谢制作这个组建能够让家里的大金通过ha进行控制,并且我也使用了一段时间,日常工作时非常完美。
但是当我重启一次ha的时候就会出现无法载入ds_air的问题,需要重新安装并进行相关配置才可以继续使用。
具体错误如下:
Logger: homeassistant.bootstrap
Source: bootstrap.py:409
First occurred: 21:55:10 (4 occurrences)
Last logged: 21:58:11
Waiting on integrations to complete setup: ds_air

Logger: root
Source: custom_components/ds_air/ds_air_service/service.py:292
Integration: DS-AIR (documentation)
First occurred: 21:58:58 (1 occurrences)
Last logged: 21:58:58

Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/config/custom_components/ds_air/ds_air_service/service.py", line 134, in run
Service.poll_status()
File "/config/custom_components/ds_air/ds_air_service/service.py", line 292, in poll_status
for i in Service._new_aircons:
TypeError: 'NoneType' object is not iterable

ha版本为:2021.8.8 整个ha是通过esxi以虚拟机的形式安装的haos。
再次感谢您制作的组件,如果方便,望能够解决这个重启后无法使用的问题,谢谢。

@xrh0905
Copy link
Contributor

xrh0905 commented Mar 25, 2022

可以先更新到最新的HA版本试试?

@Helloookimi
Copy link
Author

有个大佬看了下您的代码和我的错误,告诉我:是属于重启后再其次刷新空调列表的时候,因为没有新设备,所以这个变量返回空值,于是python就报错了。但不知道应该返回什么值才能让程序知道是没有新设备。(@static method def poll_status这部分)
然后根据这个思路我关闭了自动发现新设备以后,重启HA就不崩溃了,您看下是不是这个问题,或者说新版本HA也解决了这个问题呢?

@mypal
Copy link
Owner

mypal commented Jul 21, 2022

看起来不是新设备发现的问题。看上去像是你用的重启方法并没有完全重置Python的运行环境,有没有试过虚拟机彻底关闭再重启,这样会报错么?

@Helloookimi
Copy link
Author

发现这个情况就是再虚拟机掉电后自动重启后出现的,现在最近调试有时候关闭虚拟机后,重启就肯定不行了,解决的办法禁用组件重启或者再ESXI中重启几次虚拟机又行了。。

@Helloookimi
Copy link
Author

就是每一次重启基本上都会有这个问题,然后再多重启几次才可以让组件运行起来。

@xrh0905
Copy link
Contributor

xrh0905 commented Jul 21, 2022

Home-Assistant版本?

@Helloookimi
Copy link
Author

作者您好,最近又重新部署了HA,ESXI虚拟机安装部署的HA9.5版本,在第一次添加组件时没有问题,能够正确识别所有设备,但是重启后又无法载入了,删除重新添加组件出现以下日志:
Logger: root
Source: custom_components/ds_air/ds_air_service/service.py:293
Integration: DS-AIR (documentation)
First occurred: 2023年2月27日 23:19:22 (2 occurrences)
Last logged: 09:55:17

Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/config/custom_components/ds_air/ds_air_service/service.py", line 135, in run
Service.poll_status()
File "/config/custom_components/ds_air/ds_air_service/service.py", line 293, in poll_status
for i in Service._new_aircons:
TypeError: 'NoneType' object is not iterable

@Helloookimi
Copy link
Author

彻底关闭HAOS,再开机也是一样的问题

@Helloookimi
Copy link
Author

重新部署了一个x86的haos9.5版本,同样问题,第一次提交的时候成功了,重启就不行了,再次添加也报错,再次添加时候出现以下错误:
Logger: aiohttp.server
Source: custom_components/ds_air/ds_air_service/service.py:205
Integration: DS-AIR (documentation)
First occurred: 21:42:35 (1 occurrences)
Last logged: 21:42:35

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 67, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 218, in post
return await super().post(request)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
result = await self._flow_mgr.async_init(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 233, in async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1816, in async_create_flow
return HANDLERS[entry.domain].async_get_options_flow(entry)
File "/config/custom_components/ds_air/config_flow.py", line 81, in async_get_options_flow
return DsAirOptionsFlowHandler(config_entry)
File "/config/custom_components/ds_air/config_flow.py", line 93, in init
self._climates = list(map(lambda state: state.alias, Service.get_aircons()))
File "/config/custom_components/ds_air/ds_air_service/service.py", line 205, in get_aircons
return Service._new_aircons+Service._aircons+Service._bathrooms
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

Logger: root
Source: custom_components/ds_air/ds_air_service/service.py:293
Integration: DS-AIR (documentation)
First occurred: 21:43:38 (1 occurrences)
Last logged: 21:43:38

Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/config/custom_components/ds_air/ds_air_service/service.py", line 135, in run
Service.poll_status()
File "/config/custom_components/ds_air/ds_air_service/service.py", line 293, in poll_status
for i in Service._new_aircons:
TypeError: 'NoneType' object is not iterable

@mypal
Copy link
Owner

mypal commented Mar 24, 2023

#50 应该修掉这个问题了,可以取test分支代码试试看,没问题我发个版

@mypal mypal closed this as completed Mar 24, 2023
@mypal mypal reopened this Mar 24, 2023
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

3 participants