mirror of
https://github.com/Koenkk/zigbee-OTA.git
synced 2026-06-24 12:26:24 +00:00
Allow non Gledopto manuf name for images with Gledopto manuf code
This commit is contained in:
@@ -149,7 +149,11 @@ export async function processOtaFiles(
|
||||
const statusToBase = getParsedImageStatus(parsedImage, baseMatch);
|
||||
|
||||
// Manufacturer specific checks
|
||||
if (parsedImage.manufacturerCode === GLEDOPTO_MANUFACTURER_CODE && !fileExtraMetas.modelId) {
|
||||
if (
|
||||
parsedImage.manufacturerCode === GLEDOPTO_MANUFACTURER_CODE &&
|
||||
!fileExtraMetas.modelId &&
|
||||
(fileExtraMetas.manufacturerName == null || fileExtraMetas.manufacturerName.some((name) => name.toLowerCase().includes("gledopto")))
|
||||
) {
|
||||
// Gledopto uses the same imageType for every device, force modelId to be present.
|
||||
// https://github.com/Koenkk/zigbee-OTA/pull/864
|
||||
throw new Error("Gledopto image requires extra `modelId` metadata");
|
||||
|
||||
@@ -634,6 +634,8 @@ Text after end tag`);
|
||||
["", IMAGE_TUYA, "Tuya image requires extra `manufacturerName` metadata"],
|
||||
['"modelId": "GL-C-008"', IMAGE_GLEDOPTO, undefined],
|
||||
["", IMAGE_GLEDOPTO, "Gledopto image requires extra `modelId` metadata"],
|
||||
['"manufacturerName": ["GleDopto"]', IMAGE_GLEDOPTO, "Gledopto image requires extra `modelId` metadata"],
|
||||
['"manufacturerName": ["OtherManuf"]', IMAGE_GLEDOPTO, undefined],
|
||||
])("manufacturer specific checks", async (body: string, image: string, error: string | undefined) => {
|
||||
filePaths = [useImage(image)];
|
||||
const newContext = withBody(`\`\`\`json
|
||||
|
||||
Reference in New Issue
Block a user