Skip to content

Commit

Permalink
Optionally filter by host.
Browse files Browse the repository at this point in the history
  • Loading branch information
cboulay committed Oct 1, 2024
1 parent 1509a5d commit 0b65e4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ezmsg/lsl/inlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class LSLInfo:
name: str = ""
type: str = ""
host: str = "" # Use socket.gethostname() for local host.
channel_count: typing.Optional[int] = None
nominal_srate: float = 0.0
channel_format: typing.Optional[str] = None
Expand Down Expand Up @@ -185,6 +186,10 @@ def _reset_inlet(self) -> None:
(not self.SETTINGS.info.type)
or strm_info.type() == self.SETTINGS.info.type
)
b_match = b_match and (
(not self.SETTINGS.info.host)
or strm_info.hostname() == self.SETTINGS.info.host
)
if b_match:
self.STATE.inlet = pylsl.StreamInlet(
strm_info,
Expand Down

0 comments on commit 0b65e4e

Please sign in to comment.