Improve handling of no upload option

Fixes https://github.com/esphome/issues/issues/596
This commit is contained in:
Otto Winter 2019-08-27 22:00:34 +02:00
parent 5348b36a7c
commit ccf3da2a5a
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E

View file

@ -35,7 +35,9 @@ def get_serial_ports():
def choose_prompt(options): def choose_prompt(options):
if not options: if not options:
raise ValueError raise EsphomeError("Found no valid options for upload/logging, please make sure relevant "
"sections (ota, mqtt, ...) are in your configuration and/or the device "
"is plugged in.")
if len(options) == 1: if len(options) == 1:
return options[0][1] return options[0][1]