From 86125d9532c067b5e5d0063bbf19f23510cc1429 Mon Sep 17 00:00:00 2001 From: Nerivec <62446222+Nerivec@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:02:57 +0100 Subject: [PATCH] fix: cleanup old image refs --- index-stackinfo.json | 6 ------ index.json | 26 -------------------------- index1.json | 11 ----------- src/check_images.ts | 23 +++++++++++++++++++++++ src/ghw_identify_stacks.ts | 2 +- 5 files changed, 24 insertions(+), 44 deletions(-) create mode 100644 src/check_images.ts diff --git a/index-stackinfo.json b/index-stackinfo.json index a58b092..5edfe8c 100644 --- a/index-stackinfo.json +++ b/index-stackinfo.json @@ -1793,12 +1793,6 @@ "stackDetails": "", "zigbeeStackVersion": "ZigBeePro" }, - { - "url": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Lumi/20211124154453_OTA_lumi.switch.n1aeu1_0.0.0_1123_20211110.ota", - "stack": "Unknown", - "stackDetails": "", - "zigbeeStackVersion": "ZigBeePro" - }, { "url": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Lumi/20211228121851_OTA_lumi.switch.b1nacn02_0.0.0_0065_20211223_EB5B32.ota", "stack": "Unknown", diff --git a/index.json b/index.json index a1e1356..1eff899 100644 --- a/index.json +++ b/index.json @@ -6320,32 +6320,6 @@ "otaHeaderString": "RBSH-TRV0-ZB-EU", "modelId": "RBSH-TRV0-ZB-EU" }, - { - "fileName": "6565-0212-10043001-ZG_222Z.zigbee", - "fileVersion": 268709889, - "fileSize": 153554, - "url": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/SlackyDiy/6565-0212-10043001-ZG_222Z.zigbee", - "imageType": 530, - "manufacturerCode": 25957, - "sha512": "7e7ff5a8fcf6113e358826a00fbfdaee590765dbd89853f614659d88d7b732d66f578008b4948c748a590adf9c62344ff76be75f45b1846d1bc76a212df48147", - "otaHeaderString": "", - "manufacturerName": [ - "Slacky-DIY" - ] - }, - { - "fileName": "6565-0213-10043001-SNZB_05.zigbee", - "fileVersion": 268709889, - "fileSize": 153538, - "url": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/SlackyDiy/6565-0213-10043001-SNZB_05.zigbee", - "imageType": 531, - "manufacturerCode": 25957, - "sha512": "6e3f5c06a58e7f11f6010dd94e29a915796bc79e667f3a1ff78ee6f1239a4f90c93eae7cd6f5dfab5fc8177caf644d1366d7c9ac53cf0c5c8fe8e18c92e1e020", - "otaHeaderString": "", - "manufacturerName": [ - "Slacky-DIY" - ] - }, { "fileName": "EntrySensor_4.0.3.zigbee", "fileVersion": 262147, diff --git a/index1.json b/index1.json index 358fea7..3f1b5ce 100644 --- a/index1.json +++ b/index1.json @@ -2500,17 +2500,6 @@ "Slacky-DIY" ] }, - { - "fileName": "20211124154453_OTA_lumi.switch.n1aeu1_0.0.0_1123_20211110.ota", - "fileVersion": 2839, - "fileSize": 294136, - "url": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Lumi/20211124154453_OTA_lumi.switch.n1aeu1_0.0.0_1123_20211110.ota", - "imageType": 5404, - "manufacturerCode": 4447, - "sha512": "140be0a40f40f84fcb1878ba623ad5830bfab2049f489ee7acf8ae22c1db1e4991fbf39832482a55fee2fc5b20681d9ab5592d457d1e5bf705b0c75af45eff1f", - "otaHeaderString": "ROUTERX-----JN5180--ENCRYPTED000", - "modelId": "lumi.switch.n1aeu1" - }, { "fileName": "20221009111923_OTA_lumi.curtain.acn002_0.0.0_1530_20221009_6C9C3D.ota", "fileVersion": 3870, diff --git a/src/check_images.ts b/src/check_images.ts new file mode 100644 index 0000000..15a2b3a --- /dev/null +++ b/src/check_images.ts @@ -0,0 +1,23 @@ +import {existsSync} from "node:fs"; +import {join} from "node:path"; +import {BASE_INDEX_MANIFEST_FILENAME, BASE_REPO_URL, PREV_INDEX_MANIFEST_FILENAME, REPO_BRANCH, readManifest} from "./common"; + +const baseManifest = readManifest(BASE_INDEX_MANIFEST_FILENAME); + +for (const meta of baseManifest) { + const filePath = decodeURIComponent(meta.url.replace(BASE_REPO_URL + REPO_BRANCH, "")); + + if (!existsSync(join(".", filePath))) { + console.error(`BASE MISSING: ${filePath}`); + } +} + +const prevManifest = readManifest(PREV_INDEX_MANIFEST_FILENAME); + +for (const meta of prevManifest) { + const filePath = decodeURIComponent(meta.url.replace(BASE_REPO_URL + REPO_BRANCH, "")); + + if (!existsSync(join(".", filePath))) { + console.error(`PREV MISSING: ${filePath}`); + } +} diff --git a/src/ghw_identify_stacks.ts b/src/ghw_identify_stacks.ts index 66133b8..c80402e 100644 --- a/src/ghw_identify_stacks.ts +++ b/src/ghw_identify_stacks.ts @@ -182,7 +182,7 @@ export function identifyStacks(_github: Octokit, core: typeof CoreApi, _context: break; } - core.info(`UNKNOWN ${filePath} tagId=${tagId} firstBytes=${data.subarray(0, 16).toString("hex")}`); + // core.info(`UNKNOWN ${filePath} tagId=${tagId} firstBytes=${data.subarray(0, 16).toString("hex")}`); } if (stack === "Unknown") {