[RFDriver] Error when pairing a device

I am pulling my hairs out. I am a rookie regarding javascript and Homey apps, but I have been working on an app for a 433mhz device. Out of a sudden (or I have broke something), I get this error when trying to pair a remote:

[err] [MyApp] TypeError: Cannot read properties of undefined (reading 'name')
    at AsyncFunction.listener (/app/node_modules/homey-rfdriver/lib/RFDriver.js:174:25)
    at /app/node_modules/homey-rfdriver/lib/RFSignal.js:120:26
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

I can’t recall making any change that caused the paring to fail. I am using the standard rf-transmitter-learn.html

when looking at the error, the specific line says:

await session.emit('createDevice', {
 --->  name: this[sRF].name, <----
        data: {
          uuid: RFUtil.generateUUIDv4(),
          ...signal.constructor.commandToDeviceData(command),
          copiedFromRemote: true,
        },
      });

Looking at the object this[sRF] it logs as undefined so the error make sense, but can’t figure out what is causing it…
(when changing to: name: "something", it pairs fine.

Are you sure you’re using onRFInit() on your driver and not onInit()?

async onInit() {
  ...
  ...
}

Has been there for weeks, and worked fine before.

Changed it, and works fine again. Thanks!

homey-rfdriver has last been updated 10 months ago, and overloading onInit() will cause your issue. So why it has worked for weeks is a bit of a mystery…

Not sure either, could have been me changing something, lost track :sweat_smile:

Thanks for the quick response.

Whilst we are here… I noticed when pressing a button on the remote, sometime 2 or even 3 devices are added, is there an easy way to check if a device either already exist -or disregard multiple requests (guess it could be caused by the signal repetitions?)?