I have a problem, running my jython scripts with openhab 3.4.0 GA (docker container) …
from org.openhab.core.persistence.extensions import PersistenceExtensions
from org.openhab.core.items import Item
from org.slf4j import LoggerFactory
log = LoggerFactory.getLogger("jsr223.jython")
x = itemRegistry.getItem("pIndoor_Plant_Sensor_Main_Info")
log.info(u"{}".format(x.__class__))
log.info(u"{}".format(isinstance(x, Item)))
PersistenceExtensions.lastUpdate(x)
produces the following error messages
2022-12-19 10:35:34.932 [INFO ] [jsr223.jython ] - <type 'org.openhab.core.library.items.StringItem'>
2022-12-19 10:35:34.933 [INFO ] [jsr223.jython ] - 1
2022-12-19 10:35:34.933 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/_test.py': TypeError: lastUpdate(): 1st arg can't be coerced to org.openhab.core.items.Item in /openhab/conf/automation/jsr223/_test.py at line number 15
anyone has an idea?