listOfMembers = [(Transformation.transform("MAP", "sensoren.map", item.name) or item.name) for item in ir.getItem("gLacrossSensorExpired").members if item.state == OFF]
List comprehensions are only a Python thing. You will have to use the
It’s been awhile since I’ve done Python but I think it would translate to something like (using openhab-js 4.0+):
var lostOfMembers = items.gLacrossSensorExpired.members
.filter( i => i.state == 'OFF')
.map( i => actions.Transformation.transform('MAP', 'sensoren.map', i.name));
Note I just typed that in. There are probably errors. Check the docs for details.