From 3569a769b4d3528aa13b097fdca00dfc95fd244f Mon Sep 17 00:00:00 2001 From: WolfwithSword <12175651+WolfwithSword@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:08:03 -0300 Subject: [PATCH] Fix x1plus OTA update --- files/nodered/resources/versions.json | 4 ++-- files/nodered/x1plus_flow_group.json | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/nodered/resources/versions.json b/files/nodered/resources/versions.json index e06da3c..85ecde1 100644 --- a/files/nodered/resources/versions.json +++ b/files/nodered/resources/versions.json @@ -5,7 +5,7 @@ "bedmesh_adv_flow": "2.1.3", "cloud_login": "2.1.5", "dashboard_yamls": "2.1.5", - "x1plus_flow": "2.1.5.1", + "x1plus_flow": "2.1.6", "dates" : { "basic_flow": "2024-06-24", "advanced_flow": "2024-06-02", @@ -13,6 +13,6 @@ "bedmesh_adv_flow": "2024-05-15", "cloud_login": "2024-06-17", "dashboard_yamls": "2024-06-17", - "x1plus_flow": "2024-06-23" + "x1plus_flow": "2024-06-26" } } \ No newline at end of file diff --git a/files/nodered/x1plus_flow_group.json b/files/nodered/x1plus_flow_group.json index 77a17f9..e2e5080 100644 --- a/files/nodered/x1plus_flow_group.json +++ b/files/nodered/x1plus_flow_group.json @@ -100,7 +100,7 @@ "z": "fbda6ab16491b918", "g": "258d2ebeb830080f", "name": "Check Values Error", - "func": "flow.set(\"has_x1p_flow\", true);\nflow.set(\"x1plus_flow_version\", \"2.1.5.1\");\nfunction testValue(val) {\n return (val == undefined || val == \"\" || val.startsWith(\"{\"));\n}\n\nif (!flow.get(\"has_basic_flow\")) {\n node.error(\"X1Plus Flow cannot be used without the Basic Flow group in the same flow.\");\n return;\n}\nif (!flow.get(\"x1plus_installed\")) {\n node.error(\"X1Plus Flow requires X1Plus to be installed and set in the settings [x1plus_installed]\");\n return;\n}\nif (testValue(flow.get(\"model\"))) {\n node.error(\"Printer model is not set in flow properties\");\n}\nif (testValue(flow.get(\"printer_name\"))) {\n node.error(\"Printer name is not set in flow properties\");\n}\nif (testValue(flow.get(\"printer_serial\"))) {\n node.error(\"Printer serialnumber is not set in flow properties\");\n}\nif (testValue(flow.get(\"root_topic\"))) {\n node.warn(\"Root Topic is not set, defaulting to homeassistant\");\n flow.set(\"root_topic\", \"homeassistant\");\n}", + "func": "flow.set(\"has_x1p_flow\", true);\nflow.set(\"x1plus_flow_version\", \"2.1.6\");\nfunction testValue(val) {\n return (val == undefined || val == \"\" || val.startsWith(\"{\"));\n}\n\nif (!flow.get(\"has_basic_flow\")) {\n node.error(\"X1Plus Flow cannot be used without the Basic Flow group in the same flow.\");\n return;\n}\nif (!flow.get(\"x1plus_installed\")) {\n node.error(\"X1Plus Flow requires X1Plus to be installed and set in the settings [x1plus_installed]\");\n return;\n}\nif (testValue(flow.get(\"model\"))) {\n node.error(\"Printer model is not set in flow properties\");\n}\nif (testValue(flow.get(\"printer_name\"))) {\n node.error(\"Printer name is not set in flow properties\");\n}\nif (testValue(flow.get(\"printer_serial\"))) {\n node.error(\"Printer serialnumber is not set in flow properties\");\n}\nif (testValue(flow.get(\"root_topic\"))) {\n node.warn(\"Root Topic is not set, defaulting to homeassistant\");\n flow.set(\"root_topic\", \"homeassistant\");\n}", "outputs": 1, "timeout": "", "noerr": 0, @@ -270,7 +270,7 @@ "addpay": "payload", "append": "", "useSpawn": "false", - "timer": "20", + "timer": "60", "sigint": true, "x": 3350, "y": 1180, @@ -977,7 +977,7 @@ "z": "fbda6ab16491b918", "g": "258d2ebeb830080f", "name": "Update", - "func": "let x1plus = \"/opt/x1plus/bin/x1plus\"\nif (msg.payload == \"update_fw\") {\n msg.payload = `${x1plus} ota update`;\n}\nreturn msg;", + "func": "let x1plus = \"/opt/x1plus/bin/x1plus\"\nif (msg.payload == \"update_fw\") {\n msg.payload = `${x1plus} ota download && ${x1plus} ota update`;\n}\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, @@ -1116,9 +1116,9 @@ "type": "comment", "z": "fbda6ab16491b918", "g": "258d2ebeb830080f", - "name": "Version 2.1.5.1", - "info": "Version 2.1.5: 2024-06-17\n - Initial Release\n - Requires X1Plus v2.0+\n - Provides a toggle switch for VNC and OTA\n - Provides sensor for current X1P version and OEM version\n - Provides update OTA functionality if a new version of X1Plus is present and detected by X1P\n - Provides a button to force check for firmware OTA updates\n - Currently polls the printer when it turns on and every 5 minutes for settings, 6 hours for Fw", - "x": 2620, + "name": "Version 2.1.6", + "info": "Version 2.1.5: 2024-06-26\n - Fixed OTA update not downloading\n\n===\nVersion 2.1.5: 2024-06-17\n - Initial Release\n - Requires X1Plus v2.0+\n - Provides a toggle switch for VNC and OTA\n - Provides sensor for current X1P version and OEM version\n - Provides update OTA functionality if a new version of X1Plus is present and detected by X1P\n - Provides a button to force check for firmware OTA updates\n - Currently polls the printer when it turns on and every 5 minutes for settings, 6 hours for Fw", + "x": 2610, "y": 1140, "wires": [] },