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

@@ -21,11 +21,12 @@ SENSORS = {
}
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the MySensors platform for binary sensors."""
async def async_setup_platform(
hass, config, async_add_devices, discovery_info=None):
"""Set up the mysensors platform for binary sensors."""
mysensors.setup_mysensors_platform(
hass, DOMAIN, discovery_info, MySensorsBinarySensor,
add_devices=add_devices)
async_add_devices=async_add_devices)
class MySensorsBinarySensor(mysensors.MySensorsEntity, BinarySensorDevice):