diff --git a/src/pwp.py b/src/pwp.py index eb5f4da..3305468 100644 --- a/src/pwp.py +++ b/src/pwp.py @@ -2,10 +2,11 @@ import struct import typing from typing import get_type_hints, get_origin, get_args - class PWPError(Exception): pass +class uint8: + pass def encode_value(value, typ) -> bytes: origin = get_origin(typ) @@ -61,7 +62,9 @@ def encode_value(value, typ) -> bytes: if typ is bool: return b"\x01" if value else b"\x00" - # nested PWP class + if typ is uint8: + return struct.pack("