Closed nemr closed 7 years ago
startLearning should only be used after the ready event got fired. please try it like this and tell me if it works... it works here...
enocean.on("ready",function(){
enocean.timeout=120
enocean.startLearning()
}
p.s.: see the memory.js example in the examples folder
Hi , its working fine now thats .
Just to let u know I had an error before that which was :
/home/pi/Desktop/node_modules/node-enocean/index.js:226
socket.on( "get-last-sensor-value" , async function( id ) {
^^^^^
SyntaxError: missing ) after argument list
I took out that function form the index file to get it working since I dont need that function at the moment , but it might be something that you would need to consider .
Thanks again for this great npm
I already set a device on learning mode , but I didn't get the the learning confirmed response
the sensor is most likely already learned in please check your knownSensors file... (default location is ./node_modules/node-enocean/modules/knownSensors.json)
the other error you are seeing is handled in issue #22
you have to update your node.js to the latest version (7.7.1) for this to work, or start your app with the --harmony-async-await
flag
I'm trying to use tge startLearning function but its giving me the following error :
TypeError: enocean.startLearning is not a function
this is the code :