Hello guys - i am trying my first app and its a very simple one - i want to select a device and one of its properties, and expose only that property via HTTP endpoint. All works correctly, i see that my endpoint gets hit via the debug messages, but the render method at the end seems to not be working correctly and i cant find any documentation on that. Here is what my final function looks like:
void getDeviceValue() {
def device = settings.theDevice
def variable = settings.theVariable
def deviceState = device.currentValue(variable)
log.debug "Device: $device"
log.debug "Variable: $variable"
log.debug "State: $deviceState"
def result = [state: deviceState]
render contentType: "application/json", data: result
}
All debug messages produce the correct values, but the page returns a blank response in the browser. Does anyone have any idea why that is?
