{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/224746312","pull_request_review_id":164192156,"id":224746312,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDc0NjMxMg==","diff_hunk":"@@ -0,0 +1,114 @@\n+\"\"\"\n+Support for Rflink binary sensors.\n+\n+For more details about this platform, please refer to the documentation at\n+https://home-assistant.io/components/sensor.rflink/\n+\"\"\"\n+import logging\n+\n+from homeassistant.components.binary_sensor import (\n+    DEVICE_CLASSES_SCHEMA)\n+from homeassistant.components.rflink import (\n+    CONF_ALIASES, CONF_DEVICES, DATA_ENTITY_LOOKUP, DOMAIN,\n+    EVENT_KEY_COMMAND, RflinkDevice, cv, vol)\n+from homeassistant.const import (\n+    CONF_FORCE_UPDATE, CONF_NAME, CONF_DEVICE_CLASS, CONF_PLATFORM, STATE_OFF,\n+    STATE_ON)\n+import homeassistant.helpers.event as evt\n+\n+CONF_OFF_DELAY = 'off_delay'\n+DEFAULT_FORCE_UPDATE = False\n+\n+DEPENDENCIES = ['rflink']\n+\n+_LOGGER = logging.getLogger(__name__)\n+\n+PLATFORM_SCHEMA = vol.Schema({\n+    vol.Required(CONF_PLATFORM): DOMAIN,\n+    vol.Optional(CONF_DEVICES, default={}): vol.Schema({\n+        cv.string: {\n+            vol.Optional(CONF_NAME): cv.string,\n+            vol.Optional(CONF_DEVICE_CLASS):\n+                DEVICE_CLASSES_SCHEMA,\n+            vol.Optional(CONF_FORCE_UPDATE, default=DEFAULT_FORCE_UPDATE):\n+                cv.boolean,\n+            vol.Optional(CONF_OFF_DELAY):\n+                vol.All(vol.Coerce(int), vol.Range(min=0)),\n+            vol.Optional(CONF_ALIASES, default=[]):\n+                vol.All(cv.ensure_list, [cv.string]),\n+        },\n+    }),\n+})\n+\n+\n+def devices_from_config(domain_config, hass=None):\n+    \"\"\"Parse configuration and add Rflink sensor devices.\"\"\"\n+    devices = []\n+    for device_id, config in domain_config[CONF_DEVICES].items():\n+        device = RflinkBinarySensor(device_id, hass, **config)\n+        devices.append(device)\n+\n+        # Register entity (and aliases) to listen to incoming rflink events\n+        hass.data[DATA_ENTITY_LOOKUP][\n+            EVENT_KEY_COMMAND][device_id].append(device)","path":"homeassistant/components/binary_sensor/rflink.py","position":51,"original_position":53,"commit_id":"1e3aeb30a8e82306b147f3f33a8b89d17794b591","original_commit_id":"1c32ebdd6ae4266fd096648b197fba3ed6488938","user":{"login":"javicalle","id":31999997,"node_id":"MDQ6VXNlcjMxOTk5OTk3","avatar_url":"https://avatars1.githubusercontent.com/u/31999997?v=4","gravatar_id":"","url":"https://api.github.com/users/javicalle","html_url":"https://github.com/javicalle","followers_url":"https://api.github.com/users/javicalle/followers","following_url":"https://api.github.com/users/javicalle/following{/other_user}","gists_url":"https://api.github.com/users/javicalle/gists{/gist_id}","starred_url":"https://api.github.com/users/javicalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javicalle/subscriptions","organizations_url":"https://api.github.com/users/javicalle/orgs","repos_url":"https://api.github.com/users/javicalle/repos","events_url":"https://api.github.com/users/javicalle/events{/privacy}","received_events_url":"https://api.github.com/users/javicalle/received_events","type":"User","site_admin":false},"body":"@emontnemery If you want I can help you with the tests. I can test the RFLink cover, light, sensor and switch physical devices.\r\nI can also try to help with the refactor (only devices implementation, not the base ones), but I must admit that I'm not very familiar with python (although I'm learning on the fly)","created_at":"2018-10-12T10:53:02Z","updated_at":"2018-10-12T10:53:03Z","html_url":"https://github.com/home-assistant/home-assistant/pull/17146#discussion_r224746312","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/17146","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/224746312"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/17146#discussion_r224746312"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/17146"}},"in_reply_to_id":223229785},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/17146","id":220505149,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNTA1MTQ5","html_url":"https://github.com/home-assistant/home-assistant/pull/17146","diff_url":"https://github.com/home-assistant/home-assistant/pull/17146.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/17146.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/17146","number":17146,"state":"open","locked":false,"title":"Add binary_sensor support to RFlink","user":{"login":"emontnemery","id":14281572,"node_id":"MDQ6VXNlcjE0MjgxNTcy","avatar_url":"https://avatars1.githubusercontent.com/u/14281572?v=4","gravatar_id":"","url":"https://api.github.com/users/emontnemery","html_url":"https://github.com/emontnemery","followers_url":"https://api.github.com/users/emontnemery/followers","following_url":"https://api.github.com/users/emontnemery/following{/other_user}","gists_url":"https://api.github.com/users/emontnemery/gists{/gist_id}","starred_url":"https://api.github.com/users/emontnemery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emontnemery/subscriptions","organizations_url":"https://api.github.com/users/emontnemery/orgs","repos_url":"https://api.github.com/users/emontnemery/repos","events_url":"https://api.github.com/users/emontnemery/events{/privacy}","received_events_url":"https://api.github.com/users/emontnemery/received_events","type":"User","site_admin":false},"body":"## Description:\r\nAdd RFLink support for binary_sensor\r\n\r\n**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation:** home-assistant/home-assistant.io#6519\r\n\r\n## Example entry for `configuration.yaml` (if applicable):\r\n```yaml\r\nbinary_sensor:\r\n   - platform: rflink\r\n     automatic_add: true\r\n     devices:\r\n       pt2262_00174754_0:\r\n         name: PIR Entrance\r\n         device_class: motion\r\n         off_delay: 5\r\n```\r\n\r\n## Checklist:\r\n  - [x] The code change is tested and works locally.\r\n  - [x] Local tests pass with `tox`.\r\n\r\nIf user exposed functionality or configuration variables are added/changed:\r\n  - [x] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)","created_at":"2018-10-04T20:20:37Z","updated_at":"2018-10-12T10:53:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50556e2cdcf151621e1114b355cbc1af704ae15a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":450787042,"node_id":"MDU6TGFiZWw0NTA3ODcwNDI=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/Hacktoberfest","name":"Hacktoberfest","color":"fbca04","default":false},{"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":529655200,"node_id":"MDU6TGFiZWw1Mjk2NTUyMDA=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/component:%20rflink","name":"component: rflink","color":"ededed","default":false},{"id":955422305,"node_id":"MDU6TGFiZWw5NTU0MjIzMDU=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/in%20progress","name":"in progress","color":"ededed","default":false},{"id":526146744,"node_id":"MDU6TGFiZWw1MjYxNDY3NDQ=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/new-platform","name":"new-platform","color":"5319e7","default":false},{"id":1079762116,"node_id":"MDU6TGFiZWwxMDc5NzYyMTE2","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/platform:%20binary_sensor.rflink","name":"platform: binary_sensor.rflink","color":"ededed","default":false},{"id":537380599,"node_id":"MDU6TGFiZWw1MzczODA1OTk=","url":"https://api.github.com/repos/home-assistant/home-assistant/labels/platform:%20sensor.rflink","name":"platform: sensor.rflink","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/17146/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/17146/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/17146/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/1e3aeb30a8e82306b147f3f33a8b89d17794b591","head":{"label":"emontnemery:rflink_binary_sensor","ref":"rflink_binary_sensor","sha":"1e3aeb30a8e82306b147f3f33a8b89d17794b591","user":{"login":"emontnemery","id":14281572,"node_id":"MDQ6VXNlcjE0MjgxNTcy","avatar_url":"https://avatars1.githubusercontent.com/u/14281572?v=4","gravatar_id":"","url":"https://api.github.com/users/emontnemery","html_url":"https://github.com/emontnemery","followers_url":"https://api.github.com/users/emontnemery/followers","following_url":"https://api.github.com/users/emontnemery/following{/other_user}","gists_url":"https://api.github.com/users/emontnemery/gists{/gist_id}","starred_url":"https://api.github.com/users/emontnemery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emontnemery/subscriptions","organizations_url":"https://api.github.com/users/emontnemery/orgs","repos_url":"https://api.github.com/users/emontnemery/repos","events_url":"https://api.github.com/users/emontnemery/events{/privacy}","received_events_url":"https://api.github.com/users/emontnemery/received_events","type":"User","site_admin":false},"repo":{"id":148376885,"node_id":"MDEwOlJlcG9zaXRvcnkxNDgzNzY4ODU=","name":"home-assistant","full_name":"emontnemery/home-assistant","private":false,"owner":{"login":"emontnemery","id":14281572,"node_id":"MDQ6VXNlcjE0MjgxNTcy","avatar_url":"https://avatars1.githubusercontent.com/u/14281572?v=4","gravatar_id":"","url":"https://api.github.com/users/emontnemery","html_url":"https://github.com/emontnemery","followers_url":"https://api.github.com/users/emontnemery/followers","following_url":"https://api.github.com/users/emontnemery/following{/other_user}","gists_url":"https://api.github.com/users/emontnemery/gists{/gist_id}","starred_url":"https://api.github.com/users/emontnemery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emontnemery/subscriptions","organizations_url":"https://api.github.com/users/emontnemery/orgs","repos_url":"https://api.github.com/users/emontnemery/repos","events_url":"https://api.github.com/users/emontnemery/events{/privacy}","received_events_url":"https://api.github.com/users/emontnemery/received_events","type":"User","site_admin":false},"html_url":"https://github.com/emontnemery/home-assistant","description":":house_with_garden: Open source home automation that puts local control and privacy first","fork":true,"url":"https://api.github.com/repos/emontnemery/home-assistant","forks_url":"https://api.github.com/repos/emontnemery/home-assistant/forks","keys_url":"https://api.github.com/repos/emontnemery/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emontnemery/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emontnemery/home-assistant/teams","hooks_url":"https://api.github.com/repos/emontnemery/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/emontnemery/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/emontnemery/home-assistant/events","assignees_url":"https://api.github.com/repos/emontnemery/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/emontnemery/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/emontnemery/home-assistant/tags","blobs_url":"https://api.github.com/repos/emontnemery/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emontnemery/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emontnemery/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/emontnemery/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emontnemery/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/emontnemery/home-assistant/languages","stargazers_url":"https://api.github.com/repos/emontnemery/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/emontnemery/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/emontnemery/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/emontnemery/home-assistant/subscription","commits_url":"https://api.github.com/repos/emontnemery/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/emontnemery/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/emontnemery/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/emontnemery/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/emontnemery/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/emontnemery/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emontnemery/home-assistant/merges","archive_url":"https://api.github.com/repos/emontnemery/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emontnemery/home-assistant/downloads","issues_url":"https://api.github.com/repos/emontnemery/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/emontnemery/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/emontnemery/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/emontnemery/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emontnemery/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/emontnemery/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/emontnemery/home-assistant/deployments","created_at":"2018-09-11T20:34:56Z","updated_at":"2018-10-10T17:47:33Z","pushed_at":"2018-10-11T15:41:41Z","git_url":"git://github.com/emontnemery/home-assistant.git","ssh_url":"git@github.com:emontnemery/home-assistant.git","clone_url":"https://github.com/emontnemery/home-assistant.git","svn_url":"https://github.com/emontnemery/home-assistant","homepage":"https://home-assistant.io","size":90432,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"home-assistant:dev","ref":"dev","sha":"b55c7a5ba243730b27047b958f6b6c9fd64e3ac8","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","private":false,"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},"html_url":"https://github.com/home-assistant/home-assistant","description":":house_with_garden: Open source home automation that puts local control and privacy first","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-10-12T09:56:08Z","pushed_at":"2018-10-12T10:25:25Z","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://www.home-assistant.io","size":91342,"stargazers_count":17348,"watchers_count":17348,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5103,"mirror_url":null,"archived":false,"open_issues_count":941,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":5103,"open_issues":941,"watchers":17348,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/17146"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/17146"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/17146"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/17146/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/17146/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/17146/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant/statuses/1e3aeb30a8e82306b147f3f33a8b89d17794b591"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"javicalle"}}