{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab/pulls/comments/26171883","id":26171883,"diff_hunk":"@@ -0,0 +1,318 @@\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.plex.internal;\n+\n+import java.io.IOException;\n+import java.lang.reflect.Field;\n+import java.lang.reflect.InvocationTargetException;\n+import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.Dictionary;\n+import java.util.Enumeration;\n+import java.util.List;\n+\n+import org.apache.commons.lang.StringUtils;\n+import org.openhab.binding.plex.PlexBindingProvider;\n+import org.openhab.binding.plex.internal.annotations.ItemMapping;\n+import org.openhab.binding.plex.internal.annotations.ItemPlayerStateMapping;\n+import org.openhab.binding.plex.internal.communication.MediaContainer;\n+import org.openhab.core.binding.AbstractActiveBinding;\n+import org.openhab.core.binding.BindingProvider;\n+import org.openhab.core.library.types.OnOffType;\n+import org.openhab.core.library.types.PercentType;\n+import org.openhab.core.library.types.StringType;\n+import org.openhab.core.types.Command;\n+import org.openhab.core.types.State;\n+import org.osgi.service.cm.ConfigurationException;\n+import org.osgi.service.cm.ManagedService;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+/**\n+* Binding that communicates with a Plex Media Server\n+* \n+* {@link http://www.plex.tv/}\n+* \n+* @author Jeroen Idserda\n+* @since 1.7.0\n+*/\n+public class PlexBinding extends AbstractActiveBinding<PlexBindingProvider> implements ManagedService {\n+\n+\tprivate static final Logger logger = LoggerFactory.getLogger(PlexBinding.class);\n+\t\n+\tprivate PlexConnector connector;\n+\t\n+\tprivate int refreshInterval = 5000;\n+\t\n+\tpublic void activate() {\n+\t\tlogger.debug(\"Plex binding actived\");\n+\t}\n+\t\n+\tpublic void deactivate() {\n+\t\tlogger.debug(\"Plex binding deactived\");\n+\t\tif (connector != null)\n+\t\t\tconnector.close();\n+\t}\n+\t\n+\t@Override\n+\tprotected void execute() {\n+\t\tif (connector != null) \n+\t\t\tconnector.refresh();\n+\t}\n+\n+\t@Override\n+\tprotected long getRefreshInterval() {\n+\t\treturn refreshInterval;\n+\t}\n+\n+\t@Override\n+\tprotected String getName() {\n+\t\treturn \"Plex Refresh Service\";\n+\t}\n+\t\n+\t/**\n+\t * @{inheritDoc}\n+\t */\t\n+\t@Override\n+\tpublic void bindingChanged(BindingProvider provider, String itemName) {\n+\t\tlogger.debug(\"Plex binding changed\");","path":"bundles/binding/org.openhab.binding.plex/src/main/java/org/openhab/binding/plex/internal/PlexBinding.java","position":84,"original_position":84,"commit_id":"e133d3f36b64b0ead2c7c2d2cfa687c1d84dcce2","original_commit_id":"e133d3f36b64b0ead2c7c2d2cfa687c1d84dcce2","user":{"login":"teichsta","id":2108636,"avatar_url":"https://avatars.githubusercontent.com/u/2108636?v=3","gravatar_id":"","url":"https://api.github.com/users/teichsta","html_url":"https://github.com/teichsta","followers_url":"https://api.github.com/users/teichsta/followers","following_url":"https://api.github.com/users/teichsta/following{/other_user}","gists_url":"https://api.github.com/users/teichsta/gists{/gist_id}","starred_url":"https://api.github.com/users/teichsta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teichsta/subscriptions","organizations_url":"https://api.github.com/users/teichsta/orgs","repos_url":"https://api.github.com/users/teichsta/repos","events_url":"https://api.github.com/users/teichsta/events{/privacy}","received_events_url":"https://api.github.com/users/teichsta/received_events","type":"User","site_admin":false},"body":"please decrease to TRACE","created_at":"2015-03-10T22:12:54Z","updated_at":"2015-03-10T22:12:54Z","html_url":"https://github.com/openhab/openhab/pull/1862#discussion_r26171883","pull_request_url":"https://api.github.com/repos/openhab/openhab/pulls/1862","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments/26171883"},"html":{"href":"https://github.com/openhab/openhab/pull/1862#discussion_r26171883"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab/pulls/1862"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab/pulls/1862","id":26416448,"html_url":"https://github.com/openhab/openhab/pull/1862","diff_url":"https://github.com/openhab/openhab/pull/1862.diff","patch_url":"https://github.com/openhab/openhab/pull/1862.patch","issue_url":"https://api.github.com/repos/openhab/openhab/issues/1862","number":1862,"state":"open","locked":false,"title":"Plex binding","user":{"login":"idserda","id":853610,"avatar_url":"https://avatars.githubusercontent.com/u/853610?v=3","gravatar_id":"","url":"https://api.github.com/users/idserda","html_url":"https://github.com/idserda","followers_url":"https://api.github.com/users/idserda/followers","following_url":"https://api.github.com/users/idserda/following{/other_user}","gists_url":"https://api.github.com/users/idserda/gists{/gist_id}","starred_url":"https://api.github.com/users/idserda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idserda/subscriptions","organizations_url":"https://api.github.com/users/idserda/orgs","repos_url":"https://api.github.com/users/idserda/repos","events_url":"https://api.github.com/users/idserda/events{/privacy}","received_events_url":"https://api.github.com/users/idserda/received_events","type":"User","site_admin":false},"body":"Binding for [Plex](https://plex.tv/) -> ready for review\r\n\r\n[Plex binding Wiki](https://github.com/idserda/openhab/wiki/Plex-Binding)\r\n\r\nTODO:\r\n- ~~Set (some) correct state at item config init~~\r\n- ~~Reconnect web socket on connection lost~~\r\n- ~~Add EPL license headers~~\r\n- ~~Check files for newline at end~~\r\n- ~~Javadoc~~\r\n- ~~Get current volume level for client (not sure if possible)~~","created_at":"2014-12-20T13:46:16Z","updated_at":"2015-03-10T22:12:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"086b6e8bbc04ab99c57563b3a91a49bf124d3fca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab/pulls/1862/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab/pulls/1862/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab/issues/1862/comments","statuses_url":"https://api.github.com/repos/openhab/openhab/statuses/e133d3f36b64b0ead2c7c2d2cfa687c1d84dcce2","head":{"label":"idserda:plex","ref":"plex","sha":"e133d3f36b64b0ead2c7c2d2cfa687c1d84dcce2","user":{"login":"idserda","id":853610,"avatar_url":"https://avatars.githubusercontent.com/u/853610?v=3","gravatar_id":"","url":"https://api.github.com/users/idserda","html_url":"https://github.com/idserda","followers_url":"https://api.github.com/users/idserda/followers","following_url":"https://api.github.com/users/idserda/following{/other_user}","gists_url":"https://api.github.com/users/idserda/gists{/gist_id}","starred_url":"https://api.github.com/users/idserda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idserda/subscriptions","organizations_url":"https://api.github.com/users/idserda/orgs","repos_url":"https://api.github.com/users/idserda/repos","events_url":"https://api.github.com/users/idserda/events{/privacy}","received_events_url":"https://api.github.com/users/idserda/received_events","type":"User","site_admin":false},"repo":{"id":25428617,"name":"openhab","full_name":"idserda/openhab","owner":{"login":"idserda","id":853610,"avatar_url":"https://avatars.githubusercontent.com/u/853610?v=3","gravatar_id":"","url":"https://api.github.com/users/idserda","html_url":"https://github.com/idserda","followers_url":"https://api.github.com/users/idserda/followers","following_url":"https://api.github.com/users/idserda/following{/other_user}","gists_url":"https://api.github.com/users/idserda/gists{/gist_id}","starred_url":"https://api.github.com/users/idserda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idserda/subscriptions","organizations_url":"https://api.github.com/users/idserda/orgs","repos_url":"https://api.github.com/users/idserda/repos","events_url":"https://api.github.com/users/idserda/events{/privacy}","received_events_url":"https://api.github.com/users/idserda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/idserda/openhab","description":"Source code of the open Home Automation Bus (openHAB)","fork":true,"url":"https://api.github.com/repos/idserda/openhab","forks_url":"https://api.github.com/repos/idserda/openhab/forks","keys_url":"https://api.github.com/repos/idserda/openhab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/idserda/openhab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/idserda/openhab/teams","hooks_url":"https://api.github.com/repos/idserda/openhab/hooks","issue_events_url":"https://api.github.com/repos/idserda/openhab/issues/events{/number}","events_url":"https://api.github.com/repos/idserda/openhab/events","assignees_url":"https://api.github.com/repos/idserda/openhab/assignees{/user}","branches_url":"https://api.github.com/repos/idserda/openhab/branches{/branch}","tags_url":"https://api.github.com/repos/idserda/openhab/tags","blobs_url":"https://api.github.com/repos/idserda/openhab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/idserda/openhab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/idserda/openhab/git/refs{/sha}","trees_url":"https://api.github.com/repos/idserda/openhab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/idserda/openhab/statuses/{sha}","languages_url":"https://api.github.com/repos/idserda/openhab/languages","stargazers_url":"https://api.github.com/repos/idserda/openhab/stargazers","contributors_url":"https://api.github.com/repos/idserda/openhab/contributors","subscribers_url":"https://api.github.com/repos/idserda/openhab/subscribers","subscription_url":"https://api.github.com/repos/idserda/openhab/subscription","commits_url":"https://api.github.com/repos/idserda/openhab/commits{/sha}","git_commits_url":"https://api.github.com/repos/idserda/openhab/git/commits{/sha}","comments_url":"https://api.github.com/repos/idserda/openhab/comments{/number}","issue_comment_url":"https://api.github.com/repos/idserda/openhab/issues/comments{/number}","contents_url":"https://api.github.com/repos/idserda/openhab/contents/{+path}","compare_url":"https://api.github.com/repos/idserda/openhab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/idserda/openhab/merges","archive_url":"https://api.github.com/repos/idserda/openhab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/idserda/openhab/downloads","issues_url":"https://api.github.com/repos/idserda/openhab/issues{/number}","pulls_url":"https://api.github.com/repos/idserda/openhab/pulls{/number}","milestones_url":"https://api.github.com/repos/idserda/openhab/milestones{/number}","notifications_url":"https://api.github.com/repos/idserda/openhab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/idserda/openhab/labels{/name}","releases_url":"https://api.github.com/repos/idserda/openhab/releases{/id}","created_at":"2014-10-19T13:59:10Z","updated_at":"2015-02-23T22:28:45Z","pushed_at":"2015-02-18T19:32:44Z","git_url":"git://github.com/idserda/openhab.git","ssh_url":"git@github.com:idserda/openhab.git","clone_url":"https://github.com/idserda/openhab.git","svn_url":"https://github.com/idserda/openhab","homepage":null,"size":155336,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"1ea4eefd74f3596a9250a70ca7b1e8d7638c2684","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-03-10T21:40:07Z","pushed_at":"2015-03-10T21:40:07Z","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":196898,"stargazers_count":1167,"watchers_count":1167,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":698,"mirror_url":null,"open_issues_count":470,"forks":698,"open_issues":470,"watchers":1167,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/1862"},"html":{"href":"https://github.com/openhab/openhab/pull/1862"},"issue":{"href":"https://api.github.com/repos/openhab/openhab/issues/1862"},"comments":{"href":"https://api.github.com/repos/openhab/openhab/issues/1862/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab/pulls/1862/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab/pulls/1862/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab/statuses/e133d3f36b64b0ead2c7c2d2cfa687c1d84dcce2"}}}}