diff --git a/python/pyrogue/_DataReceiver.py b/python/pyrogue/_DataReceiver.py index 9bb431c62..936352f39 100644 --- a/python/pyrogue/_DataReceiver.py +++ b/python/pyrogue/_DataReceiver.py @@ -88,7 +88,7 @@ def _acceptFrame(self, frame): """ # Do nothing if not yet started or enabled - if self.running is False or self.RxEnable.value() is False: + if self.running is False or self.RxEnable.value() == False: return # Lock frame diff --git a/python/pyrogue/_Device.py b/python/pyrogue/_Device.py index cc0bde492..3962bb113 100644 --- a/python/pyrogue/_Device.py +++ b/python/pyrogue/_Device.py @@ -31,6 +31,8 @@ def __init__(self, *, enabled, deps=None): groups='Enable', disp={False: 'False', True: 'True', 'parent': 'ParentFalse', 'deps': 'ExtDepFalse'}) + self.allowed_values = {True, False, 'parent', 'deps'} + if deps is None: self._deps = [] self._depDis = False @@ -97,6 +99,10 @@ def set(self, value, write=True, index=-1): ------- """ + if value not in self.allowed_values: + raise pr.VariableError( + f'Error calling {self.path}.set({value=}) - value must be one of {self.allowed_values}') + if value != 'parent' and value != 'deps': old = self.value()