{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/193126963","pull_request_review_id":126037490,"id":193126963,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzEyNjk2Mw==","diff_hunk":"@@ -59,27 +65,105 @@ def setup(hass, config):\n                       device_ip, str(status[1]))\n         return False\n \n-    if config[DOMAIN].get(CONF_DOORBELL_EVENTS):\n+    # Get the URL of this server\n+    hass_url = hass.config.api.base_url\n+\n+    # Override it if another is specified in the component configuration\n+    if config[DOMAIN].get(CONF_CUSTOM_URL):\n+        hass_url = config[DOMAIN].get(CONF_CUSTOM_URL)\n+        _LOGGER.info(\"DoorBird will connect to this instance via %s\",\n+                     hass_url)\n+\n+    # Register for push notifications if enabled\n+    if config[DOMAIN].get(CONF_DOORBELL_EVENTS)\\\n+            or config[DOMAIN].get(CONF_MOTION_EVENTS):\n         # Provide an endpoint for the device to call to trigger events\n         hass.http.register_view(DoorbirdRequestView())\n \n-        # Get the URL of this server\n-        hass_url = hass.config.api.base_url\n+        # Create a new schedule (24/7)\n+        schedule = DoorBirdScheduleEntrySchedule()\n+        schedule.add_weekday(0, 604800)\n+\n+        # Register doorbell push schedule if enabled\n+        if config[DOMAIN].get(CONF_DOORBELL_EVENTS):\n+            doorbell_num = config[DOMAIN].get(CONF_DOORBELL_NUM, 1)\n+            register_sensor(hass_url, device, SENSOR_DOORBELL, schedule,\n+                            doorbell_num)\n \n-        # Override it if another is specified in the component configuration\n-        if config[DOMAIN].get(CONF_CUSTOM_URL):\n-            hass_url = config[DOMAIN].get(CONF_CUSTOM_URL)\n-            _LOGGER.info(\"DoorBird will connect to this instance via %s\",\n-                         hass_url)\n+        # Register motion push schedule if enabled\n+        if config[DOMAIN].get(CONF_MOTION_EVENTS):\n+            register_sensor(hass_url, device, SENSOR_MOTION, schedule)\n \n-        # This will make HA the only service that gets doorbell events\n-        url = '{}{}/{}'.format(hass_url, API_URL, SENSOR_DOORBELL)\n-        device.reset_notifications()\n-        device.subscribe_notification(SENSOR_DOORBELL, url)\n+    # Deregister doorbell pushes if not enabled","path":"homeassistant/components/doorbird.py","position":93,"original_position":90,"commit_id":"9f8b3ba0f5bce56b48237159e04acbfd0f9e2f4a","original_commit_id":"d33cffd733e7e21c4c1aa49113fab2c9932bea75","user":{"login":"MartinHjelmare","id":3181692,"node_id":"MDQ6VXNlcjMxODE2OTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3181692?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinHjelmare","html_url":"https://github.com/MartinHjelmare","followers_url":"https://api.github.com/users/MartinHjelmare/followers","following_url":"https://api.github.com/users/MartinHjelmare/following{/other_user}","gists_url":"https://api.github.com/users/MartinHjelmare/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinHjelmare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinHjelmare/subscriptions","organizations_url":"https://api.github.com/users/MartinHjelmare/orgs","repos_url":"https://api.github.com/users/MartinHjelmare/repos","events_url":"https://api.github.com/users/MartinHjelmare/events{/privacy}","received_events_url":"https://api.github.com/users/MartinHjelmare/received_events","type":"User","site_admin":false},"body":"Where are we registering the notifications?","created_at":"2018-06-05T15:53:51Z","updated_at":"2018-06-05T15:53:51Z","html_url":"https://github.com/home-assistant/home-assistant/pull/14800#discussion_r193126963","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/14800","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/193126963"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/14800#discussion_r193126963"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/14800"}},"in_reply_to_id":192984782},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/14800","id":192266233,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjY2MjMz","html_url":"https://github.com/home-assistant/home-assistant/pull/14800","diff_url":"https://github.com/home-assistant/home-assistant/pull/14800.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/14800.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/14800","number":14800,"state":"open","locked":false,"title":"Update to DoorBirdPy 2.0.2","user":{"login":"Klikini","id":1693960,"node_id":"MDQ6VXNlcjE2OTM5NjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1693960?v=4","gravatar_id":"","url":"https://api.github.com/users/Klikini","html_url":"https://github.com/Klikini","followers_url":"https://api.github.com/users/Klikini/followers","following_url":"https://api.github.com/users/Klikini/following{/other_user}","gists_url":"https://api.github.com/users/Klikini/gists{/gist_id}","starred_url":"https://api.github.com/users/Klikini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Klikini/subscriptions","organizations_url":"https://api.github.com/users/Klikini/orgs","repos_url":"https://api.github.com/users/Klikini/repos","events_url":"https://api.github.com/users/Klikini/events{/privacy}","received_events_url":"https://api.github.com/users/Klikini/received_events","type":"User","site_admin":false},"body":"## Description:\r\n\r\nUpdate to DoorBirdBy 2.0.2, which uses the new version (0.21) of the DoorBird LAN API.\r\n\r\n**Pull request in [home-assistant.github.io](https://github.com/home-assistant/home-assistant.github.io) with documentation:** home-assistant/home-assistant.github.io#5487\r\n\r\n## Checklist:\r\n  - [ ] The code change is tested and works locally.\r\n  - [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**\r\n\r\nIf user exposed functionality or configuration variables are added/changed:\r\n  - [x] Documentation added/updated in [home-assistant.github.io](https://github.com/home-assistant/home-assistant.github.io)\r\n\r\nIf the code communicates with devices, web services, or third-party tools:\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 or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.\r\n\r\n[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L14\r\n[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L54\r\n","created_at":"2018-06-03T20:40:18Z","updated_at":"2018-06-05T15:53:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fd63c424fa7ef29de38c2415f58dab6cf26ec92","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":527871105,"node_id":"MDU6TGFiZWw1Mjc4NzExMDU=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/cla-signed","name":"cla-signed","color":"008000","default":false},{"id":663049425,"node_id":"MDU6TGFiZWw2NjMwNDk0MjU=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/component:%20doorbird","name":"component: doorbird","color":"ededed","default":false},{"id":663049426,"node_id":"MDU6TGFiZWw2NjMwNDk0MjY=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/platform:%20switch.doorbird","name":"platform: switch.doorbird","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/14800/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/14800/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/14800/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/9f8b3ba0f5bce56b48237159e04acbfd0f9e2f4a","head":{"label":"Klikini:doorbird-v2","ref":"doorbird-v2","sha":"9f8b3ba0f5bce56b48237159e04acbfd0f9e2f4a","user":{"login":"Klikini","id":1693960,"node_id":"MDQ6VXNlcjE2OTM5NjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1693960?v=4","gravatar_id":"","url":"https://api.github.com/users/Klikini","html_url":"https://github.com/Klikini","followers_url":"https://api.github.com/users/Klikini/followers","following_url":"https://api.github.com/users/Klikini/following{/other_user}","gists_url":"https://api.github.com/users/Klikini/gists{/gist_id}","starred_url":"https://api.github.com/users/Klikini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Klikini/subscriptions","organizations_url":"https://api.github.com/users/Klikini/orgs","repos_url":"https://api.github.com/users/Klikini/repos","events_url":"https://api.github.com/users/Klikini/events{/privacy}","received_events_url":"https://api.github.com/users/Klikini/received_events","type":"User","site_admin":false},"repo":{"id":111588445,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE1ODg0NDU=","name":"home-assistant","full_name":"Klikini/home-assistant","owner":{"login":"Klikini","id":1693960,"node_id":"MDQ6VXNlcjE2OTM5NjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1693960?v=4","gravatar_id":"","url":"https://api.github.com/users/Klikini","html_url":"https://github.com/Klikini","followers_url":"https://api.github.com/users/Klikini/followers","following_url":"https://api.github.com/users/Klikini/following{/other_user}","gists_url":"https://api.github.com/users/Klikini/gists{/gist_id}","starred_url":"https://api.github.com/users/Klikini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Klikini/subscriptions","organizations_url":"https://api.github.com/users/Klikini/orgs","repos_url":"https://api.github.com/users/Klikini/repos","events_url":"https://api.github.com/users/Klikini/events{/privacy}","received_events_url":"https://api.github.com/users/Klikini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Klikini/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/Klikini/home-assistant","forks_url":"https://api.github.com/repos/Klikini/home-assistant/forks","keys_url":"https://api.github.com/repos/Klikini/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Klikini/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Klikini/home-assistant/teams","hooks_url":"https://api.github.com/repos/Klikini/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/Klikini/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/Klikini/home-assistant/events","assignees_url":"https://api.github.com/repos/Klikini/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/Klikini/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/Klikini/home-assistant/tags","blobs_url":"https://api.github.com/repos/Klikini/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Klikini/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Klikini/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/Klikini/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Klikini/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/Klikini/home-assistant/languages","stargazers_url":"https://api.github.com/repos/Klikini/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/Klikini/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/Klikini/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/Klikini/home-assistant/subscription","commits_url":"https://api.github.com/repos/Klikini/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/Klikini/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/Klikini/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/Klikini/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/Klikini/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/Klikini/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Klikini/home-assistant/merges","archive_url":"https://api.github.com/repos/Klikini/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Klikini/home-assistant/downloads","issues_url":"https://api.github.com/repos/Klikini/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/Klikini/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/Klikini/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/Klikini/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Klikini/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/Klikini/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/Klikini/home-assistant/deployments","created_at":"2017-11-21T18:51:33Z","updated_at":"2017-11-21T18:51:40Z","pushed_at":"2018-06-05T14:03:10Z","git_url":"git://github.com/Klikini/home-assistant.git","ssh_url":"git@github.com:Klikini/home-assistant.git","clone_url":"https://github.com/Klikini/home-assistant.git","svn_url":"https://github.com/Klikini/home-assistant","homepage":"https://home-assistant.io","size":82629,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"home-assistant:dev","ref":"dev","sha":"e370d523ec5051e3095313af79aa9ff52defe390","user":{"login":"home-assistant","id":13844975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODQ0OTc1","avatar_url":"https://avatars3.githubusercontent.com/u/13844975?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4ODk5Mw==","name":"home-assistant","full_name":"home-assistant/home-assistant","owner":{"login":"home-assistant","id":13844975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzODQ0OTc1","avatar_url":"https://avatars3.githubusercontent.com/u/13844975?v=4","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":"2018-06-05T14:50:39Z","pushed_at":"2018-06-05T15:38:13Z","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":82821,"stargazers_count":14619,"watchers_count":14619,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4338,"mirror_url":null,"archived":false,"open_issues_count":804,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4338,"open_issues":804,"watchers":14619,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/14800"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/14800"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/14800"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/14800/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/14800/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/14800/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant/statuses/9f8b3ba0f5bce56b48237159e04acbfd0f9e2f4a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"MartinHjelmare"}}