mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 23:06:40 +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 () {
|
||||
var attr;
|
||||
var attrRaw = this._stateAttributes.replace(/^\s+|\s+$/g, '')
|
||||
try {
|
||||
attr = this._stateAttributes ? JSON.parse(this._stateAttributes) : {};
|
||||
attr = attrRaw ?
|
||||
JSON.parse(attrRaw) : {};
|
||||
} catch (err) {
|
||||
/* eslint-disable no-alert */
|
||||
alert('Error parsing JSON: ' + err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user