Improve motion lighting in some rooms

Motion lighting should no longer reset lights to adaptive when scene or brightness has been changed manually
This commit is contained in:
2025-02-23 01:07:31 -05:00
parent 87ed0e89c0
commit e23c78c971
5 changed files with 36 additions and 15 deletions

View File

@ -9,11 +9,15 @@ const newDuration = duration * 60
if (sleeping === 'off') {
if (payload === 'on') {
if (lux <= threshold || lights === 'on') {
node.status({fill:'green',shape:'dot',text:'Lights On'})
if (lux <= threshold && lights === 'off') {
node.status({fill:'green',shape:'dot',text:'Turning lights on'})
node.send([msg,null])
} else {
node.status({fill:'red',shape:'ring',text:'Too bright'})
if (lights === 'off') {
node.status({fill:'red',shape:'ring',text:'Lights already on'})
} else {
node.status({fill:'red',shape:'ring',text:'Too bright'})
}
}
} else if (payload === 'off') {
if (lights === 'on') {