{"action":"created","comment":{"url":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/comments/205933899","pull_request_review_id":141308342,"id":205933899,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTkzMzg5OQ==","diff_hunk":"@@ -115,16 +115,26 @@ class CircleSensorCard extends LitElement {\n     const container = this._root.querySelector('.labelContainer');\n     container.style.color = this.config.font_color || 'var(--primary-text-color)';\n     container.style.fontSize = this.config.font_size || '1em';\n+    container.style.fontFamily = this.config.font_family || '';\n+    container.style.textShadow = this.config.text_shadow || '';\n   }\n \n   set hass(hass) {\n     this.state = hass.states[this.config.entity];\n-    if (!this.state || isNaN(this.state.state)) {\n-      console.error(`State is not a number: ${this.state.state}`);\n-      return;\n+    \n+    if (this.config.attribute) {\n+      if (!this.state.attributes[this.config.attribute] || isNaN(this.state.attributes[this.config.attribute].replace(/,/g,\"\"))) {\n+        console.error(`Attribute [${this.config.attribute}] is not a number: ${this.state.state}`);\n+        return;\n+      }\n+    } else {\n+      if (!this.state || isNaN(this.state.state.replace(/,/g,\"\"))) {\n+        console.error(`State is not a number: ${this.state.state}`);\n+        return;\n+      }\n     }\n-    const state = this.state.state;\n \n+    const state = this.config.attribute ? this.state.attributes[this.config.attribute].replace(/,/g,\"\") : this.state.state.replace(/,/g,\"\");","path":"circle-sensor-card.js","position":38,"original_position":38,"commit_id":"726de5dd808c3c71c85beae5f7f1c8875a8411fc","original_commit_id":"726de5dd808c3c71c85beae5f7f1c8875a8411fc","user":{"login":"jeradM","id":11150179,"node_id":"MDQ6VXNlcjExMTUwMTc5","avatar_url":"https://avatars3.githubusercontent.com/u/11150179?v=4","gravatar_id":"","url":"https://api.github.com/users/jeradM","html_url":"https://github.com/jeradM","followers_url":"https://api.github.com/users/jeradM/followers","following_url":"https://api.github.com/users/jeradM/following{/other_user}","gists_url":"https://api.github.com/users/jeradM/gists{/gist_id}","starred_url":"https://api.github.com/users/jeradM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeradM/subscriptions","organizations_url":"https://api.github.com/users/jeradM/orgs","repos_url":"https://api.github.com/users/jeradM/repos","events_url":"https://api.github.com/users/jeradM/events{/privacy}","received_events_url":"https://api.github.com/users/jeradM/received_events","type":"User","site_admin":false},"body":"This line is getting a little long. Break on ? and :","created_at":"2018-07-28T05:45:16Z","updated_at":"2018-07-28T05:47:20Z","html_url":"https://github.com/custom-cards/circle-sensor-card/pull/7#discussion_r205933899","pull_request_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/comments/205933899"},"html":{"href":"https://github.com/custom-cards/circle-sensor-card/pull/7#discussion_r205933899"},"pull_request":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7","id":204006162,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MDA2MTYy","html_url":"https://github.com/custom-cards/circle-sensor-card/pull/7","diff_url":"https://github.com/custom-cards/circle-sensor-card/pull/7.diff","patch_url":"https://github.com/custom-cards/circle-sensor-card/pull/7.patch","issue_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/issues/7","number":7,"state":"open","locked":false,"title":"Additional font configurations, handling commas, units and using attribute for display","user":{"login":"iantrich","id":1287159,"node_id":"MDQ6VXNlcjEyODcxNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1287159?v=4","gravatar_id":"","url":"https://api.github.com/users/iantrich","html_url":"https://github.com/iantrich","followers_url":"https://api.github.com/users/iantrich/followers","following_url":"https://api.github.com/users/iantrich/following{/other_user}","gists_url":"https://api.github.com/users/iantrich/gists{/gist_id}","starred_url":"https://api.github.com/users/iantrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iantrich/subscriptions","organizations_url":"https://api.github.com/users/iantrich/orgs","repos_url":"https://api.github.com/users/iantrich/repos","events_url":"https://api.github.com/users/iantrich/events{/privacy}","received_events_url":"https://api.github.com/users/iantrich/received_events","type":"User","site_admin":false},"body":"PR for the following issues:\r\n[Units of meausrement](https://github.com/custom-cards/circle-sensor-card/issues/2)\r\n[Handling commas](https://github.com/custom-cards/circle-sensor-card/issues/5)\r\n[Using attribute instead of state](https://github.com/custom-cards/circle-sensor-card/issues/6)\r\n[Support font_family](https://github.com/custom-cards/circle-sensor-card/issues/4)\r\n[Support text_shadow](https://github.com/custom-cards/circle-sensor-card/issues/3)\r\n\r\nI am not a web dev (C++) so hopefully I didn't botch these too bad :)","created_at":"2018-07-26T01:37:44Z","updated_at":"2018-07-28T05:47:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8ec7d4d7a587ddb71c716204136eff911072c93","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7/commits","review_comments_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7/comments","review_comment_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/comments{/number}","comments_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/issues/7/comments","statuses_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/statuses/726de5dd808c3c71c85beae5f7f1c8875a8411fc","head":{"label":"iantrich:font-shadow","ref":"font-shadow","sha":"726de5dd808c3c71c85beae5f7f1c8875a8411fc","user":{"login":"iantrich","id":1287159,"node_id":"MDQ6VXNlcjEyODcxNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1287159?v=4","gravatar_id":"","url":"https://api.github.com/users/iantrich","html_url":"https://github.com/iantrich","followers_url":"https://api.github.com/users/iantrich/followers","following_url":"https://api.github.com/users/iantrich/following{/other_user}","gists_url":"https://api.github.com/users/iantrich/gists{/gist_id}","starred_url":"https://api.github.com/users/iantrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iantrich/subscriptions","organizations_url":"https://api.github.com/users/iantrich/orgs","repos_url":"https://api.github.com/users/iantrich/repos","events_url":"https://api.github.com/users/iantrich/events{/privacy}","received_events_url":"https://api.github.com/users/iantrich/received_events","type":"User","site_admin":false},"repo":{"id":142362085,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIzNjIwODU=","name":"circle-sensor-card","full_name":"iantrich/circle-sensor-card","owner":{"login":"iantrich","id":1287159,"node_id":"MDQ6VXNlcjEyODcxNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1287159?v=4","gravatar_id":"","url":"https://api.github.com/users/iantrich","html_url":"https://github.com/iantrich","followers_url":"https://api.github.com/users/iantrich/followers","following_url":"https://api.github.com/users/iantrich/following{/other_user}","gists_url":"https://api.github.com/users/iantrich/gists{/gist_id}","starred_url":"https://api.github.com/users/iantrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iantrich/subscriptions","organizations_url":"https://api.github.com/users/iantrich/orgs","repos_url":"https://api.github.com/users/iantrich/repos","events_url":"https://api.github.com/users/iantrich/events{/privacy}","received_events_url":"https://api.github.com/users/iantrich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iantrich/circle-sensor-card","description":"A custom component for displaying sensor values as cards or elements","fork":true,"url":"https://api.github.com/repos/iantrich/circle-sensor-card","forks_url":"https://api.github.com/repos/iantrich/circle-sensor-card/forks","keys_url":"https://api.github.com/repos/iantrich/circle-sensor-card/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iantrich/circle-sensor-card/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iantrich/circle-sensor-card/teams","hooks_url":"https://api.github.com/repos/iantrich/circle-sensor-card/hooks","issue_events_url":"https://api.github.com/repos/iantrich/circle-sensor-card/issues/events{/number}","events_url":"https://api.github.com/repos/iantrich/circle-sensor-card/events","assignees_url":"https://api.github.com/repos/iantrich/circle-sensor-card/assignees{/user}","branches_url":"https://api.github.com/repos/iantrich/circle-sensor-card/branches{/branch}","tags_url":"https://api.github.com/repos/iantrich/circle-sensor-card/tags","blobs_url":"https://api.github.com/repos/iantrich/circle-sensor-card/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iantrich/circle-sensor-card/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iantrich/circle-sensor-card/git/refs{/sha}","trees_url":"https://api.github.com/repos/iantrich/circle-sensor-card/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iantrich/circle-sensor-card/statuses/{sha}","languages_url":"https://api.github.com/repos/iantrich/circle-sensor-card/languages","stargazers_url":"https://api.github.com/repos/iantrich/circle-sensor-card/stargazers","contributors_url":"https://api.github.com/repos/iantrich/circle-sensor-card/contributors","subscribers_url":"https://api.github.com/repos/iantrich/circle-sensor-card/subscribers","subscription_url":"https://api.github.com/repos/iantrich/circle-sensor-card/subscription","commits_url":"https://api.github.com/repos/iantrich/circle-sensor-card/commits{/sha}","git_commits_url":"https://api.github.com/repos/iantrich/circle-sensor-card/git/commits{/sha}","comments_url":"https://api.github.com/repos/iantrich/circle-sensor-card/comments{/number}","issue_comment_url":"https://api.github.com/repos/iantrich/circle-sensor-card/issues/comments{/number}","contents_url":"https://api.github.com/repos/iantrich/circle-sensor-card/contents/{+path}","compare_url":"https://api.github.com/repos/iantrich/circle-sensor-card/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iantrich/circle-sensor-card/merges","archive_url":"https://api.github.com/repos/iantrich/circle-sensor-card/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iantrich/circle-sensor-card/downloads","issues_url":"https://api.github.com/repos/iantrich/circle-sensor-card/issues{/number}","pulls_url":"https://api.github.com/repos/iantrich/circle-sensor-card/pulls{/number}","milestones_url":"https://api.github.com/repos/iantrich/circle-sensor-card/milestones{/number}","notifications_url":"https://api.github.com/repos/iantrich/circle-sensor-card/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iantrich/circle-sensor-card/labels{/name}","releases_url":"https://api.github.com/repos/iantrich/circle-sensor-card/releases{/id}","deployments_url":"https://api.github.com/repos/iantrich/circle-sensor-card/deployments","created_at":"2018-07-25T23:00:39Z","updated_at":"2018-07-25T23:00:41Z","pushed_at":"2018-07-26T01:34:57Z","git_url":"git://github.com/iantrich/circle-sensor-card.git","ssh_url":"git@github.com:iantrich/circle-sensor-card.git","clone_url":"https://github.com/iantrich/circle-sensor-card.git","svn_url":"https://github.com/iantrich/circle-sensor-card","homepage":null,"size":75,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"custom-cards:master","ref":"master","sha":"a198c7f76440e8d32c9afa33a8a7e0e43904113f","user":{"login":"custom-cards","id":40870129,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwODcwMTI5","avatar_url":"https://avatars0.githubusercontent.com/u/40870129?v=4","gravatar_id":"","url":"https://api.github.com/users/custom-cards","html_url":"https://github.com/custom-cards","followers_url":"https://api.github.com/users/custom-cards/followers","following_url":"https://api.github.com/users/custom-cards/following{/other_user}","gists_url":"https://api.github.com/users/custom-cards/gists{/gist_id}","starred_url":"https://api.github.com/users/custom-cards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/custom-cards/subscriptions","organizations_url":"https://api.github.com/users/custom-cards/orgs","repos_url":"https://api.github.com/users/custom-cards/repos","events_url":"https://api.github.com/users/custom-cards/events{/privacy}","received_events_url":"https://api.github.com/users/custom-cards/received_events","type":"Organization","site_admin":false},"repo":{"id":141952963,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE5NTI5NjM=","name":"circle-sensor-card","full_name":"custom-cards/circle-sensor-card","owner":{"login":"custom-cards","id":40870129,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwODcwMTI5","avatar_url":"https://avatars0.githubusercontent.com/u/40870129?v=4","gravatar_id":"","url":"https://api.github.com/users/custom-cards","html_url":"https://github.com/custom-cards","followers_url":"https://api.github.com/users/custom-cards/followers","following_url":"https://api.github.com/users/custom-cards/following{/other_user}","gists_url":"https://api.github.com/users/custom-cards/gists{/gist_id}","starred_url":"https://api.github.com/users/custom-cards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/custom-cards/subscriptions","organizations_url":"https://api.github.com/users/custom-cards/orgs","repos_url":"https://api.github.com/users/custom-cards/repos","events_url":"https://api.github.com/users/custom-cards/events{/privacy}","received_events_url":"https://api.github.com/users/custom-cards/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/custom-cards/circle-sensor-card","description":"A custom component for displaying sensor values as cards or elements","fork":false,"url":"https://api.github.com/repos/custom-cards/circle-sensor-card","forks_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/forks","keys_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/keys{/key_id}","collaborators_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/teams","hooks_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/hooks","issue_events_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/issues/events{/number}","events_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/events","assignees_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/assignees{/user}","branches_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/branches{/branch}","tags_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/tags","blobs_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/git/refs{/sha}","trees_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/git/trees{/sha}","statuses_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/statuses/{sha}","languages_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/languages","stargazers_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/stargazers","contributors_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/contributors","subscribers_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/subscribers","subscription_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/subscription","commits_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/commits{/sha}","git_commits_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/git/commits{/sha}","comments_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/comments{/number}","issue_comment_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/issues/comments{/number}","contents_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/contents/{+path}","compare_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/compare/{base}...{head}","merges_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/merges","archive_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/downloads","issues_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/issues{/number}","pulls_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls{/number}","milestones_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/milestones{/number}","notifications_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/labels{/name}","releases_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/releases{/id}","deployments_url":"https://api.github.com/repos/custom-cards/circle-sensor-card/deployments","created_at":"2018-07-23T02:50:04Z","updated_at":"2018-07-26T12:22:04Z","pushed_at":"2018-07-26T01:37:44Z","git_url":"git://github.com/custom-cards/circle-sensor-card.git","ssh_url":"git@github.com:custom-cards/circle-sensor-card.git","clone_url":"https://github.com/custom-cards/circle-sensor-card.git","svn_url":"https://github.com/custom-cards/circle-sensor-card","homepage":null,"size":66,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2,"open_issues":6,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7"},"html":{"href":"https://github.com/custom-cards/circle-sensor-card/pull/7"},"issue":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/issues/7"},"comments":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/custom-cards/circle-sensor-card/statuses/726de5dd808c3c71c85beae5f7f1c8875a8411fc"}},"author_association":"NONE"}}
{"actor":{"display_login":"jeradM"}}