diff --git a/climate/master-bedroom/meltdown-center.js b/climate/master-bedroom/meltdown-center.js index 7c2734c..3f0c048 100644 --- a/climate/master-bedroom/meltdown-center.js +++ b/climate/master-bedroom/meltdown-center.js @@ -1,7 +1,7 @@ const states = global.get('homeassistant.homeAssistant.states') const toggle = msg.payload const ac = global.get('masterBedroom.aircon.installed', "diskCon") -const mbrLastMode = flow.get("mbrLastMode", "diskCon") +const lastMode = flow.get("masterBedroom.lastMode", "diskCon") const bedTemp = states['input_number.master_bedroom_bedtime_temp'].state let setTemp = bedTemp diff --git a/climate/master-bedroom/reset.js b/climate/master-bedroom/reset.js index acd8091..7337f22 100644 --- a/climate/master-bedroom/reset.js +++ b/climate/master-bedroom/reset.js @@ -1,19 +1,19 @@ -const mbrLastMode = flow.get('mbrLastMode', "diskCon") +const lastMode = flow.get('masterBedroom.lastMode', "diskCon") const linkSource = msg._linkSource let setTime = [] let setType = [] let setTopic = [] -if (mbrLastMode === 'day') { +if (lastMode === 'day') { setTime = 'day' setType = 'manual' setTopic = 'manual-day' -} else if (mbrLastMode === 'night') { +} else if (lastMode === 'night') { setTime = 'night' setType = 'manual' setTopic = 'manual-night' -} else if (mbrLastMode === 'bedtime') { +} else if (lastMode === 'bedtime') { setTime = 'bedtime' setType = 'manual' setTopic = 'manual-bedtime' diff --git a/climate/master-bedroom/set-mode.js b/climate/master-bedroom/set-mode.js index a57a2ff..100f45f 100644 --- a/climate/master-bedroom/set-mode.js +++ b/climate/master-bedroom/set-mode.js @@ -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 mbrLastMode = [] +let lastMode = [] if (sleeping === 'on' || nightMode === 'on' || goodnight === 'on') { - mbrLastMode = 'bedtime' + lastMode = 'bedtime' } else if (earlyNight === 'on' || giveMeDarkness === 'on' || coolingActive === 'on') { - mbrLastMode = 'night' + lastMode = 'night' } else { - mbrLastMode = 'day' + lastMode = 'day' } -flow.set("mbrLastMode", mbrLastMode, "diskCon") -node.status({ fill: "green", shape: "dot", text: `Last Mode Set: ${mbrLastMode}`}) \ No newline at end of file +flow.set("masterBedroom.lastMode", lastMode, "diskCon") +node.status({ fill: "green", shape: "dot", text: `Last Mode Set: ${lastMode}`}) \ No newline at end of file