{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments/210465318","pull_request_review_id":146685207,"id":210465318,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDQ2NTMxOA==","diff_hunk":"@@ -8,223 +8,183 @@\n  */\n package org.openhab.binding.lutron.handler;\n \n-import static org.openhab.binding.lutron.LutronBindingConstants.*;\n+import java.util.Arrays;\n \n-import org.eclipse.smarthome.core.library.types.OnOffType;\n-import org.eclipse.smarthome.core.thing.ChannelUID;\n import org.eclipse.smarthome.core.thing.Thing;\n-import org.eclipse.smarthome.core.thing.ThingStatus;\n-import org.eclipse.smarthome.core.thing.ThingStatusDetail;\n-import org.eclipse.smarthome.core.types.Command;\n-import org.openhab.binding.lutron.internal.protocol.LutronCommandType;\n+import org.openhab.binding.lutron.internal.KeypadComponent;\n import org.slf4j.Logger;\n import org.slf4j.LoggerFactory;\n \n /**\n- * Handler responsible for communicating with a keypad.\n+ * Handler responsible for communicating with Lutron seeTouch and Hybrid seeTouch keypads used in\n+ * RadioRA2 and Homeworks QS systems\n  *\n- * @author Allan Tong - Initial contribution\n+ * @author Bob Adair - Initial contribution\n  */\n-public class KeypadHandler extends LutronHandler {\n-    private static final int COMPONENT_BUTTON1 = 1;\n-    private static final int COMPONENT_BUTTON2 = 2;\n-    private static final int COMPONENT_BUTTON3 = 3;\n-    private static final int COMPONENT_BUTTON4 = 4;\n-    private static final int COMPONENT_BUTTON5 = 5;\n-    private static final int COMPONENT_BUTTON6 = 6;\n-    private static final int COMPONENT_BUTTON7 = 7;\n-    private static final int COMPONENT_BUTTONTOPLOWER = 16;\n-    private static final int COMPONENT_BUTTONTOPRAISE = 17;\n-    private static final int COMPONENT_BUTTONBOTTOMLOWER = 18;\n-    private static final int COMPONENT_BUTTONBOTTOMRAISE = 19;\n-    private static final int COMPONENT_LED1 = 81;\n-    private static final int COMPONENT_LED2 = 82;\n-    private static final int COMPONENT_LED3 = 83;\n-    private static final int COMPONENT_LED4 = 84;\n-    private static final int COMPONENT_LED5 = 85;\n-    private static final int COMPONENT_LED6 = 86;\n-    private static final int COMPONENT_LED7 = 87;\n-\n-    private static final Integer ACTION_PRESS = 3;\n-    private static final Integer ACTION_RELEASE = 4;\n-    private static final Integer LED_STATE = 9;\n-\n-    private static final Integer LED_OFF = 0;\n-    private static final Integer LED_ON = 1;\n-\n-    private Logger logger = LoggerFactory.getLogger(KeypadHandler.class);\n-\n-    private int integrationId;\n-\n-    public KeypadHandler(Thing thing) {\n-        super(thing);\n-    }\n-\n-    @Override\n-    public void initialize() {\n-        Number id = (Number) getThing().getConfiguration().get(\"integrationId\");\n-\n-        if (id == null) {\n-            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, \"No integrationId\");\n+public class KeypadHandler extends BaseKeypadHandler {\n+\n+    private static enum COMPONENT implements KeypadComponent {","path":"addons/binding/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/handler/KeypadHandler.java","position":69,"original_position":69,"commit_id":"1c3070710ca751a031ec2e380352069a8683b0f2","original_commit_id":"5688ef10bf74800d2014f3060d08d23ec0070f77","user":{"login":"bobadair","id":25465964,"node_id":"MDQ6VXNlcjI1NDY1OTY0","avatar_url":"https://avatars3.githubusercontent.com/u/25465964?v=4","gravatar_id":"","url":"https://api.github.com/users/bobadair","html_url":"https://github.com/bobadair","followers_url":"https://api.github.com/users/bobadair/followers","following_url":"https://api.github.com/users/bobadair/following{/other_user}","gists_url":"https://api.github.com/users/bobadair/gists{/gist_id}","starred_url":"https://api.github.com/users/bobadair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobadair/subscriptions","organizations_url":"https://api.github.com/users/bobadair/orgs","repos_url":"https://api.github.com/users/bobadair/repos","events_url":"https://api.github.com/users/bobadair/events{/privacy}","received_events_url":"https://api.github.com/users/bobadair/received_events","type":"User","site_admin":false},"body":"Ok. Fair enough. :-) I'm pushing a new commit that changes this.","created_at":"2018-08-16T02:56:48Z","updated_at":"2018-08-16T02:56:48Z","html_url":"https://github.com/openhab/openhab2-addons/pull/3787#discussion_r210465318","pull_request_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments/210465318"},"html":{"href":"https://github.com/openhab/openhab2-addons/pull/3787#discussion_r210465318"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787"}},"in_reply_to_id":209445078},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787","id":206118747,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MTE4NzQ3","html_url":"https://github.com/openhab/openhab2-addons/pull/3787","diff_url":"https://github.com/openhab/openhab2-addons/pull/3787.diff","patch_url":"https://github.com/openhab/openhab2-addons/pull/3787.patch","issue_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/3787","number":3787,"state":"open","locked":false,"title":"[Lutron] Add enhanced keypad and VCRX Support","user":{"login":"bobadair","id":25465964,"node_id":"MDQ6VXNlcjI1NDY1OTY0","avatar_url":"https://avatars3.githubusercontent.com/u/25465964?v=4","gravatar_id":"","url":"https://api.github.com/users/bobadair","html_url":"https://github.com/bobadair","followers_url":"https://api.github.com/users/bobadair/followers","following_url":"https://api.github.com/users/bobadair/following{/other_user}","gists_url":"https://api.github.com/users/bobadair/gists{/gist_id}","starred_url":"https://api.github.com/users/bobadair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobadair/subscriptions","organizations_url":"https://api.github.com/users/bobadair/orgs","repos_url":"https://api.github.com/users/bobadair/repos","events_url":"https://api.github.com/users/bobadair/events{/privacy}","received_events_url":"https://api.github.com/users/bobadair/received_events","type":"User","site_admin":false},"body":"Hi everyone. This change (Issue #3778) provides the following additions and enhancements to the Lutron binding:\r\n\r\n- It adds support for seeTouch Tabletop keypads, VCRX, and cold contact output (CCO) modules. \r\n- It enhances support for seeTouch, Hybrid seeTouch, and Pico keypads and repeater integration buttons.  The enhanced support includes:\r\n     1. Auto-discovery for all keypad and CCO types\r\n     2. Automatic and dynamic configuration of the appropriate button, LED, and CCI (for VCRX) channels for each keypad model based on a thing “model” parameter.\r\n     3. The ability to optionally have keypad buttons auto-release, for compatibility with applications (such as Lutron Home+) that send button “press” commands without matching “release” commands. This is controlled by an “auto-release” thing parameter.\r\n     4. The ability to send remote button presses and drive keypad button LED states.\r\n     5. Backward compatibility with the existing keypad button channel implementation\r\n- It enables auto-discovery for several additional devices and device modes.\r\n- It provides related updates to the documentation file README.md.\r\n\r\nMore information on user interaction and configuration examples are provided in the updated README.md file.\r\n\r\nThis has been in development for quite a while.  I’ve been running a version of this code on my relatively large RA2 system since last year with no problems. I announced the work in the forums last November, and a few people were kind enough to test it out for me last November and December under 2.2.  However, I’ve only recently gotten around to merging in the last seven months worth of upstream commits and getting it in to a state that is hopefully ready for a pull request.  I’m sure it could use some wider testing, especially with Caseta and HWQS (which I do not have access to).\r\n\r\nAll compiler warnings and “high” and “medium” static code analysis warnings in the new code have been resolved.\r\n\r\nThis is my first contribution to OpenHAB, so I hope it proves to be useful to others!  Any pointers regarding things I may have screwed up are welcome.\r\n\r\nImplementation notes:\r\n\r\n- KeypadHandler, PicoKeypadHandler, TabletopKeypadHandler, VcrxHandler, and VirtualKeypadHandler are subclasses of BaseKeypadHandler.  The subclasses contain only model-specific configuration.\r\n\r\n- PulsedCcoHandler and MaintainedCcoHandler are subclasses of CcoHandler. The subclasses hard-code the appropriate pulse options for auto-discovered CCO devices, as described in the README.md.\r\n\r\n  Regards,\r\n     -\tBob Adair\r\n\r\nCloses #3778\r\nFixes #3234\r\n","created_at":"2018-08-03T19:27:27Z","updated_at":"2018-08-16T02:56:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6235d3626fbbd599d39ac865c46d89b2fcad5330","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/3787/comments","statuses_url":"https://api.github.com/repos/openhab/openhab2-addons/statuses/1c3070710ca751a031ec2e380352069a8683b0f2","head":{"label":"bobadair:3778-lutron","ref":"3778-lutron","sha":"1c3070710ca751a031ec2e380352069a8683b0f2","user":{"login":"bobadair","id":25465964,"node_id":"MDQ6VXNlcjI1NDY1OTY0","avatar_url":"https://avatars3.githubusercontent.com/u/25465964?v=4","gravatar_id":"","url":"https://api.github.com/users/bobadair","html_url":"https://github.com/bobadair","followers_url":"https://api.github.com/users/bobadair/followers","following_url":"https://api.github.com/users/bobadair/following{/other_user}","gists_url":"https://api.github.com/users/bobadair/gists{/gist_id}","starred_url":"https://api.github.com/users/bobadair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobadair/subscriptions","organizations_url":"https://api.github.com/users/bobadair/orgs","repos_url":"https://api.github.com/users/bobadair/repos","events_url":"https://api.github.com/users/bobadair/events{/privacy}","received_events_url":"https://api.github.com/users/bobadair/received_events","type":"User","site_admin":false},"repo":{"id":104515082,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ1MTUwODI=","name":"openhab2-addons","full_name":"bobadair/openhab2-addons","owner":{"login":"bobadair","id":25465964,"node_id":"MDQ6VXNlcjI1NDY1OTY0","avatar_url":"https://avatars3.githubusercontent.com/u/25465964?v=4","gravatar_id":"","url":"https://api.github.com/users/bobadair","html_url":"https://github.com/bobadair","followers_url":"https://api.github.com/users/bobadair/followers","following_url":"https://api.github.com/users/bobadair/following{/other_user}","gists_url":"https://api.github.com/users/bobadair/gists{/gist_id}","starred_url":"https://api.github.com/users/bobadair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobadair/subscriptions","organizations_url":"https://api.github.com/users/bobadair/orgs","repos_url":"https://api.github.com/users/bobadair/repos","events_url":"https://api.github.com/users/bobadair/events{/privacy}","received_events_url":"https://api.github.com/users/bobadair/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bobadair/openhab2-addons","description":"Add-ons for openHAB 2.x","fork":true,"url":"https://api.github.com/repos/bobadair/openhab2-addons","forks_url":"https://api.github.com/repos/bobadair/openhab2-addons/forks","keys_url":"https://api.github.com/repos/bobadair/openhab2-addons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bobadair/openhab2-addons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bobadair/openhab2-addons/teams","hooks_url":"https://api.github.com/repos/bobadair/openhab2-addons/hooks","issue_events_url":"https://api.github.com/repos/bobadair/openhab2-addons/issues/events{/number}","events_url":"https://api.github.com/repos/bobadair/openhab2-addons/events","assignees_url":"https://api.github.com/repos/bobadair/openhab2-addons/assignees{/user}","branches_url":"https://api.github.com/repos/bobadair/openhab2-addons/branches{/branch}","tags_url":"https://api.github.com/repos/bobadair/openhab2-addons/tags","blobs_url":"https://api.github.com/repos/bobadair/openhab2-addons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bobadair/openhab2-addons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bobadair/openhab2-addons/git/refs{/sha}","trees_url":"https://api.github.com/repos/bobadair/openhab2-addons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bobadair/openhab2-addons/statuses/{sha}","languages_url":"https://api.github.com/repos/bobadair/openhab2-addons/languages","stargazers_url":"https://api.github.com/repos/bobadair/openhab2-addons/stargazers","contributors_url":"https://api.github.com/repos/bobadair/openhab2-addons/contributors","subscribers_url":"https://api.github.com/repos/bobadair/openhab2-addons/subscribers","subscription_url":"https://api.github.com/repos/bobadair/openhab2-addons/subscription","commits_url":"https://api.github.com/repos/bobadair/openhab2-addons/commits{/sha}","git_commits_url":"https://api.github.com/repos/bobadair/openhab2-addons/git/commits{/sha}","comments_url":"https://api.github.com/repos/bobadair/openhab2-addons/comments{/number}","issue_comment_url":"https://api.github.com/repos/bobadair/openhab2-addons/issues/comments{/number}","contents_url":"https://api.github.com/repos/bobadair/openhab2-addons/contents/{+path}","compare_url":"https://api.github.com/repos/bobadair/openhab2-addons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bobadair/openhab2-addons/merges","archive_url":"https://api.github.com/repos/bobadair/openhab2-addons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bobadair/openhab2-addons/downloads","issues_url":"https://api.github.com/repos/bobadair/openhab2-addons/issues{/number}","pulls_url":"https://api.github.com/repos/bobadair/openhab2-addons/pulls{/number}","milestones_url":"https://api.github.com/repos/bobadair/openhab2-addons/milestones{/number}","notifications_url":"https://api.github.com/repos/bobadair/openhab2-addons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bobadair/openhab2-addons/labels{/name}","releases_url":"https://api.github.com/repos/bobadair/openhab2-addons/releases{/id}","deployments_url":"https://api.github.com/repos/bobadair/openhab2-addons/deployments","created_at":"2017-09-22T20:16:07Z","updated_at":"2017-09-22T20:16:15Z","pushed_at":"2018-08-15T20:32:19Z","git_url":"git://github.com/bobadair/openhab2-addons.git","ssh_url":"git@github.com:bobadair/openhab2-addons.git","clone_url":"https://github.com/bobadair/openhab2-addons.git","svn_url":"https://github.com/bobadair/openhab2-addons","homepage":"","size":290840,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"epl-1.0","name":"Eclipse Public License 1.0","spdx_id":"EPL-1.0","url":"https://api.github.com/licenses/epl-1.0","node_id":"MDc6TGljZW5zZTc="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"82625e6a83b85e1acfcd81b41500f23fa62e6a10","user":{"login":"openhab","id":1007353,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDczNTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","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":19753195,"node_id":"MDEwOlJlcG9zaXRvcnkxOTc1MzE5NQ==","name":"openhab2-addons","full_name":"openhab/openhab2-addons","owner":{"login":"openhab","id":1007353,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDczNTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","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/openhab2-addons","description":"Add-ons for openHAB 2.x","fork":false,"url":"https://api.github.com/repos/openhab/openhab2-addons","forks_url":"https://api.github.com/repos/openhab/openhab2-addons/forks","keys_url":"https://api.github.com/repos/openhab/openhab2-addons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/openhab2-addons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/openhab2-addons/teams","hooks_url":"https://api.github.com/repos/openhab/openhab2-addons/hooks","issue_events_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/openhab2-addons/events","assignees_url":"https://api.github.com/repos/openhab/openhab2-addons/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/openhab2-addons/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/openhab2-addons/tags","blobs_url":"https://api.github.com/repos/openhab/openhab2-addons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/openhab2-addons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/openhab2-addons/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/openhab2-addons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/openhab2-addons/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/openhab2-addons/languages","stargazers_url":"https://api.github.com/repos/openhab/openhab2-addons/stargazers","contributors_url":"https://api.github.com/repos/openhab/openhab2-addons/contributors","subscribers_url":"https://api.github.com/repos/openhab/openhab2-addons/subscribers","subscription_url":"https://api.github.com/repos/openhab/openhab2-addons/subscription","commits_url":"https://api.github.com/repos/openhab/openhab2-addons/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/openhab2-addons/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/openhab2-addons/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/openhab2-addons/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/openhab2-addons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/openhab2-addons/merges","archive_url":"https://api.github.com/repos/openhab/openhab2-addons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/openhab2-addons/downloads","issues_url":"https://api.github.com/repos/openhab/openhab2-addons/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/openhab2-addons/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/openhab2-addons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/openhab2-addons/labels{/name}","releases_url":"https://api.github.com/repos/openhab/openhab2-addons/releases{/id}","deployments_url":"https://api.github.com/repos/openhab/openhab2-addons/deployments","created_at":"2014-05-13T19:41:58Z","updated_at":"2018-08-15T20:16:52Z","pushed_at":"2018-08-15T21:15:58Z","git_url":"git://github.com/openhab/openhab2-addons.git","ssh_url":"git@github.com:openhab/openhab2-addons.git","clone_url":"https://github.com/openhab/openhab2-addons.git","svn_url":"https://github.com/openhab/openhab2-addons","homepage":"","size":291526,"stargazers_count":793,"watchers_count":793,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1519,"mirror_url":null,"archived":false,"open_issues_count":415,"license":{"key":"epl-1.0","name":"Eclipse Public License 1.0","spdx_id":"EPL-1.0","url":"https://api.github.com/licenses/epl-1.0","node_id":"MDc6TGljZW5zZTc="},"forks":1519,"open_issues":415,"watchers":793,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787"},"html":{"href":"https://github.com/openhab/openhab2-addons/pull/3787"},"issue":{"href":"https://api.github.com/repos/openhab/openhab2-addons/issues/3787"},"comments":{"href":"https://api.github.com/repos/openhab/openhab2-addons/issues/3787/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/3787/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab2-addons/statuses/1c3070710ca751a031ec2e380352069a8683b0f2"}},"author_association":"NONE"}}
{"actor":{"display_login":"bobadair"}}