module(...,package.seeall) require "xap" require "xap.bsc" --local io = require("io") info={ version="1.0", description="Boiler Boost Controller" } function boostCmd(endpoint) file = io.open("/etc/plugboard/boosttemp","w+") if endpoint.state == "on" then file:write(tostring("1")) else file:write(tostring("0")) end file:close() end function boilerboostInfoEvent(endpoint, clazz) endpoint.displaytext = "Boost is " .. endpoint.state return true -- Return TRUE if the INFO/EVENT should be emitted / FALSE otherwise end function init() --boilerBSC = bsc.Endpoint{source="dbzoo.livebox.boilerboost:state", direction=bsc.OUTPUT, type=bsc.BINARY, cmdCB=boostCmd, infoEventCB=boilerboostInfoEvent} -- Create a filter, the conditions needed to call our "action" routine filter = xap.Filter() -- We want a state change to trigger our routine filter:add("xap-header","source", "dbzoo.livebox.boilerboost:state") -- This is the function we call when a match is made to the filters filter:callback(boostCmd) end --[[ xap.init("dbzoo.lua.maxmin","FF01DE00") init() xap.process() ]]--