Support receiving long-press events from WeMo devices (#45503)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
c65d120633
commit
61079ab7fa
12 changed files with 372 additions and 41 deletions
|
@ -40,11 +40,11 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
|
||||
async def _discovered_wemo(device):
|
||||
"""Handle a discovered Wemo device."""
|
||||
if device.model_name == "Dimmer":
|
||||
if device.wemo.model_name == "Dimmer":
|
||||
async_add_entities([WemoDimmer(device)])
|
||||
else:
|
||||
await hass.async_add_executor_job(
|
||||
setup_bridge, hass, device, async_add_entities
|
||||
setup_bridge, hass, device.wemo, async_add_entities
|
||||
)
|
||||
|
||||
async_dispatcher_connect(hass, f"{WEMO_DOMAIN}.light", _discovered_wemo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue