Async syntax 4/8 (#17018)
* Async syntax 4, media_player & notify * Pylint fixes
This commit is contained in:
1 parent
3b5e5cbcd6
commit
134eeecd65
17 files changed
+212
-314
No files matched your search
@@ -41,8 +41,7 @@ def update(input_dict, update_source):
|
||||
return input_dict
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_get_service(hass, config, discovery_info=None):
|
||||
async def async_get_service(hass, config, discovery_info=None):
|
||||
"""Get the Group notification service."""
|
||||
return GroupNotifyPlatform(hass, config.get(CONF_SERVICES))
|
||||
|
||||
@@ -55,8 +54,7 @@ class GroupNotifyPlatform(BaseNotificationService):
|
||||
self.hass = hass
|
||||
self.entities = entities
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_send_message(self, message="", **kwargs):
|
||||
async def async_send_message(self, message="", **kwargs):
|
||||
"""Send message to all entities in the group."""
|
||||
payload = {ATTR_MESSAGE: message}
|
||||
payload.update({key: val for key, val in kwargs.items() if val})
|
||||
@@ -70,4 +68,4 @@ class GroupNotifyPlatform(BaseNotificationService):
|
||||
DOMAIN, entity.get(ATTR_SERVICE), sending_payload))
|
||||
|
||||
if tasks:
|
||||
yield from asyncio.wait(tasks, loop=self.hass.loop)
|
||||
await asyncio.wait(tasks, loop=self.hass.loop)
|
||||
Reference in new issue
Block a user