{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/108573345","pull_request_review_id":29613040,"id":108573345,"diff_hunk":"@@ -118,6 +122,21 @@ def _zm_request(method, api_url, data=None):\n                           'decode \"%s\"', req.text)\n \n \n+def zm_trigger(monitor, state, cause, duration):\n+    \"\"\"Attempt to connect over TCP socket and trigger recording.\"\"\"\n+    import socket\n+    sock = socket.socket()\n+    try:\n+        sock.connect((ZM['host'], ZM['trigger_port']))\n+        command = '{:d}|{:s}'.format(monitor, state)\n+        if state in 'on':\n+            command += \"+{:d}|1|{:s}|{:s}\".format(duration, cause, cause)\n+        sock.sendall(command.encode())\n+    except socket.error as sock_err:\n+        _LOGGER.exception('Connect failed (%s), is OPT_TRIGGERS enabled?', sock_err)","path":"homeassistant/components/zoneminder.py","position":40,"original_position":40,"commit_id":"7caaa6096ae81b1c1534aaae906c40f1fbafce20","original_commit_id":"7caaa6096ae81b1c1534aaae906c40f1fbafce20","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"line too long (84 > 79 characters)","created_at":"2017-03-29T01:09:16Z","updated_at":"2017-03-29T01:09:16Z","html_url":"https://github.com/home-assistant/home-assistant/pull/6836#discussion_r108573345","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/6836","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/108573345"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/6836#discussion_r108573345"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/6836"}}},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/6836","id":113088981,"html_url":"https://github.com/home-assistant/home-assistant/pull/6836","diff_url":"https://github.com/home-assistant/home-assistant/pull/6836.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/6836.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/6836","number":6836,"state":"open","locked":false,"title":"Implement optional External trigger for ZoneMinder switch","user":{"login":"anpetrov","id":2647181,"avatar_url":"https://avatars2.githubusercontent.com/u/2647181?v=3","gravatar_id":"","url":"https://api.github.com/users/anpetrov","html_url":"https://github.com/anpetrov","followers_url":"https://api.github.com/users/anpetrov/followers","following_url":"https://api.github.com/users/anpetrov/following{/other_user}","gists_url":"https://api.github.com/users/anpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/anpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anpetrov/subscriptions","organizations_url":"https://api.github.com/users/anpetrov/orgs","repos_url":"https://api.github.com/users/anpetrov/repos","events_url":"https://api.github.com/users/anpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/anpetrov/received_events","type":"User","site_admin":false},"body":"Currently ZoneMinder switch allows triggering recording by switching\r\nmonitor state. Unfortunately changing monitor state over web API seem\r\nto be really slow, because some cameras require long warm-up periods.\r\nAs result if you get substantial delay and might even miss an event\r\nthat was associated with the trigger. Fortunately ZM provides 'Nodect'\r\nmonitor mode where camera is kept warm and it can start recording\r\nimmediately. This way you will have a chance to see how your S.W.A.T\r\nteam actually captures the imaginary invader approaching your nuclear\r\nfacility monitored by homeassistant+zoneminder.\r\n\r\nSigned-off-by: Andrey Petrov <andrey.petrov@gmail.com>\r\n\r\n## Description:\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#2350>\r\n\r\n## Example entry for `configuration.yaml` (if applicable):\r\n```yaml\r\n<see documentation PR>\r\n```\r\n\r\n## Checklist:\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  - [ ] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [ ] 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  - [ ] New dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.\r\n  - [ ] 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[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":"2017-03-28T23:30:11Z","updated_at":"2017-03-29T01:09:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0be9eba86bbc2a8b1dafea3d49e9efb2cccfe844","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/6836/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/6836/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/6836/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/7caaa6096ae81b1c1534aaae906c40f1fbafce20","head":{"label":"anpetrov:dev","ref":"dev","sha":"7caaa6096ae81b1c1534aaae906c40f1fbafce20","user":{"login":"anpetrov","id":2647181,"avatar_url":"https://avatars2.githubusercontent.com/u/2647181?v=3","gravatar_id":"","url":"https://api.github.com/users/anpetrov","html_url":"https://github.com/anpetrov","followers_url":"https://api.github.com/users/anpetrov/followers","following_url":"https://api.github.com/users/anpetrov/following{/other_user}","gists_url":"https://api.github.com/users/anpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/anpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anpetrov/subscriptions","organizations_url":"https://api.github.com/users/anpetrov/orgs","repos_url":"https://api.github.com/users/anpetrov/repos","events_url":"https://api.github.com/users/anpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/anpetrov/received_events","type":"User","site_admin":false},"repo":{"id":78088008,"name":"home-assistant","full_name":"anpetrov/home-assistant","owner":{"login":"anpetrov","id":2647181,"avatar_url":"https://avatars2.githubusercontent.com/u/2647181?v=3","gravatar_id":"","url":"https://api.github.com/users/anpetrov","html_url":"https://github.com/anpetrov","followers_url":"https://api.github.com/users/anpetrov/followers","following_url":"https://api.github.com/users/anpetrov/following{/other_user}","gists_url":"https://api.github.com/users/anpetrov/gists{/gist_id}","starred_url":"https://api.github.com/users/anpetrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anpetrov/subscriptions","organizations_url":"https://api.github.com/users/anpetrov/orgs","repos_url":"https://api.github.com/users/anpetrov/repos","events_url":"https://api.github.com/users/anpetrov/events{/privacy}","received_events_url":"https://api.github.com/users/anpetrov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anpetrov/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/anpetrov/home-assistant","forks_url":"https://api.github.com/repos/anpetrov/home-assistant/forks","keys_url":"https://api.github.com/repos/anpetrov/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anpetrov/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anpetrov/home-assistant/teams","hooks_url":"https://api.github.com/repos/anpetrov/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/anpetrov/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/anpetrov/home-assistant/events","assignees_url":"https://api.github.com/repos/anpetrov/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/anpetrov/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/anpetrov/home-assistant/tags","blobs_url":"https://api.github.com/repos/anpetrov/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anpetrov/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anpetrov/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/anpetrov/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anpetrov/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/anpetrov/home-assistant/languages","stargazers_url":"https://api.github.com/repos/anpetrov/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/anpetrov/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/anpetrov/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/anpetrov/home-assistant/subscription","commits_url":"https://api.github.com/repos/anpetrov/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/anpetrov/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/anpetrov/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/anpetrov/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/anpetrov/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/anpetrov/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anpetrov/home-assistant/merges","archive_url":"https://api.github.com/repos/anpetrov/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anpetrov/home-assistant/downloads","issues_url":"https://api.github.com/repos/anpetrov/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/anpetrov/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/anpetrov/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/anpetrov/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anpetrov/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/anpetrov/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/anpetrov/home-assistant/deployments","created_at":"2017-01-05T06:54:26Z","updated_at":"2017-01-05T06:54:32Z","pushed_at":"2017-03-29T01:09:07Z","git_url":"git://github.com/anpetrov/home-assistant.git","ssh_url":"git@github.com:anpetrov/home-assistant.git","clone_url":"https://github.com/anpetrov/home-assistant.git","svn_url":"https://github.com/anpetrov/home-assistant","homepage":"https://home-assistant.io","size":56110,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"home-assistant:dev","ref":"dev","sha":"fb8323f48d576341310ba878d281d00cd1e57043","user":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars0.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://avatars0.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":"2017-03-28T20:31:51Z","pushed_at":"2017-03-29T01:09:09Z","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":56109,"stargazers_count":6290,"watchers_count":6290,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1835,"mirror_url":null,"open_issues_count":454,"forks":1835,"open_issues":454,"watchers":6290,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/6836"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/6836"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/6836"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/6836/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/6836/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/6836/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant/statuses/7caaa6096ae81b1c1534aaae906c40f1fbafce20"}}}}
{"actor":{"display_login":"houndci-bot"}}