From f15736e8098781dd3ded16c67cbdbf407462346e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 6 Apr 2023 14:00:53 +1000 Subject: [PATCH] scanner: add a validator for Interface.mode Not really needed since we currently have an assert in create but this makes the code more obvious. --- proto/ei-scanner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/ei-scanner b/proto/ei-scanner index b68c12c..ab067f8 100755 --- a/proto/ei-scanner +++ b/proto/ei-scanner @@ -305,7 +305,7 @@ class Interface: events: List[Event] = attr.ib(init=False, factory=list) enums: List[Enum] = attr.ib(init=False, factory=list) - mode: str = attr.ib() # "ei" or "eis" + mode: str = attr.ib(validator=attr.validators.in_(["ei", "eis", "brei"])) description: Optional[Description] = attr.ib(default=None) @property