stevenjoezhang / hass-iotbull

公牛智家 | Bull IoT for Home Assistant
https://zhangshuqiao.org/2023-02/将公牛智家设备接入Home%20Assistant/
16 stars 3 forks source link

同样是G27,显示设置失败。没有任何设备。 #2

Closed zuobianfy closed 1 year ago

zuobianfy commented 1 year ago

添加集成bull,输入账号和密码之后,显示设置失败, 也没有任何设备。ha的日志报错如下 此错误来自自定义集成。 Logger: homeassistant.config_entries Source: custom_components/bull/api.py:21 Integration: Bull IoT (documentation, issues) First occurred: 19:35:08 (3 occurrences) Last logged: 20:00:08 Error setting up entry 手机号xxxx for bull Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bull/init.py", line 20, in async_setup_entry await bull_api.async_get_devices_list() File "/config/custom_components/bull/api.py", line 137, in async_get_devices_list self.parse_devices(res) File "/config/custom_components/bull/api.py", line 142, in parse_devices device = BullDevice(self, info) ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bull/api.py", line 21, in init self._value: int = info["property"][self._identifier]["value"]


KeyError: 'PowerSwitch_1'
stevenjoezhang commented 1 year ago

@zuobianfy 我自己的账号复现不了这个问题(property 里面的键名和 elementIdentifier 都是对应的,不报错) 你可以试试按这个 commit 更新,然后检查 debug 日志里面请求到的 json 格式设备列表,也可以贴上来我分析一下 https://github.com/stevenjoezhang/hass-iotbull/commit/1b82ee3e59f8e48dd75ecef371bd5e30a6d64a46

stevenjoezhang commented 1 year ago

或者你看看这个 commit https://github.com/stevenjoezhang/hass-iotbull/commit/b5824aca0d7fc0934386e763f2a2367298bfc9f9 有没有修复问题

zuobianfy commented 1 year ago

更新插件好使了,多谢大佬

stevenjoezhang commented 1 year ago

好的,问题解决了就好