-
-
${St.required.name}
+
+
${mt.required.name}
-
${St.required.secondary}
+
${mt.required.secondary}
- ${St.required.show?F`
+ ${mt.required.show?M`
e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e)
.configValue=${"entity"}
>
- ${t.map((t=>F` ${t} `))}
+ ${t.map((t=>M` ${t} `))}
`:""}
-
-
${St.actions.name}
+
+
${mt.actions.name}
-
${St.actions.secondary}
+
${mt.actions.secondary}
- ${St.actions.show?F`
+ ${mt.actions.show?M`
-
-
${St.actions.options.tap.name}
+
+
${mt.actions.options.tap.name}
-
${St.actions.options.tap.secondary}
+
${mt.actions.options.tap.secondary}
- ${St.actions.options.tap.show?F`
+ ${mt.actions.options.tap.show?M`
Action Editors Coming Soon
`:""}
-
-
${St.actions.options.hold.name}
+
+
${mt.actions.options.hold.name}
-
${St.actions.options.hold.secondary}
+
${mt.actions.options.hold.secondary}
- ${St.actions.options.hold.show?F`
+ ${mt.actions.options.hold.show?M`
Action Editors Coming Soon
`:""}
-
-
${St.actions.options.double_tap.name}
+
+
${mt.actions.options.double_tap.name}
-
${St.actions.options.double_tap.secondary}
+
${mt.actions.options.double_tap.secondary}
- ${St.actions.options.double_tap.show?F`
+ ${mt.actions.options.double_tap.show?M`
Action Editors Coming Soon
@@ -112,12 +112,12 @@ const et=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e)
`:""}
-
-
${St.appearance.name}
+
+
${mt.appearance.name}
-
${St.appearance.secondary}
+
${mt.appearance.secondary}
- ${St.appearance.show?F`
+ ${mt.appearance.show?M`
e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e)
`:""}
- `}_initialize(){void 0!==this.hass&&void 0!==this._config&&void 0!==this._helpers&&(this._initialized=!0)}async loadCardHelpers(){this._helpers=await window.loadCardHelpers()}_toggleAction(t){this._toggleThing(t,St.actions.options)}_toggleOption(t){this._toggleThing(t,St)}_toggleThing(t,e){const i=!e[t.target.option].show;for(const[t]of Object.entries(e))e[t].show=!1;e[t.target.option].show=i,this._toggle=!this._toggle}_valueChanged(t){if(!this._config||!this.hass)return;const e=t.target;if(this[`_${e.configValue}`]!==e.value){if(e.configValue)if(""===e.value){const t=Object.assign({},this._config);delete t[e.configValue],this._config=t}else this._config=Object.assign(Object.assign({},this._config),{[e.configValue]:void 0!==e.checked?e.checked:e.value});$t(this,"config-changed",{config:this._config})}}static get styles(){return r`
+ `}_initialize(){void 0!==this.hass&&void 0!==this._config&&void 0!==this._helpers&&(this._initialized=!0)}async loadCardHelpers(){this._helpers=await window.loadCardHelpers()}_toggleAction(t){this._toggleThing(t,mt.actions.options)}_toggleOption(t){this._toggleThing(t,mt)}_toggleThing(t,e){const o=!e[t.target.option].show;for(const[t]of Object.entries(e))e[t].show=!1;e[t.target.option].show=o,this._toggle=!this._toggle}_valueChanged(t){if(!this._config||!this.hass)return;const e=t.target;if(this[`_${e.configValue}`]!==e.value){if(e.configValue)if(""===e.value){const t=Object.assign({},this._config);delete t[e.configValue],this._config=t}else this._config=Object.assign(Object.assign({},this._config),{[e.configValue]:void 0!==e.checked?e.checked:e.value});dt(this,"config-changed",{config:this._config})}}static get styles(){return r`
.option {
padding: 4px 0px;
cursor: pointer;
@@ -171,55 +171,55 @@ const et=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e)
ha-formfield {
padding-bottom: 8px;
}
- `}};t([ot({attribute:!1})],Et.prototype,"hass",void 0),t([st()],Et.prototype,"_config",void 0),t([st()],Et.prototype,"_toggle",void 0),t([st()],Et.prototype,"_helpers",void 0),Et=t([et("rpi-monitor-card-editor")],Et);class xt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const Tt="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class kt extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:Tt?"100px":"50px",height:Tt?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0}),{passive:!0})}))}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}));const i=t=>{let e,i;this.held=!1,t.touches?(e=t.touches[0].pageX,i=t.touches[0].pageY):(e=t.pageX,i=t.pageY),this.timer=window.setTimeout((()=>{this.startAnimation(e,i),this.held=!0}),this.holdTime)},o=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?$t(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,$t(t,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,$t(t,"action",{action:"double_tap"})):$t(t,"action",{action:"tap"}))};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("mousedown",i,{passive:!0}),t.addEventListener("click",o),t.addEventListener("keyup",(t=>{13===t.keyCode&&o(t)}))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.define("action-handler-rpi-monitor",kt);const Ut=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler-rpi-monitor"))return t.querySelector("action-handler-rpi-monitor");const e=document.createElement("action-handler-rpi-monitor");return t.appendChild(e),e})();i&&i.bind(t,e)},Dt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends xt{update(t,[e]){return Ut(t.element,e),P}render(t){}}),Rt="ifaces",Mt="ux_release",Ft="last_update",Pt="up_time",Ot="fs_total_gb",Nt="fs_free_prcnt",Vt="temperature_c",Ht="show-os-parts",zt="memory_percent";var Lt={version:"Version",invalid_configuration:"Invalid configuration",show_warning:"Show Warning",show_error:"Show Error"},jt={common:Lt},Bt=Object.freeze({__proto__:null,common:Lt,default:jt}),Gt={version:"Versjon",invalid_configuration:"Ikke gyldig konfiguration",show_warning:"Vis advarsel",show_error:"Vis feil"},Kt={common:Gt},qt=Object.freeze({__proto__:null,common:Gt,default:Kt}),Wt={version:"Version",invalid_configuration:"configuración no válida",show_warning:"Mostrar advertencia",show_error:"Mostrar error"},Yt={common:Wt};const Zt={en:Bt,es:Object.freeze({__proto__:null,common:Wt,default:Yt}),nb:qt};function Jt(t,e="",i=""){const o=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let s;try{s=t.split(".").reduce(((t,e)=>t[e]),Zt[o])}catch(e){s=t.split(".").reduce(((t,e)=>t[e]),Zt.en)}return void 0===s&&(s=t.split(".").reduce(((t,e)=>t[e]),Zt.en)),""!==e&&""!==i&&(s=s.replace(e,i)),s}console.info(`%c RPI-MONITOR-CARD \n%c ${Jt("common.version")} 1.3.1 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"rpi-monitor-card",name:"RPi Monitor Card",description:"A template custom card for you to create something awesome"});let Qt=class extends X{constructor(){super(...arguments),this._cardSecondsSinceUpdate=0,this._cardUpdateString="",this._firstTime=!0,this._sensorAvailable=!1,this._updateTimerID=void 0,this._configEntityId=void 0,this._hostname="",this._showFullCard=!0,this._useTempsInC=!0,this.kREPLACE_WITH_TEMP_UNITS="replace-with-temp-units",this.kMQTT_DAEMON_RELEASE_URL="https://raw.githubusercontent.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/master/Release",this.latestDaemonVersions=["v1.7.2","v1.6.1"],this.currentDaemonVersion="",this._showDebug=!1,this._cardFullElements={"Storage Use":Nt,Storage:Ot,"Memory Use":zt,Temperature:Vt,"Up-time":Pt,Updated:Ft,OS:Ht,Model:"rpi_model",Interfaces:Rt},this._cardFullIconNames={Storage:"sd","Storage Use":"file-percent","Memory Use":"memory",Temperature:"thermometer","Up-time":"clock-check-outline",Updated:"update",OS:"linux",Model:"raspberry-pi",Interfaces:""},this.kClassIdIconFSAvail="ico-fs-percent",this.kClassIdIconFSTotal="ico-fs-total",this.kClassIdIconSysTemp="ico-sys-temp",this.kClassIdIconUptime="ico-up-time",this.kClassIdIconUpdated="ico-last-update",this.kClassIdIconOS="ico-*nix",this.kClassIdIconRPiModel="ico-rpi-model",this.kClassIdIconInterfaces="ico-rpi-ifaces",this.kClassIdIconMemoryUsage="ico-memory-percent",this.kClassIdFSAvail="fs-percent",this.kClassIdFSTotal="fs-total",this.kClassIdSysTemp="sys-temp",this.kClassIdUptime="up-time",this.kClassIdUpdated="last-update",this.kClassIdOS="*nix",this.kClassIdRPiModel="rpi-model",this.kClassIdInterfaces="rpi-ifaces",this.kClassIdMemoryUsage="memory-percent",this.kClassIdTempScale="sys-temp-scale",this._cardFullCssIDs={"Storage Use":this.kClassIdFSAvail,Storage:this.kClassIdFSTotal,"Memory Use":this.kClassIdMemoryUsage,Temperature:this.kClassIdSysTemp,"Up-time":this.kClassIdUptime,Updated:this.kClassIdUpdated,OS:this.kClassIdOS,Model:this.kClassIdRPiModel,Interfaces:this.kClassIdInterfaces},this._cardFullIconCssIDs={"Storage Use":this.kClassIdIconFSAvail,Storage:this.kClassIdIconFSTotal,"Memory Use":this.kClassIdIconMemoryUsage,"Up-time":this.kClassIdIconUptime,Updated:this.kClassIdIconUpdated,Temperature:this.kClassIdIconSysTemp,OS:this.kClassIdIconOS,Model:this.kClassIdIconRPiModel,Interfaces:this.kClassIdIconInterfaces},this._cardGlanceElements={"%":Nt,GB:Ot,Mem:zt,"replace-with-temp-units":Vt,UpTime:Pt,Upd:Ft},this._cardGlanceIconNames={"%":"file-percent",GB:"sd",Mem:"memory","replace-with-temp-units":"thermometer",UpTime:"clock-check-outline",Upd:"update"},this._cardGlanceCssIDs={"%":this.kClassIdFSAvail,GB:this.kClassIdFSTotal,Mem:this.kClassIdMemoryUsage,"replace-with-temp-units":this.kClassIdSysTemp,UpTime:this.kClassIdUptime,Upd:this.kClassIdUpdated},this._cardGlanceIconCssIDs={"%":this.kClassIdIconFSAvail,GB:this.kClassIdIconFSTotal,Mem:this.kClassIdIconMemoryUsage,"replace-with-temp-units":this.kClassIdIconSysTemp,UpTime:this.kClassIdIconUptime,Upd:this.kClassIdIconUpdated},this._circleIconsValueByName={"circle-outline":0,"circle-slice-1":13,"circle-slice-2":25,"circle-slice-3":38,"circle-slice-4":50,"circle-slice-5":63,"circle-slice-6":75,"circle-slice-7":88,"circle-slice-8":100},this._colorUsedSpaceDefault=[{color:"default",from:0,to:59},{color:"yellow",from:60,to:84},{color:"red",from:85,to:100}],this._colorTemperatureDefault=[{color:"default",from:0,to:59},{color:"yellow",from:60,to:79},{color:"red",from:85,to:100}],this._colorReportPeriodsAgoDefault=[{color:"default",from:0,to:3},{color:"orange",from:4,to:5},{color:"red",from:6,to:100}],this._colorUsedMemoryDefault=[{color:"red",from:75,to:100},{color:"yellow",from:61,to:74},{color:"default",from:0,to:60}],this._colorReleaseDefault=[{color:"red",os:"stretch"},{color:"red",os:"jessie"},{color:"red",os:"wheezy"}]}static async getConfigElement(){return console.log("- getConfigElement()"),document.createElement("rpi-monitor-card-editor")}static getStubConfig(){return{}}setConfig(t){if(null!=t.show_debug&&(this._showDebug=t.show_debug||this._showDebug),this._showDebug&&console.log("- setConfig()"),!t||t.show_error)throw new Error(Jt("common.invalid_configuration"));if(null!=t.card_style){const e=t.card_style.toLocaleLowerCase();if("full"!=e&&"glance"!=e)throw console.log("Invalid configuration. INVALID card_style = ["+t.card_style+"]"),new Error("Illegal card_style: value (card_style: "+t.card_style+") must be [full or glance]");this._showFullCard="full"===t.card_style.toLocaleLowerCase()}if(null!=t.temp_scale){const e=t.temp_scale.toLocaleLowerCase();if("c"!=e&&"f"!=e)throw console.log("Invalid configuration. INVALID temp_scale = ["+t.temp_scale+"]"),new Error("Illegal temp_scale: value (temp_scale: "+t.temp_scale+") must be [F or C]");this._useTempsInC="c"===t.temp_scale.toLocaleLowerCase()}if(!t.entity)throw console.log("Invalid configuration. If no entity provided, you'll need to provide a remote entity"),new Error("You need to associate an entity");t.test_gui&&function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null}().setEditMode(!0),this._config=Object.assign({},t),console.log("- config=["+this._config+"]"),this._configEntityId=null!=this._config.entity?this._config.entity:void 0,this._updateSensorAvailability()}shouldUpdate(t){if(0==this._hostname.length||this._hostname==this._configEntityId){const t=this._getAttributeValueForKey("host_name");t&&t.length>0?this._hostname=t:this._hostname=this._configEntityId?this._configEntityId:"-not-set-"}let e=!0;if(this._updateSensorAvailability(),t.has("_config"))e=!0;else if(this.hass&&this._config){const i=t.get("hass");i&&this._configEntityId&&(e=i.states[this._configEntityId]!==this.hass.states[this._configEntityId])}return e}render(){if(this._showDebug&&console.log("- render("+this._hostname+")"),this._config.show_warning)return this.showWarning(Jt("common.show_warning"));if(this._config.show_error)return this.showError(Jt("common.show_error"));if(this._configEntityId&&!this._sensorAvailable){const t="Entity Unavailable: "+this._configEntityId;return this.showWarning(t)}const t=this._configEntityId?this.hass.states[this._configEntityId]:void 0;if(!this._configEntityId&&!t)return this.showWarning("Entity Unavailable");if(0==this._sensorAvailable)return void console.log("?? Render w/o sensor!! ("+this._hostname+")");let e=F``;this._firstTime&&(this._showDebug&&console.log("- stateObj: ["+t+"]"),this._startCardRefreshTimer(),this._showDebug&&console.log("- 1st-time _config: ["+this._config+"]"),this._firstTime=!1);const i=null==this._config.show_os_age||this._config.show_os_age,o=null==this._config.show_update_age||this._config.show_update_age,s=null==this._config.show_daemon_upd||this._config.show_daemon_upd,n=null==this._config.show_title||this._config.show_title;if(s){const t=this._getAttributeValueForKey("reporter").split(" ");this.currentDaemonVersion=t.length>1?t[1]:"";const e=this._getAttributeValueForKey("reporter_releases");if(e&&e.length>0&&"NOT-LOADED"!=e){const t=e.split(",");this.latestDaemonVersions=t}}const r=this._getAttributeValueForKey("fqdn"),a=1==i?this._getAttributeValueForKey(Mt):"",l=s?this._computeDaemonUpdMessage(this.currentDaemonVersion):"",c=1==o?this._cardUpdateString:"";let h="RPi monitor "+r;h=null!=this._config.name_prefix?this._config.name_prefix+" "+r:h,h=null!=this._config.name?this._config.name:h,0==n&&(h="");const d=0==n?"last-heard-full-notitle":"last-heard-full",u=0==n?"last-heard-notitle":"last-heard",p=0==n?"os-name-full-notitle":"os-name-full",m=0==n?"os-name-notitle":"os-name",_=0==n?"daemon-update-full-notitle":"daemon-update-full",f=0==n?"daemon-update-notitle":"daemon-update";if(this._showFullCard){const t=this._generateFullsizeCardRows();if(0==t.length||!t)return void console.log("ERROR: failed to generate full rows!");e=F`
+ `}};t([st({attribute:!1})],gt.prototype,"hass",void 0),t([nt()],gt.prototype,"_config",void 0),t([nt()],gt.prototype,"_toggle",void 0),t([nt()],gt.prototype,"_helpers",void 0),gt=t([ot("rpi-monitor-card-editor")],gt);class ft{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const vt="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class yt extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:vt?"100px":"50px",height:vt?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0}),{passive:!0})}))}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}));const o=t=>{let e,o;this.held=!1,t.touches?(e=t.touches[0].pageX,o=t.touches[0].pageY):(e=t.pageX,o=t.pageY),this.timer=window.setTimeout((()=>{this.startAnimation(e,o),this.held=!0}),this.holdTime)},i=o=>{o.preventDefault(),["touchend","touchcancel"].includes(o.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?dt(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===o.type&&o.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,dt(t,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,dt(t,"action",{action:"double_tap"})):dt(t,"action",{action:"tap"}))};t.addEventListener("touchstart",o,{passive:!0}),t.addEventListener("touchend",i),t.addEventListener("touchcancel",i),t.addEventListener("mousedown",o,{passive:!0}),t.addEventListener("click",i),t.addEventListener("keyup",(t=>{13===t.keyCode&&i(t)}))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.define("action-handler-rpi-monitor",yt);const $t=(t,e)=>{const o=(()=>{const t=document.body;if(t.querySelector("action-handler-rpi-monitor"))return t.querySelector("action-handler-rpi-monitor");const e=document.createElement("action-handler-rpi-monitor");return t.appendChild(e),e})();o&&o.bind(t,e)},wt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends ft{update(t,[e]){return $t(t.element,e),R}render(t){}}),bt="ico-fs-percent",At="ico-fs-total",Ct="ico-sys-temp",Et="ico-up-time",xt="ico-last-update",St="ico-memory-percent",Ut="fs-percent",It="fs-total",Tt="sys-temp",Dt="up-time",Pt="last-update",kt="memory-percent",Ot="sys-temp-scale",Mt="ifaces",Rt="ux_release",Nt="last_update",Vt="up_time",Ht="fs_total_gb",Ft="fs_free_prcnt",zt="temperature_c",Lt="show-os-parts",jt="memory_percent";class Bt{constructor(){this._showColorDebug=!1,this._circleIconsValueByName={"circle-outline":0,"circle-slice-1":13,"circle-slice-2":25,"circle-slice-3":38,"circle-slice-4":50,"circle-slice-5":63,"circle-slice-6":75,"circle-slice-7":88,"circle-slice-8":100},this._colorUsedSpaceDefault=[{color:"default",from:0,to:59},{color:"orange",from:60,to:84},{color:"red",from:85,to:100}],this._colorTemperatureDefault=[{color:"default",from:0,to:59},{color:"orange",from:60,to:79},{color:"red",from:85,to:100}],this._colorReportPeriodsAgoDefault=[{color:"default",from:0,to:3},{color:"orange",from:4,to:5},{color:"red",from:6,to:100}],this._colorUsedMemoryDefault=[{color:"red",from:75,to:100},{color:"orange",from:61,to:74},{color:"default",from:0,to:60}],this._colorReleaseDefault=[{color:"red",os:"stretch"},{color:"red",os:"jessie"},{color:"red",os:"wheezy"}]}getIconNameForPercent(t){let e="";for(const o in this._circleIconsValueByName){if(t<=this._circleIconsValueByName[o]){e=o;break}}return e}calculateReporterAgeColor(t){let e;return this._colorReportPeriodsAgoDefault.forEach((o=>{t>=o.from&&t<=o.to&&(e=o.color)})),null!=e&&"default"!=e||(e=""),e}calculateTemperatureColor(t,e){const o=Number(t),i=e||this._colorTemperatureDefault;let s;if(isNaN(o)||i.forEach((e=>{if(o>=e.from&&o<=e.to&&(s=e.color,this._showColorDebug)){const o="_calculateTemperatureColor() - value=["+t+"] matched(from="+e.from+", to="+e.to+", color="+s+")";console.log(o)}})),this._showColorDebug){const e="_calculateTemperatureColor() - value=["+t+"] returns(color="+s+")";console.log(e)}return null!=s&&"default"!=s||(s=""),s}calculateFileSystemUsageColor(t,e){const o=Number(t),i=e||this._colorUsedSpaceDefault;let s;if(isNaN(o)||i.forEach((e=>{if(o>=e.from&&o<=e.to&&(s=e.color,this._showColorDebug)){const o="_calculateFileSystemUsageColor() - value=["+t+"] matched(from="+e.from+", to="+e.to+", color="+s+")";console.log(o)}})),this._showColorDebug){const e="_calculateFileSystemUsageColor() - value=["+t+"] returns(color="+s+")";console.log(e)}return null!=s&&"default"!=s||(s=""),s}calculateMemoryUsageColor(t,e){const o=Number(t),i=e||this._colorUsedMemoryDefault;let s;if(isNaN(o)||i.forEach((e=>{if(o>=e.from&&o<=e.to&&(s=e.color,this._showColorDebug)){const o="_calculateMemoryUsageColor() - value=["+t+"] matched(from="+e.from+", to="+e.to+", color="+s+")";console.log(o)}})),this._showColorDebug){const e="_calculateMemoryUsageColor() - value=["+t+"] returns(color="+s+")";console.log(e)}return null!=s&&"default"!=s||(s=""),s}calculateOsReleaseColor(t,e){const o=e||this._colorReleaseDefault;let i="default";return o.forEach((e=>{t===e.os&&(i=e.color,this._showColorDebug&&console.log("calculateOsReleaseColor() - value=["+t+"] matched(os="+e.os+", color="+i+")"))})),this._showColorDebug&&console.log("calculateOsReleaseColor() - value=["+t+"] returns(color="+i+")"),null!=i&&"default"!=i||(i=""),i}calculateDaemonUpdateVersionColor(t,e){let o;if(o=e.length>0&&""!=t?e[0]==t?"default":e.includes(t)?"orange":"red":"orange",this._showColorDebug){const e="calculateDaemonUpdateVersionColor() - value=["+t+"] returns(color="+o+")";console.log(e)}return null!=o&&"default"!=o||(o=""),o}}var Kt={version:"Version",invalid_configuration:"Invalid configuration",show_warning:"Show Warning",show_error:"Show Error"},Gt={common:Kt},qt=Object.freeze({__proto__:null,common:Kt,default:Gt}),Wt={version:"Versjon",invalid_configuration:"Ikke gyldig konfiguration",show_warning:"Vis advarsel",show_error:"Vis feil"},Xt={common:Wt},Yt=Object.freeze({__proto__:null,common:Wt,default:Xt}),Jt={version:"Version",invalid_configuration:"configuración no válida",show_warning:"Mostrar advertencia",show_error:"Mostrar error"},Zt={common:Jt};const Qt={en:qt,es:Object.freeze({__proto__:null,common:Jt,default:Zt}),nb:Yt};function te(t,e="",o=""){const i=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let s;try{s=t.split(".").reduce(((t,e)=>t[e]),Qt[i])}catch(e){s=t.split(".").reduce(((t,e)=>t[e]),Qt.en)}return void 0===s&&(s=t.split(".").reduce(((t,e)=>t[e]),Qt.en)),""!==e&&""!==o&&(s=s.replace(e,o)),s}console.info(`%c RPI-MONITOR-CARD \n%c ${te("common.version")} 1.3.2 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"rpi-monitor-card",name:"RPi Monitor Card",description:"A template custom card for you to create something awesome"});let ee=class extends tt{constructor(){super(...arguments),this._cardMinutesSinceUpdate=0,this._firstTime=!0,this._stateInfoAvailable=!1,this._updateTimerID=void 0,this._configEntityId=void 0,this._hostname="",this._showFullCard=!0,this._useTempsInC=!0,this.kREPLACE_WITH_TEMP_UNITS="replace-with-temp-units",this.latestDaemonVersions=["v1.7.2","v1.6.1"],this.currentDaemonVersion="",this._showOsAge=!0,this._showCardAge=!0,this._showDaemonUpdNeed=!0,this._showCardName=!0,this._showDebug=!1,this.colorHelpers=new Bt,this._cardFullElements={"Storage Use":Ft,Storage:Ht,"Memory Use":jt,Temperature:zt,"Up-time":Vt,Updated:Nt,OS:Lt,Model:"rpi_model",Interfaces:Mt},this._cardFullIconNames={"Storage Use":"file-percent",Storage:"sd","Memory Use":"memory",Temperature:"thermometer","Up-time":"clock-check-outline",Updated:"update",OS:"linux",Model:"raspberry-pi",Interfaces:""},this._cardFullCssIDs={"Storage Use":Ut,Storage:It,"Memory Use":kt,Temperature:Tt,"Up-time":Dt,Updated:Pt,OS:"*nix",Model:"rpi-model",Interfaces:"rpi-ifaces"},this._cardFullIconCssIDs={"Storage Use":bt,Storage:At,"Memory Use":St,Temperature:Ct,"Up-time":Et,Updated:xt,OS:"ico-*nix",Model:"ico-rpi-model",Interfaces:"ico-rpi-ifaces"},this._cardGlanceElements={"%":Ft,GB:Ht,Mem:jt,"replace-with-temp-units":zt,UpTime:Vt,Upd:Nt},this._cardGlanceIconNames={"%":"file-percent",GB:"sd",Mem:"memory","replace-with-temp-units":"thermometer",UpTime:"clock-check-outline",Upd:"update"},this._cardGlanceCssIDs={"%":Ut,GB:It,Mem:kt,"replace-with-temp-units":Tt,UpTime:Dt,Upd:Pt},this._cardGlanceIconCssIDs={"%":bt,GB:At,Mem:St,"replace-with-temp-units":Ct,UpTime:Et,Upd:xt}}static async getConfigElement(){return console.log("- getConfigElement()"),document.createElement("rpi-monitor-card-editor")}static getStubConfig(){return{}}setConfig(t){if(null!=t.show_debug&&(this._showDebug=t.show_debug||this._showDebug),this._showDebug&&console.log("- setConfig()"),!t||t.show_error)throw new Error(te("common.invalid_configuration"));if(!t.entity)throw console.log("Invalid configuration. If no entity provided, you'll need to provide a remote entity"),new Error("You need to associate an entity");if(null!=t.card_style){const e=t.card_style.toLocaleLowerCase();if("full"!=e&&"glance"!=e)throw console.log("Invalid configuration. INVALID card_style = ["+t.card_style+"]"),new Error("Illegal card_style: value (card_style: "+t.card_style+") must be [full or glance]");this._showFullCard="full"===t.card_style.toLocaleLowerCase()}if(null!=t.temp_scale){const e=t.temp_scale.toLocaleLowerCase();if("c"!=e&&"f"!=e)throw console.log("Invalid configuration. INVALID temp_scale = ["+t.temp_scale+"]"),new Error("Illegal temp_scale: value (temp_scale: "+t.temp_scale+") must be [F or C]");this._useTempsInC="c"===t.temp_scale.toLocaleLowerCase()}t.test_gui&&function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null}().setEditMode(!0),this._showOsAge=!t.show_os_age||t.show_os_age,this._showCardAge=!t.show_update_age||t.show_update_age,this._showDaemonUpdNeed=!t.show_daemon_upd||t.show_daemon_upd,this._showCardName=!t.show_title||t.show_title,this._config=Object.assign({},t),console.log("- config=["+this._config+"]"),this._configEntityId=null!=this._config.entity?this._config.entity:void 0,this._ensureStateInfoAvail()}shouldUpdate(t){if(this._ensureStateInfoAvail(),this._ensureWeHaveHostName(),this._debugShowProps(t,"shouldUpdate"),!this._config)return console.log(" - SU ABORT, no config"),!1;let e=!1;if(t.has("_config"))console.log(" - SU config present"),e=!0;else if(t.has("_cardMinutesSinceUpdate"))console.log(" - SU card last updated changed"),e=!0;else if(this.hass&&this._config&&t.has("hass")){const o=t.get("hass");o&&this._configEntityId&&(e=o.states[this._configEntityId]!==this.hass.states[this._configEntityId],e?console.log(" - SU hass state changed"):console.log(" - SU !! NO hass state change"))}return console.log("\\---- shouldUpdate("+this._hostname+") - EXIT w/"+e),e}willUpdate(t){this._debugShowProps(t,"willUpdate()")}render(){if(this._showDebug&&console.log("- render("+this._hostname+")"),this._config.show_warning)return this.showWarning(te("common.show_warning"));if(this._config.show_error)return this.showError(te("common.show_error"));if(this._configEntityId&&!this._stateInfoAvailable){const t="Entity Unavailable: "+this._configEntityId;return this.showWarning(t)}const t=this._configEntityId?this.hass.states[this._configEntityId]:void 0;if(!this._configEntityId&&!t)return this.showWarning("Entity Unavailable");if(!this._stateInfoAvailable)return void console.log("?? Render w/o sensor!! ("+this._hostname+")");let e=M``;if(this._firstTime&&(this._showDebug&&console.log("- stateObj: ["+t+"]"),this._startCardRefreshTimer(),this._showDebug&&console.log("- 1st-time _config: ["+this._config+"]"),this._firstTime=!1),this._showDaemonUpdNeed){const t=this._getAttributeValueForKey("reporter").split(" ");this.currentDaemonVersion=t.length>1?t[1]:"";const e=this._getAttributeValueForKey("reporter_releases");if(e&&e.length>0&&"NOT-LOADED"!=e){const t=e.split(",");this.latestDaemonVersions=t}}const o=this._getAttributeValueForKey("fqdn"),i=1==this._showOsAge?this._getAttributeValueForKey(Rt):"",s=this._showDaemonUpdNeed?this._computeDaemonUpdMessage(this.currentDaemonVersion):"";let n="";if(this._showCardAge)if(0==this._cardMinutesSinceUpdate)n="just now";else{const t=1==this._cardMinutesSinceUpdate?"":"s";n=this._cardMinutesSinceUpdate+" min"+t+" ago"}const r=1==this._showCardAge?n:"";let a="RPi monitor "+o;a=null!=this._config.name_prefix?this._config.name_prefix+" "+o:a,a=null!=this._config.name?this._config.name:a,0==this._showCardName&&(a="");const l=0==this._showCardName?"last-heard-full-notitle":"last-heard-full",c=0==this._showCardName?"last-heard-notitle":"last-heard",h=0==this._showCardName?"os-name-full-notitle":"os-name-full",d=0==this._showCardName?"os-name-notitle":"os-name",u=(0==this._showCardName?"daemon-update-full-notitle":"daemon-update-full")+" center",p=(0==this._showCardName?"daemon-update-notitle":"daemon-update")+" center";if(this._showFullCard){const t=this._generateFullsizeCardRows();if(0==t.length||!t)return void console.log("ERROR: failed to generate full rows!");e=M`
${t}
-
${c}
-
${a}
-
${l}
+
${r}
+
${i}
+
${s}
- `}else{const t=this._generateGlanceCardRows();if(0==t.length||!t)return void console.log("ERROR: failed to generate glance rows!");e=F`
+ `}else{const t=this._generateGlanceCardRows();if(0==t.length||!t)return void console.log("ERROR: failed to generate glance rows!");e=M`
${t}
-
${c}
-
${a}
-
${l}
+
${r}
+
${i}
+
${s}
- `}return e}updated(t){if(this._showDebug&&console.log("- updated("+this._hostname+")"),this._config){if(this.hass){const e=t.get("hass");(!e||e&&e.themes!==this.hass.themes)&&function(t,e,i,o){void 0===o&&(o=!1),t._themes||(t._themes={});var s=e.default_theme;("default"===i||i&&e.themes[i])&&(s=i);var n=_t({},t._themes);if("default"!==s){var r=e.themes[s];Object.keys(r).forEach((function(e){var i="--"+e;t._themes[i]="",n[i]=r[e]}))}if(t.updateStyles?t.updateStyles(n):window.ShadyCSS&&window.ShadyCSS.styleSubtree(t,n),o){var a=document.querySelector("meta[name=theme-color]");if(a){a.hasAttribute("default-content")||a.setAttribute("default-content",a.getAttribute("content"));var l=n["--primary-color"]||a.getAttribute("default-content");a.setAttribute("content",l)}}}(this,this.hass.themes,this._config.theme)}if(this.hass&&this._configEntityId){this.hass.states[this._configEntityId]||this._stopCardRefreshTimer()}const e=this.shadowRoot;if(this._sensorAvailable){const t=this._getAttributeValueForKey(Mt),i=this._computeOsReleaseColor(t);if(""!=i){e.getElementById("os-name").style.setProperty("color",i)}const o=this._computeDaemonUpdateVersionColor(this.currentDaemonVersion);if(""!=o){e.getElementById("daemon-update").style.setProperty("color",o)}const s=this._computeReporterAgeColor(this._cardSecondsSinceUpdate);if(""!=s&&null!=s){e.getElementById("card-timestamp").style.setProperty("color",s)}if(this._showFullCard)for(const t in this._cardFullCssIDs){const i=this._cardFullCssIDs[t],o=this._cardFullElements[t],s=this._getAttributeValueForKey(o),n=this._getFullCardValueForAttributeKey(o),r=e.getElementById(i);r.textContent=n;const a=this._cardFullIconCssIDs[t],l=e.getElementById(a);if(o==Nt){const t=this._computeFileSystemUsageColor(s);""!=t&&(r.style.setProperty("color",t),l.style.setProperty("color",t))}if(o==zt){const t=this._computeMemoryUsageColor(n.replace(" %",""));""!=t&&(r.style.setProperty("color",t),l.style.setProperty("color",t))}if(o==Vt){const t=this._computeTemperatureColor(s);""!=t&&(r.style.setProperty("color",t),l.style.setProperty("color",t))}}else for(const t in this._cardGlanceCssIDs){const i=this._cardGlanceCssIDs[t],o=this._cardGlanceElements[t],s=this._getAttributeValueForKey(o),n=this._getGlanceCardValueForAttributeKey(o),r=e.getElementById(i);r.textContent=n;const a=this._cardGlanceIconCssIDs[t],l=e.getElementById(a);if(o==Nt){const t=this._computeFileSystemUsageColor(s);""!=t&&(r.style.setProperty("color",t),l.style.setProperty("color",t))}if(o==zt){const t=this._computeMemoryUsageColor(n);""!=t&&(r.style.setProperty("color",t),l.style.setProperty("color",t))}if(o==Vt&&"n/a"!=n){const t=this._computeTemperatureColor(s);""!=t&&(r.style.setProperty("color",t),l.style.setProperty("color",t));e.getElementById(this.kClassIdTempScale).textContent=this._getTemperatureScale()}}}}}_handleAction(t){this.hass&&this._config&&t.detail.action&&function(t,e,i,o){var s;"double_tap"===o&&i.double_tap_action?s=i.double_tap_action:"hold"===o&&i.hold_action?s=i.hold_action:"tap"===o&&i.tap_action&&(s=i.tap_action),At(t,e,i,s)}(this,this.hass,this._config,t.detail.action)}showWarning(t){return F`
${t} `}showError(t){const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:t,origConfig:this._config}),F` ${e} `}_startCardRefreshTimer(){this._updateTimerID=setInterval((()=>this._handleCardUpdateTimerExpiration()),1e3),this._showDebug&&console.log("TIMER: ("+this._hostname+") started")}_stopCardRefreshTimer(){null!=this._updateTimerID&&(clearInterval(this._updateTimerID),this._updateTimerID=void 0,this._showDebug&&console.log("TIMER: ("+this._hostname+") STOPPED"))}_handleCardUpdateTimerExpiration(){const[t,e]=this._getRelativeTimeSinceUpdate();if(t&&t.length>0){let i=t;t.includes("NaN")&&(console.log(" HCUTE (DBG) ("+this._hostname+") card_timestamp_value=["+t+"]"),i="{bad value}"),this._cardUpdateString!=i&&(this._cardUpdateString=i),this._cardSecondsSinceUpdate!=e&&(this._cardSecondsSinceUpdate=e)}}_logChangeMessage(t){const e="("+this._hostname+"): "+t;this._showDebug&&console.log(e)}_updateSensorAvailability(){let t=!1;if(this.hass&&this._config){const e=this._configEntityId?this.hass.states[this._configEntityId]:void 0;if(this._configEntityId||e){if(this._configEntityId)try{const e="unavailable"!=this.hass.states[this._configEntityId].state;t=this._sensorAvailable!=e,this._sensorAvailable=e}catch(e){this._sensorAvailable=!1,t=!0}}else this._sensorAvailable=!1,t=!0}else this._sensorAvailable=!1,t=!0;t&&this._logChangeMessage("* SENSOR available: "+this._sensorAvailable)}_computeDaemonUpdMessage(t){let e="";return this._showDebug&&(console.log("- RNDR currentDaemonVersion=["+t+"]"),console.log("- RNDR latestDaemonVersions=["+this.latestDaemonVersions+"]")),this.latestDaemonVersions.length>0&&""!=t?t!=this.latestDaemonVersions[0]&&(e=t+" ---\x3e "+this.latestDaemonVersions[0]):e=""!=this.currentDaemonVersion?"{no info avail.}":"v?.?.? {no info avail.}",e}_getRelativeTimeSinceUpdate(){var t;const e=this._configEntityId?this.hass.states[this._configEntityId]:void 0;let i="",o=0,s="";if(this.hass.locale&&e){try{const o=yt(null===(t=this.hass)||void 0===t?void 0:t.localize,e,this.hass.locale),n=void 0===o?"{unknown}":this._formatTimeAgo(o);i=this._sensorAvailable?n:"{unknown}";s=n.split(" ")[0]}catch(t){console.log("GRTSU - exception:"),console.error(t)}o=s.includes("just")||s.includes("unknown")?0:Number(s)}return[i,o]}_formatTimeAgo(t){const e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),i=((new Date).getTime()-e.getTime())/1e3,o=Math.floor(i/86400),s=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();if(isNaN(o)||o<0||o>=31)return s.toString()+"-"+(n<10?"0"+n.toString():n.toString())+"-"+(r<10?"0"+r.toString():r.toString());let a="{unknown}";return 0==o?i<60?a="just now":i<120?a="1 min ago":i<3600?a=Math.floor(i/60)+" mins ago":i<7200?a="1 hr ago":i<86400&&(a=Math.floor(i/3600)+" hrs ago"):1==o?a="Yesterday":o<7?a=o+" days ago":o<31&&(a=Math.ceil(o/7)+" wks ago"),a}_getIconNameForPercent(t){let e="";for(const i in this._circleIconsValueByName){if(t<=this._circleIconsValueByName[i]){e=i;break}}return e}_computeReporterAgeColor(t){let e;return this._colorReportPeriodsAgoDefault.forEach((i=>{t>=i.from&&t<=i.to&&(e=i.color)})),null!=e&&"default"!=e||(e=""),e}_computeTemperatureColor(t){const e=this._config,i=Number(t),o=e.temp_severity?e.temp_severity:this._colorTemperatureDefault;let s;if(isNaN(i)||o.forEach((e=>{if(i>=e.from&&i<=e.to&&(s=e.color,this._showDebug)){const i="_computeTemperatureColor() - value=["+t+"] matched(from="+e.from+", to="+e.to+", color="+s+")";console.log(i)}})),this._showDebug){const e="_computeTemperatureColor() - value=["+t+"] returns(color="+s+")";console.log(e)}return null!=s&&"default"!=s||(s=""),s}_computeFileSystemUsageColor(t){const e=this._config,i=Number(t),o=e.fs_severity?e.fs_severity:this._colorUsedSpaceDefault;let s;if(isNaN(i)||o.forEach((e=>{if(i>=e.from&&i<=e.to&&(s=e.color,this._showDebug)){const i="_computeFileSystemUsageColor() - value=["+t+"] matched(from="+e.from+", to="+e.to+", color="+s+")";console.log(i)}})),this._showDebug){const e="_computeFileSystemUsageColor() - value=["+t+"] returns(color="+s+")";console.log(e)}return null!=s&&"default"!=s||(s=""),s}_computeMemoryUsageColor(t){const e=this._config,i=Number(t),o=e.memory_severity?e.memory_severity:this._colorUsedMemoryDefault;let s;if(isNaN(i)||o.forEach((e=>{if(i>=e.from&&i<=e.to&&(s=e.color,this._showDebug)){const i="_computeMemoryUsageColor() - value=["+t+"] matched(from="+e.from+", to="+e.to+", color="+s+")";console.log(i)}})),this._showDebug){const e="_computeMemoryUsageColor() - value=["+t+"] returns(color="+s+")";console.log(e)}return null!=s&&"default"!=s||(s=""),s}_computeOsReleaseColor(t){const e=this._config,i=e.os_age?e.os_age:this._colorReleaseDefault;let o="default";if(i.forEach((e=>{if(t===e.os&&(o=e.color,this._showDebug)){const i="_computeOsReleaseColor() - value=["+t+"] matched(os="+e.os+", color="+o+")";console.log(i)}})),this._showDebug){const e="_computeOsReleaseColor() - value=["+t+"] returns(color="+o+")";console.log(e)}return null!=o&&"default"!=o||(o=""),o}_computeDaemonUpdateVersionColor(t){let e;if(e=this.latestDaemonVersions.length>0&&""!=t?this.latestDaemonVersions[0]==t?"default":this.latestDaemonVersions.includes(t)?"orange":"red":"orange",this._showDebug){const i="_computeDaemonUpdateVersionColor() - value=["+t+"] returns(color="+e+")";console.log(i)}return null!=e&&"default"!=e||(e=""),e}_filterUptime(t){const e=t.split(" ");let i=t;if(i.includes(":")){for(let t=0;t
${t} `}showError(t){const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:t,origConfig:this._config}),M` ${e} `}_startCardRefreshTimer(){this._updateTimerID=setInterval((()=>this._handleCardUpdateTimerExpiration()),15e3),this._showDebug&&console.log("TIMER: ("+this._hostname+") started")}_stopCardRefreshTimer(){null!=this._updateTimerID&&(clearInterval(this._updateTimerID),this._updateTimerID=void 0,this._showDebug&&console.log("TIMER: ("+this._hostname+") STOPPED"))}_handleCardUpdateTimerExpiration(){const t=this._calculateRelativeMinutesSinceUpdate();this._cardMinutesSinceUpdate!=t&&(this._cardMinutesSinceUpdate=t)}_debugShowProps(t,e){console.log("/ ---- "+e+" "+this._hostname+" ---- :"),console.log(t)}_ensureStateInfoAvail(){if(this._configEntityId&&this.hass){const t=this._configEntityId?this.hass.states[this._configEntityId]:void 0;t?"unavailable"==t.state?this._stateInfoAvailable=!1:this._stateInfoAvailable=!0:this._stateInfoAvailable=!1}}_ensureWeHaveHostName(){if(0==this._hostname.length||this._hostname==this._configEntityId){const t=this._getAttributeValueForKey("host_name");t&&t.length>0?this._hostname=t:this._hostname=this._configEntityId?this._configEntityId:"-not-set-"}}_computeDaemonUpdMessage(t){let e="";return this._showDebug&&(console.log("- RNDR currentDaemonVersion=["+t+"]"),console.log("- RNDR latestDaemonVersions=["+this.latestDaemonVersions+"]")),this.latestDaemonVersions.length>0&&""!=t?t
${e}
- ${o}
+ ${i}
- `)}return t}_generateGlanceCardRows(){const t=[];for(const e in this._cardGlanceElements){const i=this._cardGlanceElements[e],o=this._getGlanceCardValueForAttributeKey(i);let s=e;s==this.kREPLACE_WITH_TEMP_UNITS&&(s="n/a"!=o?this._getTemperatureScale():""),i==zt&&(s="% Mem");let n=this._cardGlanceIconNames[e];i==Nt&&(n=this._getIconNameForPercent(o));const r=this._cardGlanceCssIDs[e],a=this._cardGlanceIconCssIDs[e];let l="units";i==Vt&&(l=this.kClassIdTempScale),t.push(F`
+ `)}return t}_generateGlanceCardRows(){const t=[];for(const e in this._cardGlanceElements){const o=this._cardGlanceElements[e],i=this._getGlanceCardValueForAttributeKey(o);let s=e;s==this.kREPLACE_WITH_TEMP_UNITS&&(s="n/a"!=i?this._getTemperatureScale():""),o==jt&&(s="% Mem");let n=this._cardGlanceIconNames[e];o==Ft&&(n=this.colorHelpers.getIconNameForPercent(i));const r=this._cardGlanceCssIDs[e],a=this._cardGlanceIconCssIDs[e];let l="units";o==zt&&(l=Ot),t.push(M`