module("JMleccy", package.seeall) require("xap.bsc") jeenode = require("xap.jeenode") Nodule = jeenode.Nodule class = require("pl.class") class.JMLeccy(Nodule) -- create BSC endpoints function JMLeccy:build(...) Nodule.build(self, ...) -- Creates the endpoints: self[key] as in self.light, self.moved etc.. -- If the user has configured that they want them that is. self:add {key="watts", direction=bsc.INPUT, type=bsc.STREAM} end function JMLeccy:process(data) local wa= jeenode.bitslicer(data,16) -- The keys here must match the key values from the self:add{key=x} Nodule.process(self,{watts=wa}) end