Improve node status on Tina Work node in presence flow
This commit is contained in:
@ -10634,7 +10634,7 @@
|
||||
"type": "function",
|
||||
"z": "3abb5ae57afb4761",
|
||||
"name": "Processing",
|
||||
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst workEndZone = states['binary_sensor.tina_work_end_zone'].state\nconst tinawork = msg.tinawork\n\nif (tinawork === 'on' && workEndZone === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Activated\"})\n return[msg,null]\n} else if (tinawork === 'off') {\n node.status({fill:\"yellow\",shape:\"dot\",text:\"No Work Today\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"We fucked up\"})\n node.warn(\"Tina presence flow encountered a situation we did not account for\")\n return[null,msg]\n}",
|
||||
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst workEndZone = states['binary_sensor.tina_work_end_zone'].state\nconst tinawork = msg.tinawork\n\nif (tinawork === 'on' && workEndZone === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Activated\"})\n return[msg,null]\n} else if (tinawork === 'on' && workEndZone === 'off') {\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Not time to leave yet\"})\n return null\n} else if (tinawork === 'off') {\n node.status({fill:\"yellow\",shape:\"dot\",text:\"No Work Today\"})\n return null\n} else {\n node.status({fill:\"red\",shape:\"ring\",text:\"We fucked up\"})\n node.warn(\"Tina presence flow encountered a situation we did not account for\")\n return[null,msg]\n}",
|
||||
"outputs": 2,
|
||||
"timeout": "",
|
||||
"noerr": 0,
|
||||
|
Reference in New Issue
Block a user