Make mysensors component async (#13641)

* Make mysensors component async

* Use async dispatcher and discovery.
* Run I/O in executor.
* Make mysensors actuator methods async.
* Upgrade pymysensors to 0.13.0.
* Use async serial gateway.
* Use async TCP gateway.
* Use async mqtt gateway.

* Start gateway before hass start event

* Make sure gateway is started after discovery of persistent devices
  and after corresponding platforms have been loaded.
* Don't wait to start gateway until after hass start.

* Bump pymysensors to 0.14.0
This commit is contained in:
Martin Hjelmare 2018-05-11 09:39:18 +02:00 committed by GitHub
parent ef8fc1f201
commit be3b227a87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 110 additions and 80 deletions

View file

@ -42,7 +42,7 @@ class MySensorsNotificationService(BaseNotificationService):
"""Initialize the service."""
self.devices = mysensors.get_mysensors_devices(hass, DOMAIN)
def send_message(self, message="", **kwargs):
async def async_send_message(self, message="", **kwargs):
"""Send a message to a user."""
target_devices = kwargs.get(ATTR_TARGET)
devices = [device for device in self.devices.values()