lua 'ternary' acting unexpectedly

I realize lua doesn’t have a C type ternary, but since this works:

print('x is ' .. (x < 0 and 'negative' or 'non-negative'))

I thought I could do something like this:

[code]local state = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”, 116)

luup.inet.wget(“192.168.1.50//?relayState=”…state…“&”, 1)

os.execute(“curl -k https://api.spark.io/v1/devices/55ff6e065b75555336212345/led -d access_token=2ffac8e46a02fa91b721e974ada7198e0d54321 -d params=l1,”… (state == 1 and ‘HIGH’ or ‘LOW’) ,1)[/code]

do I have a syntax problem?

yup…

should be…

os.execute("curl -k https://api.spark.io/v1/devices/55fb6e0a5075555336212345/led  -d access_token=2ffab8e46b02fa91a721e974ada7198e0d54321  -d params=l1,".. (state  == "1" and 'HIGH' or 'LOW') ,1)
state == "1"