{"action":"created","comment":{"url":"https://api.github.com/repos/balloob/home-assistant/pulls/comments/53579416","id":53579416,"diff_hunk":"@@ -120,6 +120,10 @@ def assumed_state(self):\n         \"\"\"Return True if unable to access real state of entity.\"\"\"\n         return False\n \n+    def finalize_setup(self):","path":"homeassistant/helpers/entity.py","position":4,"original_position":4,"commit_id":"b34f34a5c097b479228a89fb8ba891c0fdbe018d","original_commit_id":"b34f34a5c097b479228a89fb8ba891c0fdbe018d","user":{"login":"balloob","id":1444314,"avatar_url":"https://avatars.githubusercontent.com/u/1444314?v=3","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"body":"I prefer to not add a method to get this done. Instead I would suggest a similar approach to the [Cast media player platform](https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/media_player/cast.py#L27) and keep track of the IDs or hosts of the platform that have been added and not add them again.","created_at":"2016-02-22T01:35:56Z","updated_at":"2016-02-22T01:35:56Z","html_url":"https://github.com/balloob/home-assistant/pull/1332#discussion_r53579416","pull_request_url":"https://api.github.com/repos/balloob/home-assistant/pulls/1332","_links":{"self":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/comments/53579416"},"html":{"href":"https://github.com/balloob/home-assistant/pull/1332#discussion_r53579416"},"pull_request":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/1332"}}},"pull_request":{"url":"https://api.github.com/repos/balloob/home-assistant/pulls/1332","id":59914717,"html_url":"https://github.com/balloob/home-assistant/pull/1332","diff_url":"https://github.com/balloob/home-assistant/pull/1332.diff","patch_url":"https://github.com/balloob/home-assistant/pull/1332.patch","issue_url":"https://api.github.com/repos/balloob/home-assistant/issues/1332","number":1332,"state":"open","locked":false,"title":"Wemo leds","user":{"login":"jaharkes","id":394722,"avatar_url":"https://avatars.githubusercontent.com/u/394722?v=3","gravatar_id":"","url":"https://api.github.com/users/jaharkes","html_url":"https://github.com/jaharkes","followers_url":"https://api.github.com/users/jaharkes/followers","following_url":"https://api.github.com/users/jaharkes/following{/other_user}","gists_url":"https://api.github.com/users/jaharkes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaharkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaharkes/subscriptions","organizations_url":"https://api.github.com/users/jaharkes/orgs","repos_url":"https://api.github.com/users/jaharkes/repos","events_url":"https://api.github.com/users/jaharkes/events{/privacy}","received_events_url":"https://api.github.com/users/jaharkes/received_events","type":"User","site_admin":false},"body":"My attempt at restructuring Wemo discovery (ref #1291)\r\n\r\nSome issues I know of,\r\n- May duplicate/collide with restructuring work on this same issue by @pavoni.\r\n- Uses the model name from discovery to dispatch discovered devices to switch.wemo or light.wemo platforms but I only have Wemo Leds and an Insight switch so the model name dispatch may not cover every switch model the existing code base supports.\r\n- I was not sure if it is acceptable to pass an initialized device over the hass message bus so this is passing just enough information (device config url and mac address) to 'rediscover' the device on the receiving end. If we can pass the device it would simplify the code a little more.\r\n- The Wemo lights are currently using polling instead of subscriptions to track their state.","created_at":"2016-02-19T07:42:25Z","updated_at":"2016-02-22T01:35:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c93560f9497fe9c07f84d7ad1bb72597029a2895","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/balloob/home-assistant/pulls/1332/commits","review_comments_url":"https://api.github.com/repos/balloob/home-assistant/pulls/1332/comments","review_comment_url":"https://api.github.com/repos/balloob/home-assistant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/balloob/home-assistant/issues/1332/comments","statuses_url":"https://api.github.com/repos/balloob/home-assistant/statuses/b34f34a5c097b479228a89fb8ba891c0fdbe018d","head":{"label":"jaharkes:wemo_leds","ref":"wemo_leds","sha":"b34f34a5c097b479228a89fb8ba891c0fdbe018d","user":{"login":"jaharkes","id":394722,"avatar_url":"https://avatars.githubusercontent.com/u/394722?v=3","gravatar_id":"","url":"https://api.github.com/users/jaharkes","html_url":"https://github.com/jaharkes","followers_url":"https://api.github.com/users/jaharkes/followers","following_url":"https://api.github.com/users/jaharkes/following{/other_user}","gists_url":"https://api.github.com/users/jaharkes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaharkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaharkes/subscriptions","organizations_url":"https://api.github.com/users/jaharkes/orgs","repos_url":"https://api.github.com/users/jaharkes/repos","events_url":"https://api.github.com/users/jaharkes/events{/privacy}","received_events_url":"https://api.github.com/users/jaharkes/received_events","type":"User","site_admin":false},"repo":{"id":51563872,"name":"home-assistant","full_name":"jaharkes/home-assistant","owner":{"login":"jaharkes","id":394722,"avatar_url":"https://avatars.githubusercontent.com/u/394722?v=3","gravatar_id":"","url":"https://api.github.com/users/jaharkes","html_url":"https://github.com/jaharkes","followers_url":"https://api.github.com/users/jaharkes/followers","following_url":"https://api.github.com/users/jaharkes/following{/other_user}","gists_url":"https://api.github.com/users/jaharkes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaharkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaharkes/subscriptions","organizations_url":"https://api.github.com/users/jaharkes/orgs","repos_url":"https://api.github.com/users/jaharkes/repos","events_url":"https://api.github.com/users/jaharkes/events{/privacy}","received_events_url":"https://api.github.com/users/jaharkes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaharkes/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/jaharkes/home-assistant","forks_url":"https://api.github.com/repos/jaharkes/home-assistant/forks","keys_url":"https://api.github.com/repos/jaharkes/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaharkes/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaharkes/home-assistant/teams","hooks_url":"https://api.github.com/repos/jaharkes/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/jaharkes/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/jaharkes/home-assistant/events","assignees_url":"https://api.github.com/repos/jaharkes/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/jaharkes/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/jaharkes/home-assistant/tags","blobs_url":"https://api.github.com/repos/jaharkes/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaharkes/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaharkes/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaharkes/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaharkes/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/jaharkes/home-assistant/languages","stargazers_url":"https://api.github.com/repos/jaharkes/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/jaharkes/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/jaharkes/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/jaharkes/home-assistant/subscription","commits_url":"https://api.github.com/repos/jaharkes/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaharkes/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaharkes/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaharkes/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaharkes/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/jaharkes/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaharkes/home-assistant/merges","archive_url":"https://api.github.com/repos/jaharkes/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaharkes/home-assistant/downloads","issues_url":"https://api.github.com/repos/jaharkes/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/jaharkes/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/jaharkes/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/jaharkes/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaharkes/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/jaharkes/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/jaharkes/home-assistant/deployments","created_at":"2016-02-12T02:57:52Z","updated_at":"2016-02-12T02:57:53Z","pushed_at":"2016-02-20T02:56:36Z","git_url":"git://github.com/jaharkes/home-assistant.git","ssh_url":"git@github.com:jaharkes/home-assistant.git","clone_url":"https://github.com/jaharkes/home-assistant.git","svn_url":"https://github.com/jaharkes/home-assistant","homepage":"https://home-assistant.io","size":42519,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"balloob:dev","ref":"dev","sha":"2d0721abe89ac819cb5cfe26be725989d637d7ed","user":{"login":"balloob","id":1444314,"avatar_url":"https://avatars.githubusercontent.com/u/1444314?v=3","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"repo":{"id":12888993,"name":"home-assistant","full_name":"balloob/home-assistant","owner":{"login":"balloob","id":1444314,"avatar_url":"https://avatars.githubusercontent.com/u/1444314?v=3","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balloob/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":false,"url":"https://api.github.com/repos/balloob/home-assistant","forks_url":"https://api.github.com/repos/balloob/home-assistant/forks","keys_url":"https://api.github.com/repos/balloob/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balloob/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balloob/home-assistant/teams","hooks_url":"https://api.github.com/repos/balloob/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/balloob/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/balloob/home-assistant/events","assignees_url":"https://api.github.com/repos/balloob/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/balloob/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/balloob/home-assistant/tags","blobs_url":"https://api.github.com/repos/balloob/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balloob/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balloob/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/balloob/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balloob/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/balloob/home-assistant/languages","stargazers_url":"https://api.github.com/repos/balloob/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/balloob/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/balloob/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/balloob/home-assistant/subscription","commits_url":"https://api.github.com/repos/balloob/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/balloob/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/balloob/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/balloob/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/balloob/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/balloob/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balloob/home-assistant/merges","archive_url":"https://api.github.com/repos/balloob/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balloob/home-assistant/downloads","issues_url":"https://api.github.com/repos/balloob/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/balloob/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/balloob/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/balloob/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balloob/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/balloob/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/balloob/home-assistant/deployments","created_at":"2013-09-17T07:29:48Z","updated_at":"2016-02-21T12:50:57Z","pushed_at":"2016-02-21T22:44:53Z","git_url":"git://github.com/balloob/home-assistant.git","ssh_url":"git@github.com:balloob/home-assistant.git","clone_url":"https://github.com/balloob/home-assistant.git","svn_url":"https://github.com/balloob/home-assistant","homepage":"https://home-assistant.io","size":45765,"stargazers_count":2758,"watchers_count":2758,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":456,"mirror_url":null,"open_issues_count":184,"forks":456,"open_issues":184,"watchers":2758,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/1332"},"html":{"href":"https://github.com/balloob/home-assistant/pull/1332"},"issue":{"href":"https://api.github.com/repos/balloob/home-assistant/issues/1332"},"comments":{"href":"https://api.github.com/repos/balloob/home-assistant/issues/1332/comments"},"review_comments":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/1332/comments"},"review_comment":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/1332/commits"},"statuses":{"href":"https://api.github.com/repos/balloob/home-assistant/statuses/b34f34a5c097b479228a89fb8ba891c0fdbe018d"}}}}