{"action":"created","comment":{"url":"https://api.github.com/repos/fxbox/app/pulls/comments/59536943","id":59536943,"diff_hunk":"@@ -5,24 +5,57 @@ export default class ServicesListItem extends React.Component {\n     super(props);\n \n     this.props = props;\n-    this.state = props.state;\n+    this.state = {\n+      // @todo Query getter to get the `available` state.\n+      available: true,\n+      // @todo Query getter to get the `power` state.\n+      on: true,\n+    };\n \n     this.foxbox = props.foxbox;\n   }\n \n-  componentWillReceiveProps(props) {\n-    this.setState(props.state);\n-  }\n-\n   handleLightOnChange(evt) {\n-    // No optimistic update because some network issues can't be caught.\n     const on = evt.target.checked;\n+    const value = on ? 'On' : 'Off';\n+    const id = this.getOperationByAlias('power').id;\n+\n+    // Optimistic update.\n+    this.setState({ on });\n+\n+    this.foxbox.performSetOperation({","path":"app/js/views/services-list-item.jsx","position":28,"original_position":28,"commit_id":"558baf3b4e3baddd31d6cd3b33ce821cf9c2810c","original_commit_id":"558baf3b4e3baddd31d6cd3b33ce821cf9c2810c","user":{"login":"gmarty","id":333865,"avatar_url":"https://avatars.githubusercontent.com/u/333865?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarty","html_url":"https://github.com/gmarty","followers_url":"https://api.github.com/users/gmarty/followers","following_url":"https://api.github.com/users/gmarty/following{/other_user}","gists_url":"https://api.github.com/users/gmarty/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarty/subscriptions","organizations_url":"https://api.github.com/users/gmarty/orgs","repos_url":"https://api.github.com/users/gmarty/repos","events_url":"https://api.github.com/users/gmarty/events{/privacy}","received_events_url":"https://api.github.com/users/gmarty/received_events","type":"User","site_admin":false},"body":"I haven't realised I could do that.","created_at":"2016-04-13T12:15:05Z","updated_at":"2016-04-13T12:15:05Z","html_url":"https://github.com/fxbox/app/pull/70#discussion_r59536943","pull_request_url":"https://api.github.com/repos/fxbox/app/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/fxbox/app/pulls/comments/59536943"},"html":{"href":"https://github.com/fxbox/app/pull/70#discussion_r59536943"},"pull_request":{"href":"https://api.github.com/repos/fxbox/app/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/fxbox/app/pulls/70","id":66153242,"html_url":"https://github.com/fxbox/app/pull/70","diff_url":"https://github.com/fxbox/app/pull/70.diff","patch_url":"https://github.com/fxbox/app/pull/70.patch","issue_url":"https://api.github.com/repos/fxbox/app/issues/70","number":70,"state":"open","locked":false,"title":"Add support for the Philips Hue adapter. r=azasypkin","user":{"login":"gmarty","id":333865,"avatar_url":"https://avatars.githubusercontent.com/u/333865?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarty","html_url":"https://github.com/gmarty","followers_url":"https://api.github.com/users/gmarty/followers","following_url":"https://api.github.com/users/gmarty/following{/other_user}","gists_url":"https://api.github.com/users/gmarty/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarty/subscriptions","organizations_url":"https://api.github.com/users/gmarty/orgs","repos_url":"https://api.github.com/users/gmarty/repos","events_url":"https://api.github.com/users/gmarty/events{/privacy}","received_events_url":"https://api.github.com/users/gmarty/received_events","type":"User","site_admin":false},"body":"This patch:\r\n* Add partial support for the Philips Hue adapter (getting values is not done yet)\r\n* Relax the use of eslint `comma-dangle` in preparation of https://github.com/fxbox/app/issues/47\r\n* Fix minor issue in `foxbox.js` (better warning when no boxes are found and only poll the box when the user is logged in)\r\n* Remove the code related to the deprecated service states","created_at":"2016-04-12T13:02:49Z","updated_at":"2016-04-13T12:15:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d73efba5fae6cf6019079870924f3ef7b4119b8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fxbox/app/pulls/70/commits","review_comments_url":"https://api.github.com/repos/fxbox/app/pulls/70/comments","review_comment_url":"https://api.github.com/repos/fxbox/app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fxbox/app/issues/70/comments","statuses_url":"https://api.github.com/repos/fxbox/app/statuses/558baf3b4e3baddd31d6cd3b33ce821cf9c2810c","head":{"label":"gmarty:hue-adapter","ref":"hue-adapter","sha":"558baf3b4e3baddd31d6cd3b33ce821cf9c2810c","user":{"login":"gmarty","id":333865,"avatar_url":"https://avatars.githubusercontent.com/u/333865?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarty","html_url":"https://github.com/gmarty","followers_url":"https://api.github.com/users/gmarty/followers","following_url":"https://api.github.com/users/gmarty/following{/other_user}","gists_url":"https://api.github.com/users/gmarty/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarty/subscriptions","organizations_url":"https://api.github.com/users/gmarty/orgs","repos_url":"https://api.github.com/users/gmarty/repos","events_url":"https://api.github.com/users/gmarty/events{/privacy}","received_events_url":"https://api.github.com/users/gmarty/received_events","type":"User","site_admin":false},"repo":{"id":54418298,"name":"app","full_name":"gmarty/app","owner":{"login":"gmarty","id":333865,"avatar_url":"https://avatars.githubusercontent.com/u/333865?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarty","html_url":"https://github.com/gmarty","followers_url":"https://api.github.com/users/gmarty/followers","following_url":"https://api.github.com/users/gmarty/following{/other_user}","gists_url":"https://api.github.com/users/gmarty/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarty/subscriptions","organizations_url":"https://api.github.com/users/gmarty/orgs","repos_url":"https://api.github.com/users/gmarty/repos","events_url":"https://api.github.com/users/gmarty/events{/privacy}","received_events_url":"https://api.github.com/users/gmarty/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmarty/app","description":"An app for Project Link","fork":true,"url":"https://api.github.com/repos/gmarty/app","forks_url":"https://api.github.com/repos/gmarty/app/forks","keys_url":"https://api.github.com/repos/gmarty/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmarty/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmarty/app/teams","hooks_url":"https://api.github.com/repos/gmarty/app/hooks","issue_events_url":"https://api.github.com/repos/gmarty/app/issues/events{/number}","events_url":"https://api.github.com/repos/gmarty/app/events","assignees_url":"https://api.github.com/repos/gmarty/app/assignees{/user}","branches_url":"https://api.github.com/repos/gmarty/app/branches{/branch}","tags_url":"https://api.github.com/repos/gmarty/app/tags","blobs_url":"https://api.github.com/repos/gmarty/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmarty/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmarty/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmarty/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmarty/app/statuses/{sha}","languages_url":"https://api.github.com/repos/gmarty/app/languages","stargazers_url":"https://api.github.com/repos/gmarty/app/stargazers","contributors_url":"https://api.github.com/repos/gmarty/app/contributors","subscribers_url":"https://api.github.com/repos/gmarty/app/subscribers","subscription_url":"https://api.github.com/repos/gmarty/app/subscription","commits_url":"https://api.github.com/repos/gmarty/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmarty/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmarty/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmarty/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmarty/app/contents/{+path}","compare_url":"https://api.github.com/repos/gmarty/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmarty/app/merges","archive_url":"https://api.github.com/repos/gmarty/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmarty/app/downloads","issues_url":"https://api.github.com/repos/gmarty/app/issues{/number}","pulls_url":"https://api.github.com/repos/gmarty/app/pulls{/number}","milestones_url":"https://api.github.com/repos/gmarty/app/milestones{/number}","notifications_url":"https://api.github.com/repos/gmarty/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmarty/app/labels{/name}","releases_url":"https://api.github.com/repos/gmarty/app/releases{/id}","deployments_url":"https://api.github.com/repos/gmarty/app/deployments","created_at":"2016-03-21T19:53:28Z","updated_at":"2016-03-21T19:53:28Z","pushed_at":"2016-04-13T10:49:17Z","git_url":"git://github.com/gmarty/app.git","ssh_url":"git@github.com:gmarty/app.git","clone_url":"https://github.com/gmarty/app.git","svn_url":"https://github.com/gmarty/app","homepage":"https://fxbox.github.io/app","size":1889,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fxbox:master","ref":"master","sha":"ea468e5889caa8defdcde61aaa9b62491208dda4","user":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"repo":{"id":51533667,"name":"app","full_name":"fxbox/app","owner":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fxbox/app","description":"An app for Project Link","fork":false,"url":"https://api.github.com/repos/fxbox/app","forks_url":"https://api.github.com/repos/fxbox/app/forks","keys_url":"https://api.github.com/repos/fxbox/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fxbox/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fxbox/app/teams","hooks_url":"https://api.github.com/repos/fxbox/app/hooks","issue_events_url":"https://api.github.com/repos/fxbox/app/issues/events{/number}","events_url":"https://api.github.com/repos/fxbox/app/events","assignees_url":"https://api.github.com/repos/fxbox/app/assignees{/user}","branches_url":"https://api.github.com/repos/fxbox/app/branches{/branch}","tags_url":"https://api.github.com/repos/fxbox/app/tags","blobs_url":"https://api.github.com/repos/fxbox/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fxbox/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fxbox/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/fxbox/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fxbox/app/statuses/{sha}","languages_url":"https://api.github.com/repos/fxbox/app/languages","stargazers_url":"https://api.github.com/repos/fxbox/app/stargazers","contributors_url":"https://api.github.com/repos/fxbox/app/contributors","subscribers_url":"https://api.github.com/repos/fxbox/app/subscribers","subscription_url":"https://api.github.com/repos/fxbox/app/subscription","commits_url":"https://api.github.com/repos/fxbox/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/fxbox/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/fxbox/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/fxbox/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/fxbox/app/contents/{+path}","compare_url":"https://api.github.com/repos/fxbox/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fxbox/app/merges","archive_url":"https://api.github.com/repos/fxbox/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fxbox/app/downloads","issues_url":"https://api.github.com/repos/fxbox/app/issues{/number}","pulls_url":"https://api.github.com/repos/fxbox/app/pulls{/number}","milestones_url":"https://api.github.com/repos/fxbox/app/milestones{/number}","notifications_url":"https://api.github.com/repos/fxbox/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fxbox/app/labels{/name}","releases_url":"https://api.github.com/repos/fxbox/app/releases{/id}","deployments_url":"https://api.github.com/repos/fxbox/app/deployments","created_at":"2016-02-11T17:46:54Z","updated_at":"2016-03-04T13:20:59Z","pushed_at":"2016-04-13T10:54:04Z","git_url":"git://github.com/fxbox/app.git","ssh_url":"git@github.com:fxbox/app.git","clone_url":"https://github.com/fxbox/app.git","svn_url":"https://github.com/fxbox/app","homepage":"https://fxbox.github.io/app","size":1925,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":18,"forks":7,"open_issues":18,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fxbox/app/pulls/70"},"html":{"href":"https://github.com/fxbox/app/pull/70"},"issue":{"href":"https://api.github.com/repos/fxbox/app/issues/70"},"comments":{"href":"https://api.github.com/repos/fxbox/app/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/fxbox/app/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/fxbox/app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fxbox/app/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/fxbox/app/statuses/558baf3b4e3baddd31d6cd3b33ce821cf9c2810c"}}}}