banto6 / haier

海尔智能家居设备接入HomeAssistant
Apache License 2.0
626 stars 124 forks source link

添加设备或实体失败 #134

Closed tangtangxiao closed 6 months ago

tangtangxiao commented 6 months ago

问题描述 添加设备或实体失败

环境信息:

设备信息 若是设备无法识别或控制错误则此项必填,没有设备信息可能会被直接关闭不做处理。

设备信息可在.storage/haier/目录下找到,文件格式为device_设备ID.json,上传文件时可将文件名和文件内容中的设备ID替换为任意值以保护个人隐私。

设备ID可开启debug模式后可在Device Info部分的日志中找到。日志可在配置 > 系统 > 日志 > 加载完整日志中查看。

错误日志 File "/config/custom_components/haier/init.py", line 33, in async_setup_entry await store.async_save(json.dumps(await client.get_digital_model(device.id), ensure_ascii=False)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/core/client.py", line 87, in get_digital_model return json.loads(content['detailInfo'][deviceId])['attributes']


KeyError: 'B0A37EAFA502'
2024-05-09 23:20:24.483 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'havcs' sets "title" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/havcs/__init__.py, line 622: entry.title=f"接入平台[{entry.data.get('platform')}-{DEVICE_PLATFORM_DICT[entry.data.get('platform')]['cn_name']}],接入方式{mode}", please report it to the author of the 'havcs' custom integration
2024-05-09 23:20:24.487 ERROR (MainThread) [custom_components.havcs] [post-task] Unable to import havcs.dueros, cannot import name 'AsyncTrackStates' from 'homeassistant.helpers.state' (/usr/src/homeassistant/homeassistant/helpers/state.py)
2024-05-09 23:20:24.487 ERROR (MainThread) [custom_components.havcs.http] [http][check] unexpected error occur: TypeError("timeout() got an unexpected keyword argument 'loop'")
Traceback (most recent call last):
File "/config/custom_components/havcs/http.py", line 463, in async_check_http_oauth
with async_timeout.timeout(5, loop= self._hass.loop):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: timeout() got an unexpected keyword argument 'loop'
2024-05-09 23:20:24.493 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/havcs/http.py", line 463, in async_check_http_oauth
with async_timeout.timeout(5, loop= self._hass.loop):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: timeout() got an unexpected keyword argument 'loop'
banto6 commented 6 months ago

使用master分支最新代码后提交一下最新日志

tangtangxiao commented 6 months ago

使用最近版本,可以添加了。