Remove sleeps.#5
Conversation
HeMan
commented
Apr 11, 2018
- the sleeps is not needed.
|
I mean the sleeps have no use code-wise, they were solely intended to make the wizard feel a bit more "interactive" and a bit more like an actual wizard or actual person. The aim was to make the onboarding experience as friendly as possible. Of course the drawback of these sleeps is that going through the wizard is a bit slower. However, I think that nobody's going to go through the wizard more than say 5 times anyway. Maybe the sleep periods are a bit too long, but in general it's nicer to have the text appear in succession and not have a wizard that just starts with a huge text blob that you have to parse through first. Don't get me wrong, I'm also kind of on the edge of having these sleeps in the wizard or not, but ATM I think they're actually good. I'm open to suggestions/reasons why they should not be there though. |
|
I added a environment variable called QUICKWIZARD that disables the sleeps. |
OttoWinter
left a comment
There was a problem hiding this comment.
Using environment variables is an excellent solution 👍
esphomeyaml/wizard.py
Outdated
| """ | ||
|
|
||
|
|
||
| if os.environ['QUICKWIZARD']: |
There was a problem hiding this comment.
This results in a KeyError if QUICKWIZARD is not specified in the environment:
This should work:
if os.getenv('QUICKWIZARD', False):
def sleep(time):
pass
else:
from time import sleepAlso, I mean I don't really care, but the other environment variable I've defined for OTAs, ESPHOMEYAML_OTA_HOST_PORT, has the prefix ESPHOMEYAML_ so I'd prefer if this environment variable would also start with that prefix for consistency.
There was a problem hiding this comment.
Lol! It shows how I tested it!
- the sleeps is not needed.
- set QUICKWIZARD to true to disable sleeps.
- It only worked when environment variable was defined. Now it works with variable unset, which should be the normal case. - Added ESPHOMEYAML_ as prefix so it's ESPHOMEYAML_QUICKWIZARD.
