mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 02:06:42 +00:00
pretty-print object attributes in dev-state panel. (#195)
This commit is contained in:
parent
5a60694587
commit
05760f9c21
@ -188,10 +188,15 @@ Polymer({
|
||||
var i;
|
||||
var keys;
|
||||
var key;
|
||||
var value;
|
||||
|
||||
for (i = 0, keys = Object.keys(entity.attributes); i < keys.length; i++) {
|
||||
key = keys[i];
|
||||
output += key + ': ' + entity.attributes[key] + '\n';
|
||||
value = entity.attributes[key];
|
||||
if (!Array.isArray(value) && (value instanceof Object)) {
|
||||
value = JSON.stringify(value, null, ' ');
|
||||
}
|
||||
output += key + ': ' + value + '\n';
|
||||
}
|
||||
|
||||
return output;
|
||||
|
Loading…
x
Reference in New Issue
Block a user