From 81554e60fda515d54253fcb9dfea356c275dc975 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Mon, 27 Mar 2023 17:20:30 -0400 Subject: [PATCH] Rework and simplify holiday code --- flows.json | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/flows.json b/flows.json index 74d3711..e9a0841 100644 --- a/flows.json +++ b/flows.json @@ -7353,7 +7353,7 @@ "type": "function", "z": "e44b1e7a8ef7ae1d", "name": "Holiday Code", - "func": "var holidaymode = global.get('holidaymode')\nvar currentholiday = global.get('currentholiday')\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return msg;\n} else {\n return null;\n}", + "func": "var states = global.get('homeassistant.homeAssistant.states')\nvar holidaymode = states['input_boolean.holiday_mode'].state\nvar currentholiday = states['input_select.holiday_animation'].state\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return msg;\n} else {\n return null;\n}", "outputs": 1, "noerr": 0, "initialize": "", @@ -7432,7 +7432,7 @@ "type": "function", "z": "e44b1e7a8ef7ae1d", "name": "Holiday Code", - "func": "var holidaymode = global.get('holidaymode')\nvar currentholiday = global.get('currentholiday')\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return msg;\n} else {\n return null;\n}", + "func": "var states = global.get('homeassistant.homeAssistant.states')\nvar holidaymode = states['input_boolean.holiday_mode'].state\nvar currentholiday = states['input_select.holiday_animation'].state\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return msg;\n} else {\n return null;\n}", "outputs": 1, "noerr": 0, "initialize": "", @@ -26343,6 +26343,7 @@ "id": "d6e563414b1612f0", "type": "server-state-changed", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "Holiday Mode", "server": "9e87348d.9c1c48", @@ -26395,6 +26396,7 @@ "id": "d4b42e41189b6b3c", "type": "inject", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "Set Holiday Mode on Reboot", "props": [ @@ -26421,6 +26423,7 @@ "id": "4857e3af9d5250e3", "type": "api-current-state", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "Holiday Mode", "server": "9e87348d.9c1c48", @@ -26460,6 +26463,7 @@ "id": "8ed3d0b6a1a6359f", "type": "server-state-changed", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "Current Holiday", "server": "9e87348d.9c1c48", @@ -26512,6 +26516,7 @@ "id": "82dcd22b8e2adf7c", "type": "inject", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "Set Current Holiday on Reboot", "props": [ @@ -26538,6 +26543,7 @@ "id": "1bb64ed65666e9ca", "type": "api-current-state", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "Current Holiday", "server": "9e87348d.9c1c48", @@ -26596,6 +26602,7 @@ "id": "3cd66ee80d7b2715", "type": "mqtt out", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "MQTT Publish", "topic": "house/modes/holiday/state", @@ -26615,6 +26622,7 @@ "id": "420322f4757ddf6e", "type": "mqtt out", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "MQTT Publish", "topic": "house/modes/holiday/current", @@ -26960,6 +26968,7 @@ "id": "30a87624bbab1d74", "type": "change", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "", "rules": [ @@ -26988,6 +26997,7 @@ "id": "6757f301f06e1483", "type": "change", "z": "3e4ba157b540d183", + "d": true, "g": "5c50443a84910fb7", "name": "", "rules": [