Fix events so they work with multiple devices (#22477)

This commit is contained in:
Robert Svensson authored and Paulus Schoutsen committed 2019-03-27 19:54:27 -07:00
1 parent d13c892b28
commit 8f3434c2ab
2 files changed
+8 -3

No files matched your search

@@ -24,8 +24,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Add binary sensor from Axis device."""
async_add_entities([AxisBinarySensor(event, device)], True)
device.listeners.append(
async_dispatcher_connect(hass, 'axis_add_sensor', async_add_sensor))
device.listeners.append(async_dispatcher_connect(
hass, device.event_new_sensor, async_add_sensor))
class AxisBinarySensor(BinarySensorDevice):