Skip to content

Commit 266f6e2

Browse files
committed
fix: 🐛 fix size value when not supported sensor is selected
1 parent b07fd51 commit 266f6e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

o365-card.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ import {
183183
}
184184

185185
if (max_item == 0){
186-
if(attributeValue.size){
186+
if(typeof(attributeValue.size) != 'unavailable'){
187187
max_item = attributeValue.size;
188188
}else{
189189
max_item = 15;
@@ -256,7 +256,11 @@ import {
256256
//Email
257257
const attributeValue = this.hass.states[entityId].attributes['data'];
258258
if (max_item == 0){
259-
max_item = attributeValue.size;
259+
if(typeof(attributeValue.size) != 'unavailable'){
260+
max_item = attributeValue.size;
261+
}else{
262+
max_item = 15;
263+
}
260264
}
261265
return attributeValue ? html`
262266
<ha-card class="card">

0 commit comments

Comments
 (0)