{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/59898480","id":59898480,"diff_hunk":"@@ -191,7 +191,11 @@ def see(self, mac=None, dev_id=None, host_name=None, location_name=None,\n                 mac = mac.upper()\n                 device = self.mac_to_dev.get(mac)\n                 if not device:\n-                    dev_id = util.slugify(host_name or '') or util.slugify(mac)\n+                    if not dev_id:","path":"homeassistant/components/device_tracker/__init__.py","position":5,"original_position":5,"commit_id":"c2b68959a7e65acbd662940b50cd4e2b74987a2a","original_commit_id":"c2b68959a7e65acbd662940b50cd4e2b74987a2a","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":"There is a reason we have this construct that you're removing, it's so we have a fallback which is now lost if a dev_id is passed in. Do this instead:\r\n```python\r\ndev_id = util.slugify(dev_id or host_name or '') or util.slugify(mac)\r\n```","created_at":"2016-04-15T16:06:22Z","updated_at":"2016-04-15T16:06:22Z","html_url":"https://github.com/home-assistant/home-assistant/pull/1830#discussion_r59898480","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/59898480"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/1830#discussion_r59898480"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830"}}},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830","id":66601178,"html_url":"https://github.com/home-assistant/home-assistant/pull/1830","diff_url":"https://github.com/home-assistant/home-assistant/pull/1830.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/1830.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/1830","number":1830,"state":"open","locked":false,"title":"Add bluetooth device tracker","user":{"login":"vmulpuru","id":3836007,"avatar_url":"https://avatars.githubusercontent.com/u/3836007?v=3","gravatar_id":"","url":"https://api.github.com/users/vmulpuru","html_url":"https://github.com/vmulpuru","followers_url":"https://api.github.com/users/vmulpuru/followers","following_url":"https://api.github.com/users/vmulpuru/following{/other_user}","gists_url":"https://api.github.com/users/vmulpuru/gists{/gist_id}","starred_url":"https://api.github.com/users/vmulpuru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmulpuru/subscriptions","organizations_url":"https://api.github.com/users/vmulpuru/orgs","repos_url":"https://api.github.com/users/vmulpuru/repos","events_url":"https://api.github.com/users/vmulpuru/events{/privacy}","received_events_url":"https://api.github.com/users/vmulpuru/received_events","type":"User","site_admin":false},"body":"**Description:**\r\nThis tracker discovers new devices on boot and tracks bluetooth devices\r\nperiodically based on interval_seconds value. Devices discovered are\r\nstored with 'bt_' as the prefix for device id.\r\n\r\nRequires PyBluez\r\n\r\n**Related issue (if applicable):** #\r\n\r\n**Example entry for `configuration.yaml` (if applicable):**\r\n```yaml\r\ndevice_tracker:\r\n  platform: bluetooth_tracker\r\n  track_new_devices: true\r\n  interval_seconds: 60\r\n  consider_home: 180\r\n```\r\n\r\n**Checklist:**\r\n\r\nIf code communicates with devices:\r\n  - [x ] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [x ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).\r\n  - [x ] New dependencies are only imported inside functions that use them ([example][ex-import]).\r\n  - [ x] New dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.\r\n  - [x ] New files were added to `.coveragerc`.\r\n\r\nIf the code does not interact with devices:\r\n  - [ ] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [ ] Tests have been added to verify that the new code works.\r\n\r\n[fork]: http://stackoverflow.com/a/7244456\r\n[squash]: https://github.com/ginatrapani/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit\r\n[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L16\r\n[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L51\r\n\r\n\r\nThis tracker discovers new devices on boot and tracks bluetooth devices\r\nperiodically based on interval_seconds value. Devices discovered are\r\nstored with 'bt_' as the prefix for device id.\r\n\r\nRequires PyBluez","created_at":"2016-04-15T07:32:12Z","updated_at":"2016-04-15T16:06:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5be1b9902bd977160071c74ec2e61eee12aa3a0f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830/comments","review_comment_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/1830/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/c2b68959a7e65acbd662940b50cd4e2b74987a2a","head":{"label":"vmulpuru:bluetooth_tracker","ref":"bluetooth_tracker","sha":"c2b68959a7e65acbd662940b50cd4e2b74987a2a","user":{"login":"vmulpuru","id":3836007,"avatar_url":"https://avatars.githubusercontent.com/u/3836007?v=3","gravatar_id":"","url":"https://api.github.com/users/vmulpuru","html_url":"https://github.com/vmulpuru","followers_url":"https://api.github.com/users/vmulpuru/followers","following_url":"https://api.github.com/users/vmulpuru/following{/other_user}","gists_url":"https://api.github.com/users/vmulpuru/gists{/gist_id}","starred_url":"https://api.github.com/users/vmulpuru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmulpuru/subscriptions","organizations_url":"https://api.github.com/users/vmulpuru/orgs","repos_url":"https://api.github.com/users/vmulpuru/repos","events_url":"https://api.github.com/users/vmulpuru/events{/privacy}","received_events_url":"https://api.github.com/users/vmulpuru/received_events","type":"User","site_admin":false},"repo":{"id":56217420,"name":"home-assistant","full_name":"vmulpuru/home-assistant","owner":{"login":"vmulpuru","id":3836007,"avatar_url":"https://avatars.githubusercontent.com/u/3836007?v=3","gravatar_id":"","url":"https://api.github.com/users/vmulpuru","html_url":"https://github.com/vmulpuru","followers_url":"https://api.github.com/users/vmulpuru/followers","following_url":"https://api.github.com/users/vmulpuru/following{/other_user}","gists_url":"https://api.github.com/users/vmulpuru/gists{/gist_id}","starred_url":"https://api.github.com/users/vmulpuru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmulpuru/subscriptions","organizations_url":"https://api.github.com/users/vmulpuru/orgs","repos_url":"https://api.github.com/users/vmulpuru/repos","events_url":"https://api.github.com/users/vmulpuru/events{/privacy}","received_events_url":"https://api.github.com/users/vmulpuru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vmulpuru/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/vmulpuru/home-assistant","forks_url":"https://api.github.com/repos/vmulpuru/home-assistant/forks","keys_url":"https://api.github.com/repos/vmulpuru/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmulpuru/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmulpuru/home-assistant/teams","hooks_url":"https://api.github.com/repos/vmulpuru/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/vmulpuru/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/vmulpuru/home-assistant/events","assignees_url":"https://api.github.com/repos/vmulpuru/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/vmulpuru/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/vmulpuru/home-assistant/tags","blobs_url":"https://api.github.com/repos/vmulpuru/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmulpuru/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmulpuru/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmulpuru/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmulpuru/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/vmulpuru/home-assistant/languages","stargazers_url":"https://api.github.com/repos/vmulpuru/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/vmulpuru/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/vmulpuru/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/vmulpuru/home-assistant/subscription","commits_url":"https://api.github.com/repos/vmulpuru/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmulpuru/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmulpuru/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmulpuru/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmulpuru/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/vmulpuru/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmulpuru/home-assistant/merges","archive_url":"https://api.github.com/repos/vmulpuru/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmulpuru/home-assistant/downloads","issues_url":"https://api.github.com/repos/vmulpuru/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/vmulpuru/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/vmulpuru/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/vmulpuru/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmulpuru/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/vmulpuru/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/vmulpuru/home-assistant/deployments","created_at":"2016-04-14T07:42:42Z","updated_at":"2016-04-14T07:42:44Z","pushed_at":"2016-04-15T07:27:44Z","git_url":"git://github.com/vmulpuru/home-assistant.git","ssh_url":"git@github.com:vmulpuru/home-assistant.git","clone_url":"https://github.com/vmulpuru/home-assistant.git","svn_url":"https://github.com/vmulpuru/home-assistant","homepage":"https://home-assistant.io","size":54650,"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":"home-assistant:dev","ref":"dev","sha":"e7520ef401ba5874f2110f9106223e31fd601032","user":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars.githubusercontent.com/u/13844975?v=3","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"repo":{"id":12888993,"name":"home-assistant","full_name":"home-assistant/home-assistant","owner":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars.githubusercontent.com/u/13844975?v=3","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/home-assistant/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":false,"url":"https://api.github.com/repos/home-assistant/home-assistant","forks_url":"https://api.github.com/repos/home-assistant/home-assistant/forks","keys_url":"https://api.github.com/repos/home-assistant/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/home-assistant/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/home-assistant/home-assistant/teams","hooks_url":"https://api.github.com/repos/home-assistant/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/home-assistant/home-assistant/events","assignees_url":"https://api.github.com/repos/home-assistant/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/home-assistant/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/home-assistant/home-assistant/tags","blobs_url":"https://api.github.com/repos/home-assistant/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/home-assistant/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/home-assistant/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/home-assistant/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/home-assistant/home-assistant/languages","stargazers_url":"https://api.github.com/repos/home-assistant/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/home-assistant/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/home-assistant/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/home-assistant/home-assistant/subscription","commits_url":"https://api.github.com/repos/home-assistant/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/home-assistant/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/home-assistant/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/home-assistant/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/home-assistant/home-assistant/merges","archive_url":"https://api.github.com/repos/home-assistant/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/home-assistant/home-assistant/downloads","issues_url":"https://api.github.com/repos/home-assistant/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/home-assistant/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/home-assistant/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/home-assistant/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/home-assistant/home-assistant/deployments","created_at":"2013-09-17T07:29:48Z","updated_at":"2016-04-15T13:41:07Z","pushed_at":"2016-04-15T10:03:26Z","git_url":"git://github.com/home-assistant/home-assistant.git","ssh_url":"git@github.com:home-assistant/home-assistant.git","clone_url":"https://github.com/home-assistant/home-assistant.git","svn_url":"https://github.com/home-assistant/home-assistant","homepage":"https://home-assistant.io","size":56124,"stargazers_count":3172,"watchers_count":3172,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":595,"mirror_url":null,"open_issues_count":133,"forks":595,"open_issues":133,"watchers":3172,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/1830"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/1830"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/1830/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830/comments"},"review_comment":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1830/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant/statuses/c2b68959a7e65acbd662940b50cd4e2b74987a2a"}}}}