${friendlyNameStr} is currently ${stateStr}.
- `;
- if (stateStr == 'on') {
- conthtml += `
-
The ${courseNameStr} progress is ${stageNameStr}.
-
There's ${remainTimeStr} remaining out of ${totalTimeStr} total.
- `;
- if (worked) {
- conthtml += `
-
-
-
- `;
- conthtml = conthtml.replace("8px 9px 12px 5px", "16px 9px 12px 5px");
- } else {
- conthtml += "";
- }
+ if (state.state == "on") {
+ const totalTime = state.attributes["initial_time"];
+ const remainTime = state.attributes["remain_time"];
+ const totalMinutes = (parseInt(totalTime.split(":")[0]) * 60) + parseInt(totalTime.split(":")[1]);
+ const remainMinutes = (parseInt(remainTime.split(":")[0]) * 60) + parseInt(remainTime.split(":")[1]);
+ this.querySelector("ha-icon").style.color = "var(--paper-item-icon-active-color)";
+ this.querySelector("span").innerHTML = `
+${friendlyName} is running ${state.attributes["current_course"]}