{"action":"created","issue":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/608","labels_url":"https://api.github.com/repos/balloob/home-assistant/issues/608/labels{/name}","comments_url":"https://api.github.com/repos/balloob/home-assistant/issues/608/comments","events_url":"https://api.github.com/repos/balloob/home-assistant/issues/608/events","html_url":"https://github.com/balloob/home-assistant/pull/608","id":116145311,"number":608,"title":"Binary sensor component","user":{"login":"fabaff","id":116184,"avatar_url":"https://avatars.githubusercontent.com/u/116184?v=3","gravatar_id":"","url":"https://api.github.com/users/fabaff","html_url":"https://github.com/fabaff","followers_url":"https://api.github.com/users/fabaff/followers","following_url":"https://api.github.com/users/fabaff/following{/other_user}","gists_url":"https://api.github.com/users/fabaff/gists{/gist_id}","starred_url":"https://api.github.com/users/fabaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabaff/subscriptions","organizations_url":"https://api.github.com/users/fabaff/orgs","repos_url":"https://api.github.com/users/fabaff/repos","events_url":"https://api.github.com/users/fabaff/events{/privacy}","received_events_url":"https://api.github.com/users/fabaff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-10T16:33:43Z","updated_at":"2015-11-18T05:54:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/balloob/home-assistant/pulls/608","html_url":"https://github.com/balloob/home-assistant/pull/608","diff_url":"https://github.com/balloob/home-assistant/pull/608.diff","patch_url":"https://github.com/balloob/home-assistant/pull/608.patch"},"body":"In PR #444 were doors and windows magnetic contact sensors mentioned. The `contact` component (still looking for a better name) would become a stripped-down sensor that only know two states: on/high/open and off/low/closed.\r\n\r\nNow it looks like a duplicate version of the `sensor` component with some switch code. I'm not sure if it's the right way to go. For the frontend it might be because \"0/1\" could be values as well. I'm dreaming about a badge that change its color depending on its state.\r\n\r\nFeedback would be highly appreciated before we proceed or trash this PR. \r\n\r\nOne argument for a `digital`, `contact`, `0/1`, or `binary` component is that we have already a lot of entities in HA which only supports two states. Most microcontrollers (Arduino, ESP8266, Raspi, etc.) have a lot of digital pins for detecting states. Something like this PR could help to better distinguish between digital and analog inputs.\r\n"},"comment":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/comments/157611299","html_url":"https://github.com/balloob/home-assistant/pull/608#issuecomment-157611299","issue_url":"https://api.github.com/repos/balloob/home-assistant/issues/608","id":157611299,"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},"created_at":"2015-11-18T05:54:54Z","updated_at":"2015-11-18T05:54:54Z","body":"It looks like there are a few commits and files there that are not needed. Could you clean this up?\r\n\r\nYou could clean it up like this: (warning, _untested_)\r\n```bash\r\n# Rollback all commits in this branch\r\ngit reset --soft HEAD~21\r\n# Only add files that you want, you can ignore the frontend for now\r\ngit add -A homeassistant/components/binary_sensor tests homeassistant/components/demo.py\r\n# Commit files\r\ngit commit -m \"Binary sensor component\"\r\n# This is destructive, will overwrite existing branch on github\r\ngit push -f\r\n```"}}