From ccf5944192bf43ee74b443c7c9fa2f02f4de4544 Mon Sep 17 00:00:00 2001 From: KG Date: Mon, 22 Apr 2024 12:04:14 -0400 Subject: [PATCH] Add extra coercion warning --- tivars/flash.py | 4 ++++ tivars/var.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tivars/flash.py b/tivars/flash.py index 340d68b..f86146b 100644 --- a/tivars/flash.py +++ b/tivars/flash.py @@ -790,5 +790,9 @@ def coerce(self): warn(f"Type ID 0x{self.type_id:02x} is not recognized; header will not be coerced to a subclass.", BytesWarning) + else: + warn("Type ID is 0xFF, no coercion will occur.", + UserWarning) + __all__ = ["DeviceType", "BCDDate", "BCDRevision", "TIFlashBlock", "TIFlashHeader"] diff --git a/tivars/var.py b/tivars/var.py index b42dd99..4315ca4 100644 --- a/tivars/var.py +++ b/tivars/var.py @@ -867,6 +867,10 @@ def coerce(self): warn(f"Type ID 0x{self.type_id:02x} is not recognized; entry will not be coerced to a subclass.", BytesWarning) + else: + warn("Type ID is 0xFF, no coercion will occur.", + UserWarning) + class TIVar: """