Skip to content

Commit c13e25a

Browse files
authored
Fix for options column card crash
1 parent 66eff19 commit c13e25a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

predbat-table-card.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ class PredbatTableCard extends HTMLElement {
689689
dayTotalsRow.appendChild(totalCell);
690690

691691
});
692-
console.log(dayTotalsRow);
693692
newTableBody.appendChild(dayTotalsRow);
694693
for (let i = 0; i < 2; i++) {
695694
newTableBody.appendChild(this.createDividerRows(columnsToReturn.length, hass.themes.darkMode));
@@ -842,7 +841,7 @@ class PredbatTableCard extends HTMLElement {
842841
let updateText = ``;
843842
if(version !== latestVersion){
844843
updateIcon = `<ha-icon icon="mdi:download-circle-outline" style="color: var(--primary-color); --mdc-icon-size: 18px; margin-left: 4px;" title="Predbat Table Card version ${latestVersion} available"></ha-icon>`;
845-
updateText = `<span style="color: var(--primary-color);"><b>Version ${latestVersion} available</b></span>`;
844+
updateText = `<span style="color: var(--primary-color);"><b>${latestVersion} available</b></span>`;
846845
lastUpdateHeaderDiv.style.cursor = "pointer";
847846
lastUpdateHeaderDiv.addEventListener('click', () => {
848847
const event = new CustomEvent('hass-more-info', {
@@ -1430,8 +1429,11 @@ getTimeframeForOverride(timeString) {
14301429
let newCell = document.createElement('td');
14311430
let newContent = (typeof theItem?.value === 'string') ? theItem.value.trim() : theItem?.value ?? '';
14321431

1433-
let rawValue = theItem.value;
1434-
let debugValue;
1432+
let debugValue, rawValue;
1433+
1434+
if(theItem)
1435+
rawValue = theItem.value;
1436+
14351437
let hasBoldTags = false, hasItalicTags = false;
14361438
const wrap = (text, tag) => `<${tag}>${text}</${tag}>`;
14371439

0 commit comments

Comments
 (0)