@nh.schottfam
I found a regression in the latest webCoRE update that I installed a couple of days ago (with the fixes for stays): it treats device number variables as strings instead of numbers, so date/time functions fail.
Use this sample driver:
metadata {
definition (name: "DateTime bug sample driver", namespace: "test", author: "Daniel Segall") {
capability "Initialize"
capability "Refresh"
attribute "time","number"
}
}
List<String> getModeOptions() {
List<String> options = new ArrayList<>()
for (Object mode : location.getModes())
options.add(mode.toString())
return options
}
def installed() {
fullReset()
}
def initialize() {
fullReset()
}
def refresh() {
fullReset()
}
def fullReset() {
sendEvent("name": "time", "value": new Date().getTime())
}
Create a virtual device, add it to webCoRE, and this example piston will demonstrate the issue:
It produces the error
║Error executing func_formatdatetime: java.lang.NumberFormatException: For input string: "1.640263963672E12"