Untitled

mail@pastecode.io avatar
unknown
yaml
20 days ago
432 B
4
Indexable
Never
bar: |
  [[[
    const remTime = parseFloat(states['sensor.geschirrspuler_remaining_program_time'].state);
    const progDur = parseFloat(states['sensor.geschirrspuler_duration'].state);
    let percentage = 0;
    if (progDur > 0) {
      percentage = ((progDur - remTime) / progDur) * 100;
    }
    return `
    <div>
      <div style="background:#050C9C; height: 12px; width:${percentage}%">
      </div>
    </div>
    `;
  ]]]
Leave a Comment