2020-03-14 11:36:24 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2511835632] local variable 'msg' referenced before assignment
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.6/site-packages/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
connection.context(msg),
File "/usr/local/python3/lib/python3.6/site-packages/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/local/python3/lib/python3.6/asyncio/futures.py", line 331, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/local/python3/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
future.result()
File "/usr/local/python3/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
File "/usr/local/python3/lib/python3.6/asyncio/tasks.py", line 181, in _step
result = coro.throw(exc)
File "/usr/local/python3/lib/python3.6/site-packages/homeassistant/core.py", line 1262, in _execute_service
await self._hass.async_add_executor_job(handler.func, service_call)
File "/usr/local/python3/lib/python3.6/asyncio/futures.py", line 331, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/local/python3/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
future.result()
File "/usr/local/python3/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
File "/usr/local/python3/lib/python3.6/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/ha_qqmail/__init__.py", line 95, in notify
_message = self.api_msg.default(_message, _entity, _action, hass.config.api.base_url.strip('/') + URL)
File "/config/custom_components/ha_qqmail/api_msg.py", line 23, in default
if entity is None and action is None:
UnboundLocalError: local variable 'msg' referenced before assignment
一直报msg不是没有声明?需怎么声明一下? |