{"action":"created","comment":{"url":"https://api.github.com/repos/balloob/home-assistant/pulls/comments/57509422","id":57509422,"diff_hunk":"@@ -0,0 +1,58 @@\n+\"\"\"\n+GNTP (aka Growl) notification service.\n+\n+For more details about this platform, please refer to the documentation at\n+https://home-assistant.io/components/notify.gntp/\n+\"\"\"\n+import logging\n+import os\n+\n+from homeassistant.components.notify import (\n+    ATTR_TITLE, BaseNotificationService)\n+\n+REQUIREMENTS = ['gntp==1.0.3']\n+\n+_LOGGER = logging.getLogger(__name__)\n+\n+_GNTP_LOGGER = logging.getLogger('gntp')\n+_GNTP_LOGGER.setLevel(logging.ERROR)\n+\n+\n+def get_service(hass, config):\n+    \"\"\"Get the GNTP notification service.\"\"\"\n+    if config.get('app_icon') is None:\n+        icon_file = os.path.join(os.path.dirname(__file__), \"..\", \"frontend\",\n+                                 \"www_static\", \"favicon-192x192.png\")\n+        app_icon = open(icon_file, 'rb').read()\n+    else:\n+        app_icon = config.get('app_icon')","path":"homeassistant/components/notify/gntp.py","position":28,"original_position":28,"commit_id":"652c666d143f680ca597ba8d4a16378f11743546","original_commit_id":"652c666d143f680ca597ba8d4a16378f11743546","user":{"login":"robbiet480","id":18516,"avatar_url":"https://avatars.githubusercontent.com/u/18516?v=3","gravatar_id":"","url":"https://api.github.com/users/robbiet480","html_url":"https://github.com/robbiet480","followers_url":"https://api.github.com/users/robbiet480/followers","following_url":"https://api.github.com/users/robbiet480/following{/other_user}","gists_url":"https://api.github.com/users/robbiet480/gists{/gist_id}","starred_url":"https://api.github.com/users/robbiet480/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbiet480/subscriptions","organizations_url":"https://api.github.com/users/robbiet480/orgs","repos_url":"https://api.github.com/users/robbiet480/repos","events_url":"https://api.github.com/users/robbiet480/events{/privacy}","received_events_url":"https://api.github.com/users/robbiet480/received_events","type":"User","site_admin":false},"body":"@balloob I expect users to pass in an http:// or file:// URL as I stated in balloob/home-assistant.io#331. If they provide neither then we read the file. I was originally just constructing an HTTP URL to the file and using that but GNTP/Growl for Mac sometimes has issues with reading HTTP URLs of images that don't have small dimensions (see my note on `app_icon` in the docs for more info)","created_at":"2016-03-26T05:04:18Z","updated_at":"2016-03-26T05:04:18Z","html_url":"https://github.com/balloob/home-assistant/pull/1610#discussion_r57509422","pull_request_url":"https://api.github.com/repos/balloob/home-assistant/pulls/1610","_links":{"self":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/comments/57509422"},"html":{"href":"https://github.com/balloob/home-assistant/pull/1610#discussion_r57509422"},"pull_request":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/1610"}}},"pull_request":{"url":"https://api.github.com/repos/balloob/home-assistant/pulls/1610","id":64224678,"html_url":"https://github.com/balloob/home-assistant/pull/1610","diff_url":"https://github.com/balloob/home-assistant/pull/1610.diff","patch_url":"https://github.com/balloob/home-assistant/pull/1610.patch","issue_url":"https://api.github.com/repos/balloob/home-assistant/issues/1610","number":1610,"state":"open","locked":false,"title":"Add GNTP notifier","user":{"login":"robbiet480","id":18516,"avatar_url":"https://avatars.githubusercontent.com/u/18516?v=3","gravatar_id":"","url":"https://api.github.com/users/robbiet480","html_url":"https://github.com/robbiet480","followers_url":"https://api.github.com/users/robbiet480/followers","following_url":"https://api.github.com/users/robbiet480/following{/other_user}","gists_url":"https://api.github.com/users/robbiet480/gists{/gist_id}","starred_url":"https://api.github.com/users/robbiet480/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbiet480/subscriptions","organizations_url":"https://api.github.com/users/robbiet480/orgs","repos_url":"https://api.github.com/users/robbiet480/repos","events_url":"https://api.github.com/users/robbiet480/events{/privacy}","received_events_url":"https://api.github.com/users/robbiet480/received_events","type":"User","site_admin":false},"body":"**Description:**\r\nThis adds a GNTP notifier. GNTP is used by Growl for Mac and Windows.\r\n\r\n**Related issue (if applicable):** balloob/home-assistant.io#331\r\n\r\n**Example entry for `configuration.yaml` (if applicable):**\r\n```yaml\r\nnotify:\r\n  name: NOTIFER_NAME\r\n  platform: gntp\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  - [x] 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/balloob/home-assistant/blob/dev/homeassistant/components/keyboard.py#L16\r\n[ex-import]: https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/keyboard.py#L51\r\n\r\n\r\n","created_at":"2016-03-26T01:40:01Z","updated_at":"2016-03-26T05:04:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2d0e39edbc811e4d4bdd844270e7c1946792569","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/balloob/home-assistant/pulls/1610/commits","review_comments_url":"https://api.github.com/repos/balloob/home-assistant/pulls/1610/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/1610/comments","statuses_url":"https://api.github.com/repos/balloob/home-assistant/statuses/652c666d143f680ca597ba8d4a16378f11743546","head":{"label":"robbiet480:gntp","ref":"gntp","sha":"652c666d143f680ca597ba8d4a16378f11743546","user":{"login":"robbiet480","id":18516,"avatar_url":"https://avatars.githubusercontent.com/u/18516?v=3","gravatar_id":"","url":"https://api.github.com/users/robbiet480","html_url":"https://github.com/robbiet480","followers_url":"https://api.github.com/users/robbiet480/followers","following_url":"https://api.github.com/users/robbiet480/following{/other_user}","gists_url":"https://api.github.com/users/robbiet480/gists{/gist_id}","starred_url":"https://api.github.com/users/robbiet480/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbiet480/subscriptions","organizations_url":"https://api.github.com/users/robbiet480/orgs","repos_url":"https://api.github.com/users/robbiet480/repos","events_url":"https://api.github.com/users/robbiet480/events{/privacy}","received_events_url":"https://api.github.com/users/robbiet480/received_events","type":"User","site_admin":false},"repo":{"id":54583835,"name":"home-assistant","full_name":"robbiet480/home-assistant","owner":{"login":"robbiet480","id":18516,"avatar_url":"https://avatars.githubusercontent.com/u/18516?v=3","gravatar_id":"","url":"https://api.github.com/users/robbiet480","html_url":"https://github.com/robbiet480","followers_url":"https://api.github.com/users/robbiet480/followers","following_url":"https://api.github.com/users/robbiet480/following{/other_user}","gists_url":"https://api.github.com/users/robbiet480/gists{/gist_id}","starred_url":"https://api.github.com/users/robbiet480/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbiet480/subscriptions","organizations_url":"https://api.github.com/users/robbiet480/orgs","repos_url":"https://api.github.com/users/robbiet480/repos","events_url":"https://api.github.com/users/robbiet480/events{/privacy}","received_events_url":"https://api.github.com/users/robbiet480/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robbiet480/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/robbiet480/home-assistant","forks_url":"https://api.github.com/repos/robbiet480/home-assistant/forks","keys_url":"https://api.github.com/repos/robbiet480/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robbiet480/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robbiet480/home-assistant/teams","hooks_url":"https://api.github.com/repos/robbiet480/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/robbiet480/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/robbiet480/home-assistant/events","assignees_url":"https://api.github.com/repos/robbiet480/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/robbiet480/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/robbiet480/home-assistant/tags","blobs_url":"https://api.github.com/repos/robbiet480/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robbiet480/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robbiet480/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/robbiet480/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robbiet480/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/robbiet480/home-assistant/languages","stargazers_url":"https://api.github.com/repos/robbiet480/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/robbiet480/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/robbiet480/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/robbiet480/home-assistant/subscription","commits_url":"https://api.github.com/repos/robbiet480/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/robbiet480/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/robbiet480/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/robbiet480/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/robbiet480/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/robbiet480/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robbiet480/home-assistant/merges","archive_url":"https://api.github.com/repos/robbiet480/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robbiet480/home-assistant/downloads","issues_url":"https://api.github.com/repos/robbiet480/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/robbiet480/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/robbiet480/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/robbiet480/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robbiet480/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/robbiet480/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/robbiet480/home-assistant/deployments","created_at":"2016-03-23T18:31:31Z","updated_at":"2016-03-23T18:31:33Z","pushed_at":"2016-03-26T02:49:15Z","git_url":"git://github.com/robbiet480/home-assistant.git","ssh_url":"git@github.com:robbiet480/home-assistant.git","clone_url":"https://github.com/robbiet480/home-assistant.git","svn_url":"https://github.com/robbiet480/home-assistant","homepage":"https://home-assistant.io","size":48560,"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":"9157bd38e8a593fde8cfe4cbe7e4f72502e07761","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-03-25T19:15:05Z","pushed_at":"2016-03-26T04:51:04Z","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":50197,"stargazers_count":2897,"watchers_count":2897,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":533,"mirror_url":null,"open_issues_count":207,"forks":533,"open_issues":207,"watchers":2897,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/1610"},"html":{"href":"https://github.com/balloob/home-assistant/pull/1610"},"issue":{"href":"https://api.github.com/repos/balloob/home-assistant/issues/1610"},"comments":{"href":"https://api.github.com/repos/balloob/home-assistant/issues/1610/comments"},"review_comments":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/1610/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/1610/commits"},"statuses":{"href":"https://api.github.com/repos/balloob/home-assistant/statuses/652c666d143f680ca597ba8d4a16378f11743546"}}}}