diff --git a/README.md b/README.md index 69587f7..3c566b1 100644 --- a/README.md +++ b/README.md @@ -442,7 +442,7 @@ Example Data: | -------- | ------ | ----------- | --------------------------------------- | | 0 (AA) | 2 | uint16 (LE) | Drying Temperature in °C | | 2 (BB) | 2 | uint16 (LE) | Drying time in hours | -| 4 (CC) | 4 | uint16 (LE) | Bed Temerature Type **(types unknown)** | +| 4 (CC) | 2 | uint16 (LE) | Bed Temerature Type **(types unknown)** | | 6 (DD) | 2 | uint16 (LE) | Bed Temperature in °C | | 8 (EE) | 2 | uint16 (LE) | Max Temperature for Hotend in °C | | 10 (FF) | 2 | uint16 (LE) | Min Temperature for Hotend in °C | diff --git a/parse.py b/parse.py index 79c47b5..04a90e4 100644 --- a/parse.py +++ b/parse.py @@ -82,6 +82,31 @@ def __gt__(self, other): values = self.__get_comparison_values(self, other) return values[0] > values[1] +class ColorList(list): + def __init__(self, value): + if type(value) in [list, tuple]: + super().__init__(value) + else: + super().__init__([value]) + + def __str__(self): + return " / ".join("#" + c for c in self) + + def __setitem__(self, index, item): + super().__setitem__(index, str(item)) + + def insert(self, index, item): + super().insert(index, str(item)) + + def append(self, item): + super().append(str(item)) + + def extend(self, other): + if isinstance(other, type(self)): + super().extend(other) + else: + super().extend(str(item) for item in other) + class Tag(): def __init__(self, filename, data): # Check to make sure the data is 1KB