scanner: don't allow incoming/outgoing for modes other than ei/eis

We support mode "brei" now but that doesn't have a definition of incoming or
outgoing.
This commit is contained in:
Peter Hutterer 2023-02-22 09:02:45 +10:00
parent 0e70d06706
commit 381bc9222a

View file

@ -292,8 +292,12 @@ class Interface:
"""
if self.mode == "ei":
return self.requests # type: ignore
else:
elif self.mode == "eis":
return self.events # type: ignore
else:
raise NotImplementedError(
f"Interface.outgoing is not supported for mode {self.mode}"
)
@property
def incoming(self) -> list[Message]:
@ -306,8 +310,12 @@ class Interface:
"""
if self.mode == "ei":
return self.events # type: ignore
else:
elif self.mode == "eis":
return self.requests # type: ignore
else:
raise NotImplementedError(
f"Interface.incoming is not supported for mode {self.mode}"
)
@property
def ctype(self) -> str: