{"action":"created","issue":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/232","labels_url":"https://api.github.com/repos/balloob/home-assistant/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/balloob/home-assistant/issues/232/comments","events_url":"https://api.github.com/repos/balloob/home-assistant/issues/232/events","html_url":"https://github.com/balloob/home-assistant/issues/232","id":97406210,"number":232,"title":"Custom controls waiting to target controls with discovery turned on","user":{"login":"pavoni","id":4487313,"avatar_url":"https://avatars.githubusercontent.com/u/4487313?v=3","gravatar_id":"","url":"https://api.github.com/users/pavoni","html_url":"https://github.com/pavoni","followers_url":"https://api.github.com/users/pavoni/followers","following_url":"https://api.github.com/users/pavoni/following{/other_user}","gists_url":"https://api.github.com/users/pavoni/gists{/gist_id}","starred_url":"https://api.github.com/users/pavoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavoni/subscriptions","organizations_url":"https://api.github.com/users/pavoni/orgs","repos_url":"https://api.github.com/users/pavoni/repos","events_url":"https://api.github.com/users/pavoni/events{/privacy}","received_events_url":"https://api.github.com/users/pavoni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-27T07:56:49Z","updated_at":"2015-07-27T21:47:49Z","closed_at":null,"body":"I added a simple custom control over the weekend (it turns on my music sources (via a wemo switch) if one of two zone amplifiers is turned on - based on monitoring two wemo insignt switches).\r\n\r\nThe only area I found tricky was how to wait for the wemo devices to be discovered, by the discovery process. I got the control working by turning off discovery - a dependency on 'Group' as shown in the example.py code then works fine.\r\n\r\nIs there an easy way to wait for discovery, or even for named devices to be discovered? I tried adding the required devices into dependency - but couldn't get this to work.\r\n\r\nI guess you can watch the discovery process callbacks - although this seems challenging in a user written custom control.\r\n\r\nSorry if this is a newbie question."},"comment":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/comments/125351620","html_url":"https://github.com/balloob/home-assistant/issues/232#issuecomment-125351620","issue_url":"https://api.github.com/repos/balloob/home-assistant/issues/232","id":125351620,"user":{"login":"rmkraus","id":4956442,"avatar_url":"https://avatars.githubusercontent.com/u/4956442?v=3","gravatar_id":"","url":"https://api.github.com/users/rmkraus","html_url":"https://github.com/rmkraus","followers_url":"https://api.github.com/users/rmkraus/followers","following_url":"https://api.github.com/users/rmkraus/following{/other_user}","gists_url":"https://api.github.com/users/rmkraus/gists{/gist_id}","starred_url":"https://api.github.com/users/rmkraus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmkraus/subscriptions","organizations_url":"https://api.github.com/users/rmkraus/orgs","repos_url":"https://api.github.com/users/rmkraus/repos","events_url":"https://api.github.com/users/rmkraus/events{/privacy}","received_events_url":"https://api.github.com/users/rmkraus/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T21:47:49Z","updated_at":"2015-07-27T21:47:49Z","body":"from homeassistant.components import discovery\r\n\r\ndiscovery.listen(hass, 'belkin.wemo', my_fun)"}}