Update Secondaryinfo-entity-row

This commit is contained in:
dfcarvajal
2020-12-27 17:42:08 +01:00
parent 87f73454aa
commit 74e8517f16

View File

@@ -1,7 +1,7 @@
customElements.whenDefined('card-tools').then(() => { customElements.whenDefined('card-tools').then(() => {
class SecondaryInfoEntityRow extends cardTools.LitElement { class SecondaryInfoEntityRow extends cardTools.LitElement {
version() { return "0.3.1"; } version() { return "0.4"; }
render() { render() {
return cardTools.LitHtml` return cardTools.LitHtml`
@@ -10,7 +10,7 @@ customElements.whenDefined('card-tools').then(() => {
} }
setConfig(config) { setConfig(config) {
cardTools.checkVersion(0.4); cardTools.checkVersion(2.0);
this._config = config; this._config = config;
this._wrappedElement = this._createElement(config); this._wrappedElement = this._createElement(config);
this.requestUpdate(); this.requestUpdate();
@@ -24,7 +24,8 @@ customElements.whenDefined('card-tools').then(() => {
_createElement(config) { _createElement(config) {
// Override the custom row type in order to create the 'standard' row for this entity // Override the custom row type in order to create the 'standard' row for this entity
let defaultRowConfig = Object.assign(config, {type: "default"}); let defaultRowConfig = Object.assign({}, config);
delete defaultRowConfig.type;
const element = cardTools.createEntityRow(defaultRowConfig); const element = cardTools.createEntityRow(defaultRowConfig);
return element; return element;
} }