8000 Removing asyncio.coroutine syntax from some components by Julius2342 · Pull Request #12507 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Removing asyncio.coroutine syntax from some components #12507

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

Merged
merged 5 commits into from
Feb 24, 2018

Conversation

Julius2342
Copy link
Contributor

Description:

HASS is about to deprecate python3.4. Yay!

We therefore may get rid of the ugly asyncio.coroutine syntax.

Within this PR i will add more and more components with the new async def and await syntax.

@Julius2342 Julius2342 requested a review from a team as a code owner February 18, 2018 19:53
self.exposures.append(exposure)

async def telegram_received_cb(self, telegram):
>>>>>>> 2995813... Removing asyncio.coroutine syntax (first steps)

Choose a reason for hiding this comment

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

expected an indented block
missing whitespace around operator
whitespace before '('

@asyncio.coroutine
def telegram_received_cb(self, telegram):
=======
@callback

Choose a reason for hiding this comment

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

unexpected indentation

@asyncio.coroutine
def telegram_received_cb(self, telegram):
=======

Choose a reason for hiding this comment

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

expected an indented block
missing whitespace around operator

@@ -202,8 +204,32 @@ def register_callbacks(self):
self.xknx.telegram_queue.register_telegram_received_cb(
self.telegram_received_cb, address_filters)

<<<<<<< HEAD

Choose a reason for hiding this comment

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

expected 2 blank lines after class or function definition, found 1
missing whitespace around bitwise or shift operator
missing whitespace around operator

=======
hass.data[DATA_KNX].async_create_exposures()
await hass.data[DATA_KNX].start()
>>>>>>> 2995813... Removing asyncio.coroutine syntax (first steps)

Choose a reason for hiding this comment

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

missing whitespace around operator
whitespace before '('

yield from hass.data[DATA_KNX].start()
=======
hass.data[DATA_KNX].async_create_exposures()

Choose a reason for hiding this comment

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

unexpected indentation

yield from hass.data[DATA_KNX].start()
=======

Choose a reason for hiding this comment

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

missing whitespace around operator

"""Set up the KNX component."""
from xknx.exceptions import XKNXException
try:
hass.data[DATA_KNX] = KNXModule(hass, config)
<<<<<<< HEAD

Choose a reason for hiding this comment

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

IndentationError: unexpected unindent
missing whitespace around bitwise or shift operator
missing whitespace around operator

@balloob
Copy link
Member
balloob commented Feb 18, 2018

We should first do core, helpers, util (if any). Then let's look at entity components like light/__init__.py etc.

Also, anything that will be merged between now and wednesday will cause you a merge conflict. I am excited too but I suggest to hold off till after the branch has been cut.

@Julius2342
Copy link
Contributor Author

The work here was done by a script (with 2 manual pylint adoptions) - so i'm not disappointed if we throw it away.

I will try out the script on some core libraries tomorrow and see what travis thinks about it :)

@Julius2342 Julius2342 changed the title [WIP] Removing asyncio.coroutine syntax (first steps) [WIP] Removing asyncio.coroutine syntax from some components Feb 18, 2018
@Julius2342 Julius2342 changed the title [WIP] Removing asyncio.coroutine syntax from some components Removing asyncio.coroutine syntax from some components Feb 23, 2018
@@ -53,8 +52,8 @@
})


@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
async def async_setup_platform(hass, config, async_add_devices,
Copy link
Member

Choose a reason for hiding this comment

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

There is no test for KNX, did you test this locally?

@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices,
discovery_info=None):
async def async_setup_platform(hass, config, async_add_devices,
Copy link
Member

Choose a reason for hiding this comment

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

Did you test this locally?

@balloob balloob merged commit 3713dfe into home-assistant:dev Feb 24, 2018
@Julius2342 Julius2342 deleted the asyncio branch February 25, 2018 14:15
@balloob balloob mentioned this pull request Mar 9, 2018
@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0