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(“”…state…“&”, 1)

os.execute(“curl -k -d access_token=2ffac8e46a02fa91b721e974ada7198e0d54321 -d params=l1,”… (state == 1 and ‘HIGH’ or ‘LOW’) ,1)[/code]

do I have a syntax problem?


should be…

os.execute("curl -k  -d access_token=2ffab8e46b02fa91a721e974ada7198e0d54321  -d params=l1,".. (state  == "1" and 'HIGH' or 'LOW') ,1)
state == "1"