|
发表于 2021-6-24 07:16:16
来自手机
|
显示全部楼层
qq94156510 发表于 2021-6-21 10:54
楼主大神,控空调的时候经常出现websocket断开的情况。不知道大家有没有这种问题 ...
我也websocket api问题。
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/ewelink_climate/statemanager.py:53
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 07:05:38 (6 occurrences)
Last logged: 07:14:30
[140040722290144] 'NoneType' object has no attribute 'send'
[140040838047056] 'NoneType' object has no attribute 'send'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 760, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 434, in async_set_hvac_mode
await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/ewelink_climate/climate.py", line 208, in set_hvac_mode
self._states_manager.send_payload(self._device_id, {"power": "on", mode_key: mode})
File "/config/custom_components/ewelink_climate/statemanager.py", line 84, in send_payload
self.send_json(payload)
File "/config/custom_components/ewelink_climate/statemanager.py", line 53, in send_json
self._ws.send(json.dumps(jsondata))
AttributeError: 'NoneType' object has no attribute 'send'
|
|