From dd2b0b891cb80c363fcc175782e64dcdbd7b5972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Senart?= <> Date: Sun, 8 Dec 2024 16:47:17 +0100 Subject: [PATCH] Support without any errorMessage attribute --- dist/gazpar-card.js | 4 ++-- package.json | 2 +- src/gazpar-card.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/gazpar-card.js b/dist/gazpar-card.js index 69e0ba4..61cea71 100644 --- a/dist/gazpar-card.js +++ b/dist/gazpar-card.js @@ -202,7 +202,7 @@ ${this.config.title}
- `}renderError(e){if(!0===this.config.showError&&e.length>0)return t.dy`
+
`}renderError(e){if(!0===this.config.showError&&null!=e&&e.length>0)return t.dy`
${e.join("
")} @@ -210,7 +210,7 @@
`}renderVersion(e){if(!0===this.config.showVersion){var i=null!=e.source?e.source.name+" v"+e.source.version:"home-assistant-gazpar v"+e.version;return t.dy`
- Gazpar Card v${"1.3.11-alpha.2"} - ${i} + Gazpar Card v${"1.3.11-alpha.3"} - ${i}
`}}renderDailyHistory(e,i,s){if(s.showDailyHistory&&null!=e&&e.length>0){var n=s.asOfDate?Date.parseDate(s.asOfDate):Date.today(),o=e.slice().reverse().filter((t=>Date.parseDate(t.time_period)>=n.addDays(-7)));if(o.length>0)for(var r=Date.parseDate(o[o.length-1].time_period).addDays(1);o.length<7;)o.push({time_period:r.formatDate(),volume_m3:null,energy_kwh:null}),r=r.addDays(1);return t.dy`
diff --git a/package.json b/package.json index 523cb0c..50897c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lovelace-gazpar-card", - "version": "1.3.11-alpha.2", + "version": "1.3.11-alpha.3", "compatibleIntegrationVersion": "1.3.4", "compatibleGazpar2MQTTVersion": "0.1.0", "description": "GrDF Gazpar meter lovelace card for Home Assistant.", diff --git a/src/gazpar-card.js b/src/gazpar-card.js index d1904f8..f87e13c 100644 --- a/src/gazpar-card.js +++ b/src/gazpar-card.js @@ -546,7 +546,7 @@ export class GazparCard extends LitElement { //---------------------------------- renderError(errorMsg) { if (this.config.showError === true) { - if (errorMsg.length > 0){ + if (errorMsg != null && errorMsg.length > 0){ return html `