Hej
Mam kilka timer'ów które wyglądają tak różnią się czasem i item'em do sterowania
createTimer(now.toInstant().plusMillis(19000).atZone(now.zone), [ | RolSypD.sendCommand(OFF) ] )
i chciałbym móc wyświetlić procent czasu od 0-100 jaki minął.
Jak to zrobić nie zawalając procesora i pamięci?
rule "Wyświetl postęp procentowy timera co 1s"
when
Time cron "0/1 * * * * ?"
then
long duration = 19000;
long elapsedTime = createTimer(now.toInstant().plusMillis(duration).atZone(now.zone), [ | RolSypD.sendCommand(OFF) ] )
int progress = (int) (elapsedTime * 100 / duration);
sendCommand(progressPercentage, progress)
end

