Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't pass in loop #23984

Merged
merged 8 commits into from May 23, 2019
Merged

Don't pass in loop #23984

merged 8 commits into from May 23, 2019

Conversation

balloob
Copy link
Member

@balloob balloob commented May 19, 2019

Description:

First pass removing passing loop around.

Related issue (if applicable): home-assistant/architecture#238

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@Swamp-Ig
Copy link
Contributor

Better regexp: (, )?loop=(self\.)?hass.loop[^\)]

Pretty much all the ones that aren't the last argument are to external libraries.

There's a few calls to the async_.py that need the loop parameter since they're running stuff on the loop from outside it. I will stop playing with this now!

@balloob balloob merged commit f995ab9 into dev May 23, 2019
@delete-merged-branch delete-merged-branch bot deleted the no-passing-loop branch May 23, 2019 04:10
else:
reader_factory = partial(
create_dsmr_reader, config[CONF_PORT], config[CONF_DSMR_VERSION],
update_entities_telegram, loop=hass.loop)
Copy link
Contributor

Choose a reason for hiding this comment

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

This breaks the dsmr module. Should this be replaced with loop=asyncio.get_event_loop()?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll revert it, my bad.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Reinstating this should be a temporary fix. The loop argument should always be optional (since it's going to go away anyway).

Copy link
Contributor

Choose a reason for hiding this comment

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

@smurfix: it's actually caused by an upstream bug, as soon as that's fixed we can fix this properly: ndokter/dsmr_parser#36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants