esphome / esphome

ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
https://esphome.io/
Other
8.18k stars 3.46k forks source link

Missing tornado dependency for dashboard #24

Closed brandond closed 6 years ago

brandond commented 6 years ago

Just updated to 1.6.0 and tried to start the dashboard. Got a stack trace instead:

Traceback (most recent call last):
  File "/home/media/django/bin/esphomeyaml", line 11, in <module>
    sys.exit(main())
  File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/__main__.py", line 437, in main
    return run_esphomeyaml(sys.argv)
  File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/__main__.py", line 414, in run_esphomeyaml
    return PRE_CONFIG_ACTIONS[args.command](args)
  File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/__main__.py", line 318, in command_dashboard
    from esphomeyaml.dashboard import dashboard
  File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/dashboard/dashboard.py", line 30, in <module>
    class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
NameError: name 'tornado' is not defined

Works fine after installing tornado.

OttoWinter commented 6 years ago

That was quick :)

And yes, I forgot to put that in the changelog notes. The Getting started guide had that in there: https://esphomelib.com/esphomeyaml/guides/getting_started_command_line.html#bonus-esphomeyaml-dashboard

(The reason I didn't put tornado into the setup.py requirements is that it's quite a big dependency and not part of the "core" esphomeyaml - only a UI extension for now)

brandond commented 6 years ago

Ahh, OK, Maybe catch an ImportError and print a nice warning rather than throwing a stack trace, for those of us that just read the release notes and don't go back to the docs?

OttoWinter commented 6 years ago

I updated the release notes too, so that shoudn't hopefully be a problem. But I think you're right that it would be good to do a try except import 👍