{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab/pulls/comments/45460026","id":45460026,"diff_hunk":"@@ -0,0 +1,1011 @@\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.sapp.internal;\n+\n+import java.util.Collection;\n+import java.util.Map;\n+import java.util.Set;\n+\n+import org.apache.commons.lang.StringUtils;\n+import org.openhab.binding.sapp.SappBindingProvider;\n+import org.openhab.binding.sapp.internal.configs.SappBindingConfigContactItem;\n+import org.openhab.binding.sapp.internal.configs.SappBindingConfigDimmerItem;\n+import org.openhab.binding.sapp.internal.configs.SappBindingConfigNumberItem;\n+import org.openhab.binding.sapp.internal.configs.SappBindingConfigRollershutterItem;\n+import org.openhab.binding.sapp.internal.configs.SappBindingConfigSwitchItem;\n+import org.openhab.binding.sapp.internal.configs.SappBindingConfigUtils;\n+import org.openhab.binding.sapp.internal.executer.SappCentralExecuter;\n+import org.openhab.binding.sapp.internal.executer.SappCentralExecuter.PollingResult;\n+import org.openhab.binding.sapp.internal.model.SappAddressDecimal;\n+import org.openhab.binding.sapp.internal.model.SappAddressDimmer;\n+import org.openhab.binding.sapp.internal.model.SappAddressOnOffControl;\n+import org.openhab.binding.sapp.internal.model.SappAddressOnOffStatus;\n+import org.openhab.binding.sapp.internal.model.SappAddressOpenClosedStatus;\n+import org.openhab.binding.sapp.internal.model.SappAddressRollershutterControl;\n+import org.openhab.binding.sapp.internal.model.SappAddressRollershutterStatus;\n+import org.openhab.binding.sapp.internal.model.SappAddressType;\n+import org.openhab.binding.sapp.internal.model.SappPnmas;\n+import org.openhab.core.binding.AbstractActiveBinding;\n+import org.openhab.core.binding.BindingProvider;\n+import org.openhab.core.items.Item;\n+import org.openhab.core.items.ItemRegistry;\n+import org.openhab.core.items.ItemRegistryChangeListener;\n+import org.openhab.core.library.items.ContactItem;\n+import org.openhab.core.library.items.DimmerItem;\n+import org.openhab.core.library.items.NumberItem;\n+import org.openhab.core.library.items.RollershutterItem;\n+import org.openhab.core.library.items.SwitchItem;\n+import org.openhab.core.library.types.DecimalType;\n+import org.openhab.core.library.types.IncreaseDecreaseType;\n+import org.openhab.core.library.types.OnOffType;\n+import org.openhab.core.library.types.OpenClosedType;\n+import org.openhab.core.library.types.PercentType;\n+import org.openhab.core.library.types.StopMoveType;\n+import org.openhab.core.library.types.UpDownType;\n+import org.openhab.core.types.Command;\n+import org.openhab.core.types.State;\n+import org.osgi.framework.BundleContext;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import com.github.paolodenti.jsapp.core.command.base.SappException;\n+import com.github.paolodenti.jsapp.core.util.SappUtils;\n+\n+/**\n+ * Implement this class if you are going create an actively polling service like\n+ * querying a Website/Device.\n+ * \n+ * @author Paolo Denti\n+ * @since 1.8.0\n+ */\n+public class SappBinding extends AbstractActiveBinding<SappBindingProvider> implements ItemRegistryChangeListener {\n+\n+\tprivate static final Logger logger = LoggerFactory.getLogger(SappBinding.class);\n+\n+\tprivate static final String CONFIG_KEY_REFRESH = \"refresh\";\n+\tprivate static final String CONFIG_KEY_PNMAS_ENABLED = \"pnmas.ids\";\n+\tprivate static final String CONFIG_KEY_PNMAS_ID = \"pnmas.%s.ip\";\n+\tprivate static final String CONFIG_KEY_PNMAS_PORT = \"pnmas.%s.port\";\n+\tprivate static final String ALL_UPDATE_REQUEST_KEY = \"*\";\n+\n+\t/**\n+\t * The BundleContext. This is only valid when the bundle is ACTIVE. It is\n+\t * set in the activate() method and must not be accessed anymore once the\n+\t * deactivate() method was called or before activate() was called.\n+\t */\n+\t@SuppressWarnings(\"unused\")","path":"bundles/binding/org.openhab.binding.sapp/src/main/java/org/openhab/binding/sapp/internal/SappBinding.java","position":82,"original_position":82,"commit_id":"e42d9ac8ec222bbc7e9917cdea487bd6113d8132","original_commit_id":"e42d9ac8ec222bbc7e9917cdea487bd6113d8132","user":{"login":"hakan42","id":352641,"avatar_url":"https://avatars.githubusercontent.com/u/352641?v=3","gravatar_id":"","url":"https://api.github.com/users/hakan42","html_url":"https://github.com/hakan42","followers_url":"https://api.github.com/users/hakan42/followers","following_url":"https://api.github.com/users/hakan42/following{/other_user}","gists_url":"https://api.github.com/users/hakan42/gists{/gist_id}","starred_url":"https://api.github.com/users/hakan42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hakan42/subscriptions","organizations_url":"https://api.github.com/users/hakan42/orgs","repos_url":"https://api.github.com/users/hakan42/repos","events_url":"https://api.github.com/users/hakan42/events{/privacy}","received_events_url":"https://api.github.com/users/hakan42/received_events","type":"User","site_admin":false},"body":"Is this SuppressWarnings really needed?","created_at":"2015-11-20T11:31:54Z","updated_at":"2015-11-20T11:31:54Z","html_url":"https://github.com/openhab/openhab/pull/3229#discussion_r45460026","pull_request_url":"https://api.github.com/repos/openhab/openhab/pulls/3229","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments/45460026"},"html":{"href":"https://github.com/openhab/openhab/pull/3229#discussion_r45460026"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab/pulls/3229"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab/pulls/3229","id":46609692,"html_url":"https://github.com/openhab/openhab/pull/3229","diff_url":"https://github.com/openhab/openhab/pull/3229.diff","patch_url":"https://github.com/openhab/openhab/pull/3229.patch","issue_url":"https://api.github.com/repos/openhab/openhab/issues/3229","number":3229,"state":"open","locked":false,"title":"new binding for picnet home automation devices","user":{"login":"paolodenti","id":298222,"avatar_url":"https://avatars.githubusercontent.com/u/298222?v=3","gravatar_id":"","url":"https://api.github.com/users/paolodenti","html_url":"https://github.com/paolodenti","followers_url":"https://api.github.com/users/paolodenti/followers","following_url":"https://api.github.com/users/paolodenti/following{/other_user}","gists_url":"https://api.github.com/users/paolodenti/gists{/gist_id}","starred_url":"https://api.github.com/users/paolodenti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paolodenti/subscriptions","organizations_url":"https://api.github.com/users/paolodenti/orgs","repos_url":"https://api.github.com/users/paolodenti/repos","events_url":"https://api.github.com/users/paolodenti/events{/privacy}","received_events_url":"https://api.github.com/users/paolodenti/received_events","type":"User","site_admin":false},"body":"Substitutes #3050 (used a dedicated branch instead of master)","created_at":"2015-10-02T07:41:40Z","updated_at":"2015-11-20T11:31:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8f77d3e7bd113c275caa5e148bda03f1d35d0dc","assignee":{"login":"hakan42","id":352641,"avatar_url":"https://avatars.githubusercontent.com/u/352641?v=3","gravatar_id":"","url":"https://api.github.com/users/hakan42","html_url":"https://github.com/hakan42","followers_url":"https://api.github.com/users/hakan42/followers","following_url":"https://api.github.com/users/hakan42/following{/other_user}","gists_url":"https://api.github.com/users/hakan42/gists{/gist_id}","starred_url":"https://api.github.com/users/hakan42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hakan42/subscriptions","organizations_url":"https://api.github.com/users/hakan42/orgs","repos_url":"https://api.github.com/users/hakan42/repos","events_url":"https://api.github.com/users/hakan42/events{/privacy}","received_events_url":"https://api.github.com/users/hakan42/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab/pulls/3229/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab/pulls/3229/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab/issues/3229/comments","statuses_url":"https://api.github.com/repos/openhab/openhab/statuses/e42d9ac8ec222bbc7e9917cdea487bd6113d8132","head":{"label":"paolodenti:sapp","ref":"sapp","sha":"e42d9ac8ec222bbc7e9917cdea487bd6113d8132","user":{"login":"paolodenti","id":298222,"avatar_url":"https://avatars.githubusercontent.com/u/298222?v=3","gravatar_id":"","url":"https://api.github.com/users/paolodenti","html_url":"https://github.com/paolodenti","followers_url":"https://api.github.com/users/paolodenti/followers","following_url":"https://api.github.com/users/paolodenti/following{/other_user}","gists_url":"https://api.github.com/users/paolodenti/gists{/gist_id}","starred_url":"https://api.github.com/users/paolodenti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paolodenti/subscriptions","organizations_url":"https://api.github.com/users/paolodenti/orgs","repos_url":"https://api.github.com/users/paolodenti/repos","events_url":"https://api.github.com/users/paolodenti/events{/privacy}","received_events_url":"https://api.github.com/users/paolodenti/received_events","type":"User","site_admin":false},"repo":{"id":37263832,"name":"openhab","full_name":"paolodenti/openhab","owner":{"login":"paolodenti","id":298222,"avatar_url":"https://avatars.githubusercontent.com/u/298222?v=3","gravatar_id":"","url":"https://api.github.com/users/paolodenti","html_url":"https://github.com/paolodenti","followers_url":"https://api.github.com/users/paolodenti/followers","following_url":"https://api.github.com/users/paolodenti/following{/other_user}","gists_url":"https://api.github.com/users/paolodenti/gists{/gist_id}","starred_url":"https://api.github.com/users/paolodenti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paolodenti/subscriptions","organizations_url":"https://api.github.com/users/paolodenti/orgs","repos_url":"https://api.github.com/users/paolodenti/repos","events_url":"https://api.github.com/users/paolodenti/events{/privacy}","received_events_url":"https://api.github.com/users/paolodenti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paolodenti/openhab","description":"Source code of the open Home Automation Bus (openHAB)","fork":true,"url":"https://api.github.com/repos/paolodenti/openhab","forks_url":"https://api.github.com/repos/paolodenti/openhab/forks","keys_url":"https://api.github.com/repos/paolodenti/openhab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paolodenti/openhab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paolodenti/openhab/teams","hooks_url":"https://api.github.com/repos/paolodenti/openhab/hooks","issue_events_url":"https://api.github.com/repos/paolodenti/openhab/issues/events{/number}","events_url":"https://api.github.com/repos/paolodenti/openhab/events","assignees_url":"https://api.github.com/repos/paolodenti/openhab/assignees{/user}","branches_url":"https://api.github.com/repos/paolodenti/openhab/branches{/branch}","tags_url":"https://api.github.com/repos/paolodenti/openhab/tags","blobs_url":"https://api.github.com/repos/paolodenti/openhab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paolodenti/openhab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paolodenti/openhab/git/refs{/sha}","trees_url":"https://api.github.com/repos/paolodenti/openhab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paolodenti/openhab/statuses/{sha}","languages_url":"https://api.github.com/repos/paolodenti/openhab/languages","stargazers_url":"https://api.github.com/repos/paolodenti/openhab/stargazers","contributors_url":"https://api.github.com/repos/paolodenti/openhab/contributors","subscribers_url":"https://api.github.com/repos/paolodenti/openhab/subscribers","subscription_url":"https://api.github.com/repos/paolodenti/openhab/subscription","commits_url":"https://api.github.com/repos/paolodenti/openhab/commits{/sha}","git_commits_url":"https://api.github.com/repos/paolodenti/openhab/git/commits{/sha}","comments_url":"https://api.github.com/repos/paolodenti/openhab/comments{/number}","issue_comment_url":"https://api.github.com/repos/paolodenti/openhab/issues/comments{/number}","contents_url":"https://api.github.com/repos/paolodenti/openhab/contents/{+path}","compare_url":"https://api.github.com/repos/paolodenti/openhab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paolodenti/openhab/merges","archive_url":"https://api.github.com/repos/paolodenti/openhab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paolodenti/openhab/downloads","issues_url":"https://api.github.com/repos/paolodenti/openhab/issues{/number}","pulls_url":"https://api.github.com/repos/paolodenti/openhab/pulls{/number}","milestones_url":"https://api.github.com/repos/paolodenti/openhab/milestones{/number}","notifications_url":"https://api.github.com/repos/paolodenti/openhab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paolodenti/openhab/labels{/name}","releases_url":"https://api.github.com/repos/paolodenti/openhab/releases{/id}","created_at":"2015-06-11T13:50:22Z","updated_at":"2015-06-11T13:50:36Z","pushed_at":"2015-11-19T17:18:18Z","git_url":"git://github.com/paolodenti/openhab.git","ssh_url":"git@github.com:paolodenti/openhab.git","clone_url":"https://github.com/paolodenti/openhab.git","svn_url":"https://github.com/paolodenti/openhab","homepage":null,"size":161418,"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":"7594e9cf671529f7598f4c7d3391755ec4192d2a","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-11-20T08:42:57Z","pushed_at":"2015-11-20T10:40:53Z","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":249577,"stargazers_count":1851,"watchers_count":1851,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1044,"mirror_url":null,"open_issues_count":500,"forks":1044,"open_issues":500,"watchers":1851,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/3229"},"html":{"href":"https://github.com/openhab/openhab/pull/3229"},"issue":{"href":"https://api.github.com/repos/openhab/openhab/issues/3229"},"comments":{"href":"https://api.github.com/repos/openhab/openhab/issues/3229/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab/pulls/3229/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab/pulls/3229/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab/statuses/e42d9ac8ec222bbc7e9917cdea487bd6113d8132"}}}}