{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab/pulls/comments/35904783","id":35904783,"diff_hunk":"@@ -0,0 +1,154 @@\n+/**\n+ * Copyright (c) 2010-2015, openHAB.org and others.\n+ *\n+ * All rights reserved. This program and the accompanying materials\n+ * are made available under the terms of the Eclipse Public License v1.0\n+ * which accompanies this distribution, and is available at\n+ * http://www.eclipse.org/legal/epl-v10.html\n+ */\n+package org.openhab.binding.zwave.internal.protocol.commandclass;\n+\n+import org.openhab.binding.zwave.internal.config.ZWaveDbCommandClass;\n+import org.openhab.binding.zwave.internal.protocol.SerialMessage;\n+import org.openhab.binding.zwave.internal.protocol.ZWaveController;\n+import org.openhab.binding.zwave.internal.protocol.ZWaveEndpoint;\n+import org.openhab.binding.zwave.internal.protocol.ZWaveNode;\n+import org.openhab.binding.zwave.internal.protocol.SerialMessage.SerialMessageClass;\n+import org.openhab.binding.zwave.internal.protocol.SerialMessage.SerialMessagePriority;\n+import org.openhab.binding.zwave.internal.protocol.SerialMessage.SerialMessageType;\n+import org.openhab.binding.zwave.internal.protocol.event.ZWaveCommandClassValueEvent;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import com.thoughtworks.xstream.annotations.XStreamAlias;\n+import com.thoughtworks.xstream.annotations.XStreamOmitField;\n+\n+/**\n+ * Handles the Indicator command class. \n+ * @author Pedro Paixao\n+ * @since 1.8.0\n+ */\n+\n+@XStreamAlias(\"indicatorCommandClass\")\n+public class ZWaveIndicatorCommandClass extends ZWaveCommandClass implements ZWaveIndicatorCommands {\n+\n+\t@XStreamOmitField\n+\tprivate static final Logger logger = LoggerFactory.getLogger(ZWaveIndicatorCommandClass.class);\n+\t\n+\tprivate static final int INDICATOR_SET = 0x01;\n+\tprivate static final int INDICATOR_GET = 0x02;\n+\tprivate static final int INDICATOR_REPORT = 0x03;\n+\n+\tprivate boolean isGetSupported = true;\n+\n+\t/**\n+\t * Creates a new instance of the ZWaveIndicatorCommandClass class.\n+\t * @param node the node this command class belongs to\n+\t * @param controller the controller to use\n+\t * @param endpoint the endpoint this Command class belongs to\n+\t */\n+\tpublic ZWaveIndicatorCommandClass(ZWaveNode node,\n+\t\t\tZWaveController controller, ZWaveEndpoint endpoint) {\n+\t\tsuper(node, controller, endpoint);\n+\t}\n+\n+\n+\t/**\n+\t * {@inheritDoc}\n+\t */\n+\t@Override\n+\tpublic CommandClass getCommandClass() {\n+\t\treturn CommandClass.INDICATOR;\n+\t}\n+\n+\t/**\n+\t * {@inheritDoc}\n+\t */\n+\t@Override\n+\tpublic void handleApplicationCommandRequest(SerialMessage serialMessage,\n+\t\t\tint offset, int endpoint) {\n+\t\tlogger.debug(\"NODE {}: Received Indicator Request\", this.getNode().getNodeId());\n+\t\tint command = serialMessage.getMessagePayloadByte(offset);\n+\t\tswitch (command) {\n+\t\t\tcase INDICATOR_SET:\n+\t\t\t\tlogger.debug(\"NODE {}: Indicator Set sent to the controller will be processed as Indicator Report\", this.getNode().getNodeId());\n+\t\t\t\t// Process this as if it was a value report.\n+\t\t\t\tprocessIndicatorReport(serialMessage, offset, endpoint);","path":"bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveIndicatorCommandClass.java","position":76,"original_position":76,"commit_id":"fc5267aff5d7f8a81c9ba88ec1c4770068c85a24","original_commit_id":"478ba336af02211807d08c69899b481dd76d9863","user":{"login":"cdjackson","id":1041475,"avatar_url":"https://avatars.githubusercontent.com/u/1041475?v=3","gravatar_id":"","url":"https://api.github.com/users/cdjackson","html_url":"https://github.com/cdjackson","followers_url":"https://api.github.com/users/cdjackson/followers","following_url":"https://api.github.com/users/cdjackson/following{/other_user}","gists_url":"https://api.github.com/users/cdjackson/gists{/gist_id}","starred_url":"https://api.github.com/users/cdjackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdjackson/subscriptions","organizations_url":"https://api.github.com/users/cdjackson/orgs","repos_url":"https://api.github.com/users/cdjackson/repos","events_url":"https://api.github.com/users/cdjackson/events{/privacy}","received_events_url":"https://api.github.com/users/cdjackson/received_events","type":"User","site_admin":false},"body":"Ok - how have you tested the binding receiving a SET? It would not normally receive this I think, which is why it's normally not implemented.","created_at":"2015-07-30T18:40:59Z","updated_at":"2015-07-30T18:40:59Z","html_url":"https://github.com/openhab/openhab/pull/2988#discussion_r35904783","pull_request_url":"https://api.github.com/repos/openhab/openhab/pulls/2988","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments/35904783"},"html":{"href":"https://github.com/openhab/openhab/pull/2988#discussion_r35904783"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2988"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab/pulls/2988","id":41200767,"html_url":"https://github.com/openhab/openhab/pull/2988","diff_url":"https://github.com/openhab/openhab/pull/2988.diff","patch_url":"https://github.com/openhab/openhab/pull/2988.patch","issue_url":"https://api.github.com/repos/openhab/openhab/issues/2988","number":2988,"state":"open","locked":false,"title":"Indicator class","user":{"login":"paixaop","id":327006,"avatar_url":"https://avatars.githubusercontent.com/u/327006?v=3","gravatar_id":"","url":"https://api.github.com/users/paixaop","html_url":"https://github.com/paixaop","followers_url":"https://api.github.com/users/paixaop/followers","following_url":"https://api.github.com/users/paixaop/following{/other_user}","gists_url":"https://api.github.com/users/paixaop/gists{/gist_id}","starred_url":"https://api.github.com/users/paixaop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paixaop/subscriptions","organizations_url":"https://api.github.com/users/paixaop/orgs","repos_url":"https://api.github.com/users/paixaop/repos","events_url":"https://api.github.com/users/paixaop/events{/privacy}","received_events_url":"https://api.github.com/users/paixaop/received_events","type":"User","site_admin":false},"body":"Added support to the Indicator Command Class. Tested with Evolve LCD1. Button reports are working.\r\n\r\nTo use add a new Number item like so:\r\n\r\n    Number Panel_GF_Kitchen_status   {zwave=\"11:0:command=INDICATOR\"}\r\n\r\nThen you can write a rule to check Button presses on the panel\r\n\r\n    rule \"Kitchen Panel Buttons\"\r\n    when\r\n        Item Panel_GF_Kitchen_status changed\r\n    then\r\n        logInfo(\"Scenes\", \"Kitchen Button Panel Indicator Update\")\r\n        switch(Panel_GF_Kitchen_status.state) {\r\n\t\t\tcase 0  : logInfo(\"Scene\",\"No Buttons active\")\r\n\t\t\tcase 4  : logInfo(\"Scene\",\"Button 1 Active\")\r\n\t\t\tcase 8  : logInfo(\"Scene\",\"Button 2 Active\")\r\n\t\t\tcase 12 : logInfo(\"Scene\",\"Button 1 and 2 Active\")\r\n\t\t}\r\n    end","created_at":"2015-07-30T06:04:38Z","updated_at":"2015-07-30T18:40:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9292e168d7f626a21490fe7da09270de43e71f63","assignee":{"login":"cdjackson","id":1041475,"avatar_url":"https://avatars.githubusercontent.com/u/1041475?v=3","gravatar_id":"","url":"https://api.github.com/users/cdjackson","html_url":"https://github.com/cdjackson","followers_url":"https://api.github.com/users/cdjackson/followers","following_url":"https://api.github.com/users/cdjackson/following{/other_user}","gists_url":"https://api.github.com/users/cdjackson/gists{/gist_id}","starred_url":"https://api.github.com/users/cdjackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdjackson/subscriptions","organizations_url":"https://api.github.com/users/cdjackson/orgs","repos_url":"https://api.github.com/users/cdjackson/repos","events_url":"https://api.github.com/users/cdjackson/events{/privacy}","received_events_url":"https://api.github.com/users/cdjackson/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab/pulls/2988/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab/pulls/2988/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab/issues/2988/comments","statuses_url":"https://api.github.com/repos/openhab/openhab/statuses/fc5267aff5d7f8a81c9ba88ec1c4770068c85a24","head":{"label":"paixaop:IndicatorClass","ref":"IndicatorClass","sha":"fc5267aff5d7f8a81c9ba88ec1c4770068c85a24","user":{"login":"paixaop","id":327006,"avatar_url":"https://avatars.githubusercontent.com/u/327006?v=3","gravatar_id":"","url":"https://api.github.com/users/paixaop","html_url":"https://github.com/paixaop","followers_url":"https://api.github.com/users/paixaop/followers","following_url":"https://api.github.com/users/paixaop/following{/other_user}","gists_url":"https://api.github.com/users/paixaop/gists{/gist_id}","starred_url":"https://api.github.com/users/paixaop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paixaop/subscriptions","organizations_url":"https://api.github.com/users/paixaop/orgs","repos_url":"https://api.github.com/users/paixaop/repos","events_url":"https://api.github.com/users/paixaop/events{/privacy}","received_events_url":"https://api.github.com/users/paixaop/received_events","type":"User","site_admin":false},"repo":{"id":39174072,"name":"openhab","full_name":"paixaop/openhab","owner":{"login":"paixaop","id":327006,"avatar_url":"https://avatars.githubusercontent.com/u/327006?v=3","gravatar_id":"","url":"https://api.github.com/users/paixaop","html_url":"https://github.com/paixaop","followers_url":"https://api.github.com/users/paixaop/followers","following_url":"https://api.github.com/users/paixaop/following{/other_user}","gists_url":"https://api.github.com/users/paixaop/gists{/gist_id}","starred_url":"https://api.github.com/users/paixaop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paixaop/subscriptions","organizations_url":"https://api.github.com/users/paixaop/orgs","repos_url":"https://api.github.com/users/paixaop/repos","events_url":"https://api.github.com/users/paixaop/events{/privacy}","received_events_url":"https://api.github.com/users/paixaop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paixaop/openhab","description":"Source code of the open Home Automation Bus (openHAB)","fork":true,"url":"https://api.github.com/repos/paixaop/openhab","forks_url":"https://api.github.com/repos/paixaop/openhab/forks","keys_url":"https://api.github.com/repos/paixaop/openhab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paixaop/openhab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paixaop/openhab/teams","hooks_url":"https://api.github.com/repos/paixaop/openhab/hooks","issue_events_url":"https://api.github.com/repos/paixaop/openhab/issues/events{/number}","events_url":"https://api.github.com/repos/paixaop/openhab/events","assignees_url":"https://api.github.com/repos/paixaop/openhab/assignees{/user}","branches_url":"https://api.github.com/repos/paixaop/openhab/branches{/branch}","tags_url":"https://api.github.com/repos/paixaop/openhab/tags","blobs_url":"https://api.github.com/repos/paixaop/openhab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paixaop/openhab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paixaop/openhab/git/refs{/sha}","trees_url":"https://api.github.com/repos/paixaop/openhab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paixaop/openhab/statuses/{sha}","languages_url":"https://api.github.com/repos/paixaop/openhab/languages","stargazers_url":"https://api.github.com/repos/paixaop/openhab/stargazers","contributors_url":"https://api.github.com/repos/paixaop/openhab/contributors","subscribers_url":"https://api.github.com/repos/paixaop/openhab/subscribers","subscription_url":"https://api.github.com/repos/paixaop/openhab/subscription","commits_url":"https://api.github.com/repos/paixaop/openhab/commits{/sha}","git_commits_url":"https://api.github.com/repos/paixaop/openhab/git/commits{/sha}","comments_url":"https://api.github.com/repos/paixaop/openhab/comments{/number}","issue_comment_url":"https://api.github.com/repos/paixaop/openhab/issues/comments{/number}","contents_url":"https://api.github.com/repos/paixaop/openhab/contents/{+path}","compare_url":"https://api.github.com/repos/paixaop/openhab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paixaop/openhab/merges","archive_url":"https://api.github.com/repos/paixaop/openhab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paixaop/openhab/downloads","issues_url":"https://api.github.com/repos/paixaop/openhab/issues{/number}","pulls_url":"https://api.github.com/repos/paixaop/openhab/pulls{/number}","milestones_url":"https://api.github.com/repos/paixaop/openhab/milestones{/number}","notifications_url":"https://api.github.com/repos/paixaop/openhab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paixaop/openhab/labels{/name}","releases_url":"https://api.github.com/repos/paixaop/openhab/releases{/id}","created_at":"2015-07-16T03:18:10Z","updated_at":"2015-07-16T03:18:23Z","pushed_at":"2015-07-30T18:40:59Z","git_url":"git://github.com/paixaop/openhab.git","ssh_url":"git@github.com:paixaop/openhab.git","clone_url":"https://github.com/paixaop/openhab.git","svn_url":"https://github.com/paixaop/openhab","homepage":null,"size":159969,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"12d36999bab716a7ac4836ba1879c1d97977c4a7","user":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"repo":{"id":12983151,"name":"openhab","full_name":"openhab/openhab","owner":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openhab/openhab","description":"Source code of the open Home Automation Bus (openHAB)","fork":false,"url":"https://api.github.com/repos/openhab/openhab","forks_url":"https://api.github.com/repos/openhab/openhab/forks","keys_url":"https://api.github.com/repos/openhab/openhab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/openhab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/openhab/teams","hooks_url":"https://api.github.com/repos/openhab/openhab/hooks","issue_events_url":"https://api.github.com/repos/openhab/openhab/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/openhab/events","assignees_url":"https://api.github.com/repos/openhab/openhab/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/openhab/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/openhab/tags","blobs_url":"https://api.github.com/repos/openhab/openhab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/openhab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/openhab/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/openhab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/openhab/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/openhab/languages","stargazers_url":"https://api.github.com/repos/openhab/openhab/stargazers","contributors_url":"https://api.github.com/repos/openhab/openhab/contributors","subscribers_url":"https://api.github.com/repos/openhab/openhab/subscribers","subscription_url":"https://api.github.com/repos/openhab/openhab/subscription","commits_url":"https://api.github.com/repos/openhab/openhab/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/openhab/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/openhab/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/openhab/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/openhab/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/openhab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/openhab/merges","archive_url":"https://api.github.com/repos/openhab/openhab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/openhab/downloads","issues_url":"https://api.github.com/repos/openhab/openhab/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/openhab/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/openhab/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/openhab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/openhab/labels{/name}","releases_url":"https://api.github.com/repos/openhab/openhab/releases{/id}","created_at":"2013-09-20T20:28:43Z","updated_at":"2015-07-30T13:08:43Z","pushed_at":"2015-07-30T18:40:59Z","git_url":"git://github.com/openhab/openhab.git","ssh_url":"git@github.com:openhab/openhab.git","clone_url":"https://github.com/openhab/openhab.git","svn_url":"https://github.com/openhab/openhab","homepage":null,"size":251033,"stargazers_count":1532,"watchers_count":1532,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":894,"mirror_url":null,"open_issues_count":498,"forks":894,"open_issues":498,"watchers":1532,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2988"},"html":{"href":"https://github.com/openhab/openhab/pull/2988"},"issue":{"href":"https://api.github.com/repos/openhab/openhab/issues/2988"},"comments":{"href":"https://api.github.com/repos/openhab/openhab/issues/2988/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2988/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2988/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab/statuses/fc5267aff5d7f8a81c9ba88ec1c4770068c85a24"}}}}