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:
Martin Hjelmare authored and Paulus Schoutsen committed 2018-04-01 08:36:26 -07:00
1 parent ff9f500c51
commit c8f2810fac
9 files changed
+65 -57

No files matched your search

+4 -2
View File
@@ -34,10 +34,12 @@ SENSORS = {
}
def setup_platform(hass, config, add_devices, discovery_info=None):
async def async_setup_platform(
hass, config, async_add_devices, discovery_info=None):
"""Set up the MySensors platform for sensors."""
mysensors.setup_mysensors_platform(
hass, DOMAIN, discovery_info, MySensorsSensor, add_devices=add_devices)
hass, DOMAIN, discovery_info, MySensorsSensor,
async_add_devices=async_add_devices)
class MySensorsSensor(mysensors.MySensorsEntity):