diff --git a/bundles/org.openhab.automation.pythonscripting/pom.xml b/bundles/org.openhab.automation.pythonscripting/pom.xml index 6d48a556c163c..41d9fa92a8a6d 100644 --- a/bundles/org.openhab.automation.pythonscripting/pom.xml +++ b/bundles/org.openhab.automation.pythonscripting/pom.xml @@ -80,7 +80,7 @@ scm:git:https://github.com/openhab/openhab-python ${project.build.directory}/python - v1.0.0-rc1 + v1.0.0-rc2 tag diff --git a/bundles/org.openhab.automation.pythonscripting/src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngine.java b/bundles/org.openhab.automation.pythonscripting/src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngine.java index 3cceeb2eac879..d53c7ccda1134 100644 --- a/bundles/org.openhab.automation.pythonscripting/src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngine.java +++ b/bundles/org.openhab.automation.pythonscripting/src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngine.java @@ -121,7 +121,7 @@ public class PythonScriptEngine .targetTypeMapping(Value.class, Duration.class, // picking two members to check as Duration has many common function names v -> v.hasMember("total_seconds") && v.hasMember("total_seconds"), - v -> Duration.ofNanos(v.invokeMember("total_seconds").asLong() * 10000000), + v -> Duration.ofNanos(Math.round(v.invokeMember("total_seconds").asDouble() * 1000000000)), HostAccess.TargetMappingPrecedence.LOW) // Translate python item to org.openhab.core.items.Item