Call variable for Tina presence

This commit is contained in:
2022-10-23 15:11:54 -04:00
parent cc10c0482d
commit 884f2d0fbc

View File

@@ -997,9 +997,7 @@
"59af14a564176ce4" "59af14a564176ce4"
], ],
"x": 34, "x": 34,
"y": 239, "y": 239
"w": 1032,
"h": 382
}, },
{ {
"id": "eeafd13be593ae69", "id": "eeafd13be593ae69",
@@ -7350,6 +7348,12 @@
"propertyType": "msg", "propertyType": "msg",
"value": "presence", "value": "presence",
"valueType": "str" "valueType": "str"
},
{
"property": "tinawork",
"propertyType": "msg",
"value": "tinawork",
"valueType": "global"
} }
], ],
"x": 170, "x": 170,
@@ -7359,8 +7363,8 @@
"a0c7649e26e66ddb", "a0c7649e26e66ddb",
"35d7371023527600", "35d7371023527600",
"edaa6ff605ba6fa7", "edaa6ff605ba6fa7",
"abdb3c9694b18a39", "26f15fc8d75a4020",
"26f15fc8d75a4020" "7ff36affdeacadba"
], ],
[ [
"898659d514aa58fd" "898659d514aa58fd"
@@ -7727,31 +7731,12 @@
[] []
] ]
}, },
{
"id": "abdb3c9694b18a39",
"type": "function",
"z": "3abb5ae57afb4761",
"name": "Get Variable - Tinawork",
"func": "var tinawork = global.get('tinawork')\n\nif (tinawork === \"on\") {\n msg.payload = \"on\"\n} else if (tinawork === \"off\") {\n msg.payload = \"off\"\n} else {\n msg.payload = \"unknown\"\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 430,
"y": 340,
"wires": [
[
"7ff36affdeacadba"
]
]
},
{ {
"id": "7ff36affdeacadba", "id": "7ff36affdeacadba",
"type": "switch", "type": "switch",
"z": "3abb5ae57afb4761", "z": "3abb5ae57afb4761",
"name": "", "name": "",
"property": "payload", "property": "tinawork",
"propertyType": "msg", "propertyType": "msg",
"rules": [ "rules": [
{ {
@@ -7765,15 +7750,13 @@
"vt": "str" "vt": "str"
}, },
{ {
"t": "eq", "t": "else"
"v": "unknown",
"vt": "str"
} }
], ],
"checkall": "true", "checkall": "true",
"repair": false, "repair": false,
"outputs": 3, "outputs": 3,
"x": 650, "x": 370,
"y": 340, "y": 340,
"wires": [ "wires": [
[ [