From 361c908490489b7b371be44cdf0428bccad5eddc Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Wed, 4 Jan 2023 16:58:24 -0500 Subject: [PATCH] Add tester for iOS Actionable Notifications --- flows.json | 252 ++++++++++++++++++++++++++++++++++++++++++++++-- flows_cred.json | 2 +- 2 files changed, 244 insertions(+), 10 deletions(-) diff --git a/flows.json b/flows.json index b47c0d6..d8d1861 100644 --- a/flows.json +++ b/flows.json @@ -678,9 +678,7 @@ "da70285e80c3f195" ], "x": 94, - "y": 339, - "w": 1872, - "h": 582 + "y": 339 }, { "id": "39a7ac02f2727f1d", @@ -720,9 +718,7 @@ "e0751f3bf2a2e610" ], "x": 14, - "y": 759, - "w": 1172, - "h": 482 + "y": 759 }, { "id": "e065b1ed4938b477", @@ -814,9 +810,7 @@ "67509a5554fc091f" ], "x": 14, - "y": 59, - "w": 2722, - "h": 682 + "y": 59 }, { "id": "5c50443a84910fb7", @@ -26352,5 +26346,245 @@ "x": 940, "y": 320, "wires": [] + }, + { + "id": "37a6dae6087598a2", + "type": "function", + "z": "d49b385d8b582b20", + "name": "Phone Clear {}", + "func": "var tag = \"trash-day\"\nmsg.payload =\n{\n \"data\": {\n \"message\": \"clear_notification\",\n \"data\": {\n \"tag\": tag\n }\n }\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1000, + "y": 680, + "wires": [ + [ + "b232b793f5a2db25" + ] + ] + }, + { + "id": "96960c7fa6844fed", + "type": "function", + "z": "d49b385d8b582b20", + "name": "Phone Notify {}", + "func": "var title = \"Trash day tomorrow!!!\"\nvar message = \"Put out the {{states.calendar.garbage.attributes.message | title }}!!\"\nvar color = \"blue\"\nvar tag = \"trash-day\"\nvar icon = \"mdi:delete-circle-outline\"\nvar group = \"Chores\"\nvar imp = \"high\"\nvar action = \"mark-bin-chore-done\"\nvar actiontitle = \"Done\"\nmsg.payload =\n{\n \"data\": {\n \"message\": message,\n \"title\": title,\n \"data\": {\n \"actions\": [\n {\n \"action\": action,\n \"title\": actiontitle\n }\n ],\n \"persistent\": true,\n \"color\": color,\n \"importance\": imp,\n \"tag\": tag,\n \"notification_icon\": icon,\n \"channel\": group,\n \"group\": group\n }\n }\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1000, + "y": 640, + "wires": [ + [ + "b232b793f5a2db25" + ] + ] + }, + { + "id": "c5da8c331c8cc0de", + "type": "server-events", + "z": "d49b385d8b582b20", + "name": "Notification Marked Done", + "server": "9e87348d.9c1c48", + "version": 2, + "eventType": "mobile_app_notification_action", + "exposeToHomeAssistant": false, + "eventData": "", + "haConfig": [ + { + "property": "name", + "value": "" + }, + { + "property": "icon", + "value": "" + } + ], + "waitForRunning": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + } + ], + "x": 730, + "y": 700, + "wires": [ + [ + "93aa1cbe91280dd5" + ] + ] + }, + { + "id": "93aa1cbe91280dd5", + "type": "switch", + "z": "d49b385d8b582b20", + "name": "", + "property": "payload.event.action", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "mark-bin-chore-done", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 1, + "x": 875, + "y": 700, + "wires": [ + [ + "37a6dae6087598a2", + "b84f59365bf804ce" + ] + ], + "l": false + }, + { + "id": "b232b793f5a2db25", + "type": "api-call-service", + "z": "d49b385d8b582b20", + "name": "Push to Phone", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "notify", + "service": "mobile_app_chris_pixel_4_xl", + "areaId": [], + "deviceId": [], + "entityId": [], + "data": "{}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1180, + "y": 660, + "wires": [ + [] + ] + }, + { + "id": "13f03d5ea1783af6", + "type": "server-state-changed", + "z": "d49b385d8b582b20", + "name": "Chore needs doing", + "server": "9e87348d.9c1c48", + "version": 4, + "exposeToHomeAssistant": false, + "haConfig": [ + { + "property": "name", + "value": "" + }, + { + "property": "icon", + "value": "" + } + ], + "entityidfilter": "script.activate_alexa_actionable_notification", + "entityidfiltertype": "exact", + "outputinitially": false, + "state_type": "str", + "haltifstate": "off", + "halt_if_type": "str", + "halt_if_compare": "is", + "outputs": 2, + "output_only_on_state_change": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 750, + "y": 660, + "wires": [ + [ + "96960c7fa6844fed" + ], + [ + "37a6dae6087598a2" + ] + ] + }, + { + "id": "b84f59365bf804ce", + "type": "api-call-service", + "z": "d49b385d8b582b20", + "name": "Mark Chore Done", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "input_boolean", + "service": "turn_on", + "areaId": [], + "deviceId": [], + "entityId": [ + "input_boolean.chore_conditional_put_out_bins" + ], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1010, + "y": 720, + "wires": [ + [] + ] + }, + { + "id": "2167dda9544af7b7", + "type": "comment", + "z": "d49b385d8b582b20", + "name": "iOS Actionable Notifications Example", + "info": "", + "x": 980, + "y": 580, + "wires": [] + }, + { + "id": "87a6983fc1885649", + "type": "comment", + "z": "d49b385d8b582b20", + "name": "Alexa Actionable Notifications Tester", + "info": "", + "x": 800, + "y": 260, + "wires": [] } ] \ No newline at end of file diff --git a/flows_cred.json b/flows_cred.json index c02f69c..441fb03 100644 --- a/flows_cred.json +++ b/flows_cred.json @@ -1,3 +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