apwelsh / hubitat

MIT License
26 stars 12 forks source link

Hubitat Virtual timer: errorjava.lang.UnsupportedOperationException: Cannot use mod() on this number type: java.math.BigDecimal with value: 120 on line 96 (setTimeRemaining) #10

Closed rnoia closed 4 years ago

rnoia commented 4 years ago

When using the set Time Remaining button to... set the remaining time, the following error is thrown: errorjava.lang.UnsupportedOperationException: Cannot use mod() on this number type: java.math.BigDecimal with value: 120 on line 96 (setTimeRemaining)

I tried "60" as the option.

apwelsh commented 4 years ago

I didn’t realize anyone was using this except the friend of mine I created it for. I will take a look and make it work correctly. Right now, it is really just an approximate of the total time. I will see if this version is up to date. But more importantly, if others are interested in this, I will need to finalize the code to make it more friendly for accurate reporting and timing in HE.

apwelsh commented 4 years ago

The immediate bug is fixed. The language syntax changed during one of the updates. I fixed the error with a simple change. I will finish up my changes to this soon though.

rnoia commented 4 years ago

I didn’t realize anyone was using this except the friend of mine I created it for. I will take a look and make it work correctly. Right now, it is really just an approximate of the total time. I will see if this version is up to date. But more importantly, if others are interested in this, I will need to finalize the code to make it more friendly for accurate reporting and timing in HE.

No worries! I stumbled on it and thought "this would solve my exact problem"!. Thank you for your contribution!