mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
State Dev: Allow whitespace in state attributes
This commit is contained in:
parent
b9cf35cced
commit
7a4b6f7db9
@ -149,8 +149,10 @@ Polymer({
|
|||||||
|
|
||||||
handleSetState: function () {
|
handleSetState: function () {
|
||||||
var attr;
|
var attr;
|
||||||
|
var attrRaw = this._stateAttributes.replace(/^\s+|\s+$/g, '')
|
||||||
try {
|
try {
|
||||||
attr = this._stateAttributes ? JSON.parse(this._stateAttributes) : {};
|
attr = attrRaw ?
|
||||||
|
JSON.parse(attrRaw) : {};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
/* eslint-disable no-alert */
|
/* eslint-disable no-alert */
|
||||||
alert('Error parsing JSON: ' + err);
|
alert('Error parsing JSON: ' + err);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user