diff --git a/vban_cmd/base.py b/vban_cmd/base.py index ffb06ff..1adaa12 100644 --- a/vban_cmd/base.py +++ b/vban_cmd/base.py @@ -70,6 +70,7 @@ class VbanCmd(metaclass=ABCMeta): self._public_packet = self._get_rt() worker2 = Thread(target=self._updates, daemon=True) worker2.start() + time.sleep(0.1) def _send_register_rt(self): """Fires a subscription packet every 10 seconds""" @@ -143,6 +144,8 @@ class VbanCmd(metaclass=ABCMeta): self.text_header.framecounter = count.to_bytes(4, "little") if param: self.cache[f"{id_}.{param}"] = val + if self.sync: + time.sleep(0.02) @script def sendtext(self, cmd): diff --git a/vban_cmd/command.py b/vban_cmd/command.py index f1c7e08..88fd080 100644 --- a/vban_cmd/command.py +++ b/vban_cmd/command.py @@ -43,3 +43,6 @@ class Command(IRemote): self.setter("lock", 1 if val else 0) lock = property(fset=set_lock) + + def reset(self): + self._remote.apply_config("reset") diff --git a/vban_cmd/packet.py b/vban_cmd/packet.py index f9ff8ed..96ef829 100644 --- a/vban_cmd/packet.py +++ b/vban_cmd/packet.py @@ -187,7 +187,7 @@ class VBAN_VMRT_Packet_Data: def striplabels(self) -> tuple: """returns tuple of strip labels""" return tuple( - self._stripLabelUTF8c60[i : i + 60].decode("ascii").split("\x00")[0] + self._stripLabelUTF8c60[i : i + 60].decode().split("\x00")[0] for i in range(0, 480, 60) ) @@ -195,7 +195,7 @@ class VBAN_VMRT_Packet_Data: def buslabels(self) -> tuple: """returns tuple of bus labels""" return tuple( - self._busLabelUTF8c60[i : i + 60].decode("ascii").split("\x00")[0] + self._busLabelUTF8c60[i : i + 60].decode().split("\x00")[0] for i in range(0, 480, 60) )