Make mysensors updates and platform setup async (#13603)
* Use async updates but keep methods that interact with mysensors gateway thread, eg turn_on and turn_off, non async. * Use Python 3.5 async syntax.
This commit is contained in:
1 parent
ff9f500c51
commit
c8f2810fac
9 files changed
+65
-57
No files matched your search
@@ -9,12 +9,12 @@ from homeassistant.components.notify import (
|
||||
ATTR_TARGET, DOMAIN, BaseNotificationService)
|
||||
|
||||
|
||||
def get_service(hass, config, discovery_info=None):
|
||||
async def async_get_service(hass, config, discovery_info=None):
|
||||
"""Get the MySensors notification service."""
|
||||
new_devices = mysensors.setup_mysensors_platform(
|
||||
hass, DOMAIN, discovery_info, MySensorsNotificationDevice)
|
||||
if not new_devices:
|
||||
return
|
||||
return None
|
||||
return MySensorsNotificationService(hass)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user