diff --git a/hacs.json b/hacs.json new file mode 100644 index 0000000..6547396 --- /dev/null +++ b/hacs.json @@ -0,0 +1,5 @@ +{ + "name": "List Card", + "render_readme": true, + "filename": "list-card.js" +} diff --git a/list-card.js b/list-card.js index d6a6e5d..70c3029 100644 --- a/list-card.js +++ b/list-card.js @@ -1,3 +1,5 @@ +console.log(`%clist-card\n%cVersion: ${'0.0.1'}`, 'color: rebeccapurple; font-weight: bold;', ''); + class ListCard extends HTMLElement { constructor() { @@ -172,7 +174,7 @@ class ListCard extends HTMLElement { let newText = feed[entry][columns[column].field]; if (columns[column].hasOwnProperty('regex')) { - newText = new RegExp(columns[column].regex).exec(feed[entry][columns[column].field]); + newText = new RegExp(columns[column].regex, 'u').exec(feed[entry][columns[column].field]); } if (columns[column].hasOwnProperty('prefix')) { newText = columns[column].prefix + newText; @@ -215,3 +217,11 @@ class ListCard extends HTMLElement { } customElements.define('list-card', ListCard); + +window.customCards = window.customCards || []; +window.customCards.push({ + type: "list-card", + name: "List Card", + preview: false, + description: "The List Card generate table with data from sensor that provides data as a list of attributes." +});