From b4f1b8b93f3c6f349209d50217848c7bd4ade897 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Thu, 16 Jun 2022 22:20:37 +0100 Subject: [PATCH] Update base.py fix bug setting dirty parameters --- vban_cmd/base.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/vban_cmd/base.py b/vban_cmd/base.py index 2dd967c..e59724d 100644 --- a/vban_cmd/base.py +++ b/vban_cmd/base.py @@ -198,21 +198,23 @@ class VbanCmd(metaclass=ABCMeta): ) ), ) + self._pdirty = private_packet.pdirty(self.public_packet) + self._ldirty = any(any(list_) for list_ in (strip_comp, bus_comp)) if self._public_packet != private_packet: self._public_packet = private_packet - if private_packet.pdirty(self.public_packet): - self.subject.notify("pdirty") - if any(any(list_) for list_ in (strip_comp, bus_comp)): - self.subject.notify( - "ldirty", - ( - self.public_packet.inputlevels, - strip_comp, - self.public_packet.outputlevels, - bus_comp, - ), - ) + if self.pdirty: + self.subject.notify("pdirty") + if self.ldirty: + self.subject.notify( + "ldirty", + ( + self.public_packet.inputlevels, + strip_comp, + self.public_packet.outputlevels, + bus_comp, + ), + ) time.sleep(self.ratelimit) @property