After breaking my head on why my macbook would not sleep I figured out Node-red is the culprite.
I use 1.0.6 right now but this was also there in 1.0.2 Firefox version 75.0
When I open the node-red web page the following task is spawned in FF:
FirefoxCP Web Content and preventing sleep is set to yes.
Basically this tells my laptop not to go to sleep even if the lid is closed.
Could I ask that this be a toggle switch of turned off?
which toggle switch ? where is it ? that sounds like a browser issue ? Do you have any browser plugins enabled ? What happens if you start firefox in safe mode ?
It's not a toggle switch (yet). Basically somewhere in the HTML code "do not sleep" has been added. This causes firefox to keep the laptop alive and not be able to go into sleep mode. I have restarted without add-ons and the effect is the same. As soon as I open the Node-Red webpage FF jumps into not sleep mode.
It isn't as simple as that. This isn't a flag you just set in the code. At this point, I have absolutely no idea what in the editor is triggering this behaviour.
It will require some research to figure out what exactly is doing it and why. Only then can we figure out a way to prevent it - if that makes sense to do.
I think that may be browser related then - There were some bugs raised a while back from people saying - "my pc goes to sleep when I'm watching a video" etc... so the default is to stay on if full screen and media is active. Not sure how to override that at the page level.
just posted a bug on the play-audio plugin, let's see what happens. Weird thing is the plugin is enabled but I have never created a flow that uses is. so just enabling the plugin enables Preventing sleep.