I'm writing a custom device driver, that is using the "Generic Component Switch" as a child device. When I try to write to the child device debug log with log.debug(), it ends up in the parent device log. Is there a way to fix that and send the log info from the child to the child device log?
There is only 1 device driver file. The child device is added this way:
I dont think you can, log.debug is not a method of the device object, so you cannot call it on the component device.
What I do in my drivers is I add the devChild.displayName in front of the log entry so you know it was for a child device. You would have to send the devChild device object, or the displayName to your function for it to work.
I assume that means you need to use a custom child / component driver? It appears they are using one of the system drivers so you can only work with what you go for those.