Rename last mode context to be room specific

This commit is contained in:
2025-03-28 20:16:19 -04:00
parent e87275baee
commit 3ef08eebf9
3 changed files with 11 additions and 11 deletions

View File

@ -6,15 +6,15 @@ const nightMode = states["input_boolean.night_mode"].state
const goodnight = states["input_boolean.goodnight"].state
const coolingActive = states['input_boolean.master_bedroom_cooling_on'].state
let lastMode = []
let mbrLastMode = []
if (sleeping === 'on' || nightMode === 'on' || goodnight === 'on') {
lastMode = 'bedtime'
mbrLastMode = 'bedtime'
} else if (earlyNight === 'on' || giveMeDarkness === 'on' || coolingActive === 'on') {
lastMode = 'night'
mbrLastMode = 'night'
} else {
lastMode = 'day'
mbrLastMode = 'day'
}
flow.set("lastMode", lastMode, "diskCon")
node.status({ fill: "green", shape: "dot", text: `Last Mode Set: ${lastMode}`})
flow.set("mbrLastMode", mbrLastMode, "diskCon")
node.status({ fill: "green", shape: "dot", text: `Last Mode Set: ${mbrLastMode}`})