mirror of
https://github.com/Koenkk/zigbee-OTA.git
synced 2026-06-24 12:44:25 +00:00
Support customParseLogic in meta
This commit is contained in:
@@ -85,6 +85,7 @@ Any field not in this list will be ignored. Any field not matching the required
|
||||
- "maxFileVersion": number _(target only devices with this version or below)_
|
||||
- "minFileVersion": number _(target only devices with this version or above)_
|
||||
- "modelId": string _(target only devices with this model ID)_
|
||||
- "customParseLogic": string _(custom parsing logic used for this image)_
|
||||
|
||||
###### For record purpose
|
||||
|
||||
|
||||
@@ -308,6 +308,14 @@ export function getValidMetas(metas: Partial<ExtraMetas & ExtraMetasWithFileName
|
||||
validMetas.maxFileVersion = metas.maxFileVersion;
|
||||
}
|
||||
|
||||
if (metas.customParseLogic != null) {
|
||||
if (metas.customParseLogic === "telinkEncrypted") {
|
||||
throw new Error(`Invalid value for 'customParseLogic', expected 'telinkEncrypted' type.`);
|
||||
}
|
||||
|
||||
validMetas.customParseLogic = metas.customParseLogic;
|
||||
}
|
||||
|
||||
if (metas.minFileVersion != null) {
|
||||
if (typeof metas.minFileVersion !== "number") {
|
||||
throw new Error(`Invalid format for 'minFileVersion', expected 'number' type.`);
|
||||
|
||||
@@ -61,6 +61,7 @@ export interface RepoImageMeta extends ImageInfo, ImageMeta {
|
||||
maxFileVersion?: number;
|
||||
originalUrl?: string;
|
||||
releaseNotes?: string;
|
||||
customParseLogic?: string;
|
||||
}
|
||||
|
||||
export type ExtraMetas = Omit<
|
||||
|
||||
Reference in New Issue
Block a user