I’ve followed the instructions about creating a node, I’m using the docker container for node-red.
I’ve used npm install to install.
In the palette manager I can see the package listed and that it contains a single node.
But for some reason the node doesn’t appear in the actual palette. I’ve made sure the name matches everywhere in code (“sleep-timer“) but no matter what I do I just can’t get it to appear in the palette.
I’ve tried reinstalling the package from the dev folder, restarting the server after making changes but it won’t show!
Are there any gotchas I need to check i an not falling foul off? Might this be a docker specific issue?
But config.defaultPeriod and config.defaultAdjustment are set to undefined when the node is created, regardless of whether I leave them empty in the properties page or fill them in. My assumption is that if they're empty they should use the default value I've provided, but overriding doesn't seem to make any difference either.
I'm obviously doing something very stupid here, but I can't figure out exactly what.
The defaults are only applied when you add a new instance of the node to the workspace. Any existing instance of the node won't have those values retrospectively applied.
In the runtime it is best to assume the values could be undefined and to have sensible defaults applied there as well.
Ahh, yes, I just read that and came here to say I'd realised!
Can I read the default value (i.e the default specified in the html file?) so that I don't have to duplicate the value in both the html and js? I have a validator function which I will wrap them up in, but I have to pass in a default and it would be nicer to just pick it up from the html if I can?
Thank you so much for your help, my node is working perfectly now!
I need to read up on how to submit it now, it’s yet another sleep timer.....but it has the built in behaviour of a TV sleep timer so is ideal to use with tv control nodes!
I have it hooked up to Emby to display a message on the tv and also Sonos where it announces the tv will go to sleep in a minute!