beveradb / sonoff-lan-mode-homeassistant

Home Assistant platform to control Sonoff switches running the latest Itead firmware, locally (LAN mode).
MIT License
74 stars 36 forks source link

Ugly CancelledError raised / logged when device unconnectable #14

Closed beveradb closed 5 years ago

beveradb commented 5 years ago
2019-02-04 23:42:52 ERROR (MainThread) [homeassistant.components.switch.sonoff_lan_mode] Unable to connect: connection refused
2019-02-04 23:42:52 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.140244495144328] Connection closed by client
Traceback (most recent call last):
  File "/mnt/c/Users/andrew/AndroidStudioProjects/home-assistant/venvclean/bin/hass", line 11, in <module>
    load_entry_point('homeassistant', 'console_scripts', 'hass')()
  File "/mnt/c/Users/andrew/AndroidStudioProjects/home-assistant/homeassistant/__main__.py", line 389, in main
    exit_code = asyncio_run(setup_and_run_hass(config_dir, args))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/c/Users/andrew/AndroidStudioProjects/home-assistant/homeassistant/util/logging.py", line 88, in _process
    self._queue.get(), self.loop).result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 430, in result
    raise CancelledError()
concurrent.futures._base.CancelledError
mattsaxon commented 5 years ago

I believe this is also fixed by https://github.com/beveradb/pysonofflan/pull/48