Skip to content

Commit

Permalink
fix: load found devices when load delay required
Browse files Browse the repository at this point in the history
fixes #552
  • Loading branch information
alandtse committed Feb 9, 2020
1 parent dd03b88 commit 0157ebe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/alexa_media/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ async def async_setup_platform(hass, config, add_devices_callback, discovery_inf
hide_email(account),
hide_serial(key),
)
if devices:
await add_devices(
hide_email(account),
devices,
add_devices_callback,
include_filter,
exclude_filter,
)
return False
if key not in (account_dict["entities"]["sensor"]):
(account_dict["entities"]["sensor"][key]) = {}
Expand Down
8 changes: 8 additions & 0 deletions custom_components/alexa_media/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ async def async_setup_platform(hass, config, add_devices_callback, discovery_inf
hide_email(account),
hide_serial(key),
)
if devices:
await add_devices(
hide_email(account),
devices,
add_devices_callback,
include_filter,
exclude_filter,
)
return False
if key not in (
hass.data[DATA_ALEXAMEDIA]["accounts"][account]["entities"]["switch"]
Expand Down

0 comments on commit 0157ebe

Please sign in to comment.