From 9813cf41694f234dde442deb1fe058bf90cabfd0 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 11 Jan 2022 16:20:26 -0500 Subject: [PATCH] Add a symbol "front feed" helper --- piker/data/_source.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/piker/data/_source.py b/piker/data/_source.py index 8ec92dfd..9b9b323d 100644 --- a/piker/data/_source.py +++ b/piker/data/_source.py @@ -106,6 +106,18 @@ class Symbol(BaseModel): mult = 1 / self.tick_size return round(value * mult) / mult + def front_feed(self) -> tuple[str, str]: + ''' + Return the "current" feed key for this symbol. + + (i.e. the broker + symbol key in a tuple). + + ''' + return ( + list(self.broker_info.keys())[0], + self.key, + ) + @validate_arguments def mk_symbol(