Skip to content

Remove sleeps.#5

Merged
OttoWinter merged 3 commits intoesphome:masterfrom
HeMan:remove_sleeps
Apr 11, 2018
Merged

Remove sleeps.#5
OttoWinter merged 3 commits intoesphome:masterfrom
HeMan:remove_sleeps

Conversation

@HeMan
Copy link
Contributor

@HeMan HeMan commented Apr 11, 2018

  • the sleeps is not needed.

@OttoWinter
Copy link
Member

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.

@HeMan
Copy link
Contributor Author

HeMan commented Apr 11, 2018

I added a environment variable called QUICKWIZARD that disables the sleeps.

Copy link
Member

@OttoWinter OttoWinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using environment variables is an excellent solution 👍

"""


if os.environ['QUICKWIZARD']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in a KeyError if QUICKWIZARD is not specified in the environment:

screen shot 2018-04-11 at 21 40 49

This should work:

if os.getenv('QUICKWIZARD', False):
    def sleep(time):
        pass
else:
    from time import sleep

Also, 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol! It shows how I tested it!

HeMan added 3 commits April 11, 2018 22:34
- 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.
Copy link
Member

@OttoWinter OttoWinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks 🐳👍

@OttoWinter OttoWinter merged commit 633d20d into esphome:master Apr 11, 2018
@esphome esphome locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants