mirror of
https://github.com/Koenkk/zigbee-OTA.git
synced 2026-10-03 09:47:05 +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)_
|
- "maxFileVersion": number _(target only devices with this version or below)_
|
||||||
- "minFileVersion": number _(target only devices with this version or above)_
|
- "minFileVersion": number _(target only devices with this version or above)_
|
||||||
- "modelId": string _(target only devices with this model ID)_
|
- "modelId": string _(target only devices with this model ID)_
|
||||||
|
- "customParseLogic": string _(custom parsing logic used for this image)_
|
||||||
|
|
||||||
###### For record purpose
|
###### For record purpose
|
||||||
|
|
||||||
|
|||||||
@@ -308,6 +308,14 @@ export function getValidMetas(metas: Partial<ExtraMetas & ExtraMetasWithFileName
|
|||||||
validMetas.maxFileVersion = metas.maxFileVersion;
|
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 (metas.minFileVersion != null) {
|
||||||
if (typeof metas.minFileVersion !== "number") {
|
if (typeof metas.minFileVersion !== "number") {
|
||||||
throw new Error(`Invalid format for 'minFileVersion', expected 'number' type.`);
|
throw new Error(`Invalid format for 'minFileVersion', expected 'number' type.`);
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export interface RepoImageMeta extends ImageInfo, ImageMeta {
|
|||||||
maxFileVersion?: number;
|
maxFileVersion?: number;
|
||||||
originalUrl?: string;
|
originalUrl?: string;
|
||||||
releaseNotes?: string;
|
releaseNotes?: string;
|
||||||
|
customParseLogic?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExtraMetas = Omit<
|
export type ExtraMetas = Omit<
|
||||||
|
|||||||
Reference in New Issue
Block a user