{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab/pulls/comments/30468541","id":30468541,"diff_hunk":"@@ -445,16 +458,22 @@ private Object stateToObject(State state) {\n    */\n   private String stateToString(State state) {\n     String value;\n-    if (state instanceof PercentType) {\n-      value = ((PercentType) state).toBigDecimal().toString();\n-    } else if (state instanceof DateTimeType) {\n-      value = String.valueOf(((DateTimeType) state).getCalendar().getTime().getTime());\n-    } else if (state instanceof DecimalType) {\n-      value = ((DecimalType) state).toBigDecimal().toString();\n+    if (state instanceof DecimalType) {\n+    \tvalue = ((DecimalType) state).toBigDecimal().toString();\n+    } else if (state instanceof PercentType) {\n+    \tvalue = ((PercentType) state).toBigDecimal().toString();\n     } else if (state instanceof OnOffType) {\n-      value = ((OnOffType) state) == OnOffType.ON ? DIGITAL_VALUE_ON : DIGITAL_VALUE_OFF;\n+    \tvalue = ((OnOffType) state) == OnOffType.ON ? DIGITAL_VALUE_ON : DIGITAL_VALUE_OFF;\n+    } else if (state instanceof OpenClosedType) {\n+    \tvalue = ((OpenClosedType) state) == OpenClosedType.OPEN ? DIGITAL_VALUE_OPEN : DIGITAL_VALUE_CLOSED;  \n+    } else if (state instanceof HSBType) {\n+    \tvalue = ((HSBType) state).getConstituents().toString();","path":"bundles/persistence/org.openhab.persistence.influxdb/java/org/openhab/persistence/influxdb/internal/InfluxDBPersistenceService.java","position":104,"original_position":104,"commit_id":"c35bcb3cc59c3616d9f3491ca3b8d6aa4647350c","original_commit_id":"c35bcb3cc59c3616d9f3491ca3b8d6aa4647350c","user":{"login":"theoweiss","id":4682281,"avatar_url":"https://avatars.githubusercontent.com/u/4682281?v=3","gravatar_id":"","url":"https://api.github.com/users/theoweiss","html_url":"https://github.com/theoweiss","followers_url":"https://api.github.com/users/theoweiss/followers","following_url":"https://api.github.com/users/theoweiss/following{/other_user}","gists_url":"https://api.github.com/users/theoweiss/gists{/gist_id}","starred_url":"https://api.github.com/users/theoweiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theoweiss/subscriptions","organizations_url":"https://api.github.com/users/theoweiss/orgs","repos_url":"https://api.github.com/users/theoweiss/repos","events_url":"https://api.github.com/users/theoweiss/events{/privacy}","received_events_url":"https://api.github.com/users/theoweiss/received_events","type":"User","site_admin":false},"body":"use ((HSBType) state).toString()","created_at":"2015-05-17T08:35:45Z","updated_at":"2015-05-17T08:35:45Z","html_url":"https://github.com/openhab/openhab/pull/2519#discussion_r30468541","pull_request_url":"https://api.github.com/repos/openhab/openhab/pulls/2519","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments/30468541"},"html":{"href":"https://github.com/openhab/openhab/pull/2519#discussion_r30468541"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2519"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab/pulls/2519","id":34410677,"html_url":"https://github.com/openhab/openhab/pull/2519","diff_url":"https://github.com/openhab/openhab/pull/2519.diff","patch_url":"https://github.com/openhab/openhab/pull/2519.patch","issue_url":"https://api.github.com/repos/openhab/openhab/issues/2519","number":2519,"state":"open","locked":false,"title":"Fix for issue 2502: InfluxDB binding throws (uncaught) NumberFormatException when value is string","user":{"login":"Chel","id":3089621,"avatar_url":"https://avatars.githubusercontent.com/u/3089621?v=3","gravatar_id":"","url":"https://api.github.com/users/Chel","html_url":"https://github.com/Chel","followers_url":"https://api.github.com/users/Chel/followers","following_url":"https://api.github.com/users/Chel/following{/other_user}","gists_url":"https://api.github.com/users/Chel/gists{/gist_id}","starred_url":"https://api.github.com/users/Chel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chel/subscriptions","organizations_url":"https://api.github.com/users/Chel/orgs","repos_url":"https://api.github.com/users/Chel/repos","events_url":"https://api.github.com/users/Chel/events{/privacy}","received_events_url":"https://api.github.com/users/Chel/received_events","type":"User","site_admin":false},"body":"This allows the retrieval of String items from the InfluxDB. Tested against XBMC String items.","created_at":"2015-04-29T22:01:06Z","updated_at":"2015-05-17T08:35:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8590c7c55cd79a09e4578cd911bc9cb694e65780","assignee":{"login":"theoweiss","id":4682281,"avatar_url":"https://avatars.githubusercontent.com/u/4682281?v=3","gravatar_id":"","url":"https://api.github.com/users/theoweiss","html_url":"https://github.com/theoweiss","followers_url":"https://api.github.com/users/theoweiss/followers","following_url":"https://api.github.com/users/theoweiss/following{/other_user}","gists_url":"https://api.github.com/users/theoweiss/gists{/gist_id}","starred_url":"https://api.github.com/users/theoweiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theoweiss/subscriptions","organizations_url":"https://api.github.com/users/theoweiss/orgs","repos_url":"https://api.github.com/users/theoweiss/repos","events_url":"https://api.github.com/users/theoweiss/events{/privacy}","received_events_url":"https://api.github.com/users/theoweiss/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/openhab/openhab/milestones/7","html_url":"https://github.com/openhab/openhab/milestones/1.7.0","labels_url":"https://api.github.com/repos/openhab/openhab/milestones/7/labels","id":865837,"number":7,"title":"1.7.0","description":"","creator":{"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},"open_issues":31,"closed_issues":242,"state":"open","created_at":"2014-11-13T22:14:40Z","updated_at":"2015-05-17T06:49:31Z","due_on":"2015-05-23T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/openhab/openhab/pulls/2519/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab/pulls/2519/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab/issues/2519/comments","statuses_url":"https://api.github.com/repos/openhab/openhab/statuses/c35bcb3cc59c3616d9f3491ca3b8d6aa4647350c","head":{"label":"Chel:master","ref":"master","sha":"c35bcb3cc59c3616d9f3491ca3b8d6aa4647350c","user":{"login":"Chel","id":3089621,"avatar_url":"https://avatars.githubusercontent.com/u/3089621?v=3","gravatar_id":"","url":"https://api.github.com/users/Chel","html_url":"https://github.com/Chel","followers_url":"https://api.github.com/users/Chel/followers","following_url":"https://api.github.com/users/Chel/following{/other_user}","gists_url":"https://api.github.com/users/Chel/gists{/gist_id}","starred_url":"https://api.github.com/users/Chel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chel/subscriptions","organizations_url":"https://api.github.com/users/Chel/orgs","repos_url":"https://api.github.com/users/Chel/repos","events_url":"https://api.github.com/users/Chel/events{/privacy}","received_events_url":"https://api.github.com/users/Chel/received_events","type":"User","site_admin":false},"repo":{"id":34814728,"name":"openhab","full_name":"Chel/openhab","owner":{"login":"Chel","id":3089621,"avatar_url":"https://avatars.githubusercontent.com/u/3089621?v=3","gravatar_id":"","url":"https://api.github.com/users/Chel","html_url":"https://github.com/Chel","followers_url":"https://api.github.com/users/Chel/followers","following_url":"https://api.github.com/users/Chel/following{/other_user}","gists_url":"https://api.github.com/users/Chel/gists{/gist_id}","starred_url":"https://api.github.com/users/Chel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chel/subscriptions","organizations_url":"https://api.github.com/users/Chel/orgs","repos_url":"https://api.github.com/users/Chel/repos","events_url":"https://api.github.com/users/Chel/events{/privacy}","received_events_url":"https://api.github.com/users/Chel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Chel/openhab","description":"Source code of the open Home Automation Bus (openHAB)","fork":true,"url":"https://api.github.com/repos/Chel/openhab","forks_url":"https://api.github.com/repos/Chel/openhab/forks","keys_url":"https://api.github.com/repos/Chel/openhab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chel/openhab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chel/openhab/teams","hooks_url":"https://api.github.com/repos/Chel/openhab/hooks","issue_events_url":"https://api.github.com/repos/Chel/openhab/issues/events{/number}","events_url":"https://api.github.com/repos/Chel/openhab/events","assignees_url":"https://api.github.com/repos/Chel/openhab/assignees{/user}","branches_url":"https://api.github.com/repos/Chel/openhab/branches{/branch}","tags_url":"https://api.github.com/repos/Chel/openhab/tags","blobs_url":"https://api.github.com/repos/Chel/openhab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chel/openhab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chel/openhab/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chel/openhab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chel/openhab/statuses/{sha}","languages_url":"https://api.github.com/repos/Chel/openhab/languages","stargazers_url":"https://api.github.com/repos/Chel/openhab/stargazers","contributors_url":"https://api.github.com/repos/Chel/openhab/contributors","subscribers_url":"https://api.github.com/repos/Chel/openhab/subscribers","subscription_url":"https://api.github.com/repos/Chel/openhab/subscription","commits_url":"https://api.github.com/repos/Chel/openhab/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chel/openhab/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chel/openhab/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chel/openhab/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chel/openhab/contents/{+path}","compare_url":"https://api.github.com/repos/Chel/openhab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chel/openhab/merges","archive_url":"https://api.github.com/repos/Chel/openhab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chel/openhab/downloads","issues_url":"https://api.github.com/repos/Chel/openhab/issues{/number}","pulls_url":"https://api.github.com/repos/Chel/openhab/pulls{/number}","milestones_url":"https://api.github.com/repos/Chel/openhab/milestones{/number}","notifications_url":"https://api.github.com/repos/Chel/openhab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chel/openhab/labels{/name}","releases_url":"https://api.github.com/repos/Chel/openhab/releases{/id}","created_at":"2015-04-29T19:47:11Z","updated_at":"2015-04-29T21:58:52Z","pushed_at":"2015-05-16T11:35:58Z","git_url":"git://github.com/Chel/openhab.git","ssh_url":"git@github.com:Chel/openhab.git","clone_url":"https://github.com/Chel/openhab.git","svn_url":"https://github.com/Chel/openhab","homepage":null,"size":155134,"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":"9fdbbb705c58692928a28d0717c12e96b44c8299","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-05-16T20:30:29Z","pushed_at":"2015-05-17T07:24:02Z","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":234159,"stargazers_count":1355,"watchers_count":1355,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":794,"mirror_url":null,"open_issues_count":464,"forks":794,"open_issues":464,"watchers":1355,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2519"},"html":{"href":"https://github.com/openhab/openhab/pull/2519"},"issue":{"href":"https://api.github.com/repos/openhab/openhab/issues/2519"},"comments":{"href":"https://api.github.com/repos/openhab/openhab/issues/2519/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2519/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab/pulls/2519/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab/statuses/c35bcb3cc59c3616d9f3491ca3b8d6aa4647350c"}}}}