Homey Community Forum

Can't use a custom device class

Hi there

I’m just starting development for Homey, I fear I miss very basic knowledge.
I want to customize my device class name, thus using the onMapDeviceClass method (which I actually did not notice in other apps)
apparently the driver does not understand it. When pairing the devices, the discovery works well (I get my two devices displayed) but when I pair a device, it looks like the driver instanciates just another device class. I do not receive anything in the log, despite trying to log as much as i can.
Is there somewhere a tuto showing all the steps to define a custom device class ? the above method is not sufficient by itself ?

Private repo?

not anymore, sorry

STBDevice will be undefined here: com.messiant.orangetv/driver.js at master · Aybert59/com.messiant.orangetv · GitHub

Adding const STBDevice = require('./device') at the top of driver.js will import it (although at the moment, you only have one device class so there’s no need to use onMapDeviceClass at all).

1 Like