require "xap" require "xap.bsc" state = 0 function init() print("starting") end function flipflop() if state == 0 then state=1 else state=0 end if state==1 then bscboostState:setText( tostring("1") ) bscboostState:setDisplayText("on") else bscboostState:setText( tostring("0") ) bscboostState:setDisplayText("off") end bscboostState:sendEvent() end function sendBscCmd(target,body) xap.sendShort(string.format([[xap-header { target=%s class=xAPBSC.cmd } output.state.1 { id=* %s }]], target, body)) end xap.init("dbzoo.lua.boostendpointtest","FF005D00" ) -- Create the new xAP Endpoints bscboostState = bsc.Endpoint{source="dbzoo.livebox.boilerboost:state", direction=bsc.INPUT, type=bsc.STREAM} xap.Timer(flipflop,30):start() xap.process()