mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2025-01-18 18:40:47 +00:00
Update dataclass.py
add check for empty labels
This commit is contained in:
parent
6098c34e15
commit
18f59b4eb2
@ -108,12 +108,20 @@ class VBAN_VMRT_Packet_Data:
|
|||||||
return tuple(((1 << 16) - 1) - int.from_bytes(self._busGaindB100[i:i+2], 'little') for i in range(0, 16, 2))
|
return tuple(((1 << 16) - 1) - int.from_bytes(self._busGaindB100[i:i+2], 'little') for i in range(0, 16, 2))
|
||||||
@property
|
@property
|
||||||
def striplabels(self) -> tuple:
|
def striplabels(self) -> tuple:
|
||||||
""" returns tuple of strip labels """
|
""" returns list of strip labels """
|
||||||
return tuple(self._stripLabelUTF8c60[i:i+60].decode().strip('\x00') for i in range(0, 480, 60))
|
labels = list(self._stripLabelUTF8c60[i:i+60].decode().rstrip('\x00') for i in range(0, 480, 60))
|
||||||
|
for i, label in enumerate(labels):
|
||||||
|
if label != label.lstrip('\x00'):
|
||||||
|
labels[i] = None
|
||||||
|
return labels
|
||||||
@property
|
@property
|
||||||
def buslabels(self) -> tuple:
|
def buslabels(self) -> tuple:
|
||||||
""" returns tuple of bus labels """
|
""" returns list of bus labels """
|
||||||
return tuple(self._busLabelUTF8c60[i:i+60].decode().strip('\x00') for i in range(0, 480, 60))
|
labels = list(self._busLabelUTF8c60[i:i+60].decode().rstrip('\x00') for i in range(0, 480, 60))
|
||||||
|
for i, label in enumerate(labels):
|
||||||
|
if label != label.lstrip('\x00'):
|
||||||
|
labels[i] = None
|
||||||
|
return labels
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class VBAN_VMRT_Packet_Header:
|
class VBAN_VMRT_Packet_Header:
|
||||||
|
Loading…
Reference in New Issue
Block a user