Closed sweebee closed 8 years ago
I'm trying to add a lux sensor but i get these errors (depends where i put it between other devices):
error1: AssertionError: configDef must be an object or error 2: warn: no plugin found for device "Battery" of class "MySensorsBattery"!
device:
class MySensorsLux extends env.devices.Device constructor: (@config,lastState, @board) -> @id = config.id @name = config.name @_lux = lastState?.lux?.value @_batterystat = lastState?.batterystat?.value #env.logger.info "MySensorsLux " , @id , @name @attributes = {} @attributes.battery = { description: "display the Battery level of Sensor" type: "number" unit: '%' acronym: 'BATT' hidden: !@config.batterySensor } @board.on("rfbattery", (result) => if result.sender is @config.nodeid unless result.value is null or undefined @_batterystat = parseInt(result.value) @emit "battery" , @_batterystat ) @attributes.lux = { description: "the messured light in lux" type: "number" unit: 'lux' } @board.on("rfValue", (result) => if result.sender is @config.nodeid if result.sensor is @config.sensorid env.logger.info "<- MySensorsLux" , result if result.type is V_LIGHT_LEVEL or V_LEVEL @_lux = parseInt(result.value) @emit "lux", @_lux ) super() getLux: -> Promise.resolve @_lux getBattery: -> Promise.resolve @_batterystat
fixed
I'm trying to add a lux sensor but i get these errors (depends where i put it between other devices):
device: