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.
This commit is contained in:
Peter Hutterer 2023-04-06 14:00:53 +10:00
parent 3546a443a9
commit f15736e809

View file

@ -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