only check channel availability if using the dispatcher, i.e., if there is no host configured
This commit is contained in:
@ -73,6 +73,7 @@ class BSCache:
|
||||
new_chans = {}
|
||||
for name, kwargs in names.items():
|
||||
if name not in FIXED_CHANNELS and name not in self.channels:
|
||||
if self.uses_dispatcher:
|
||||
check_availability(name)
|
||||
cfg = make_channel_config(name, *kwargs)
|
||||
new_chans[name] = cfg
|
||||
@ -86,6 +87,7 @@ class BSCache:
|
||||
|
||||
def get_var(self, name, modulo=None, offset=None):
|
||||
if name not in FIXED_CHANNELS and name not in self.channels:
|
||||
if self.uses_dispatcher:
|
||||
check_availability(name)
|
||||
cfg = make_channel_config(name, modulo, offset)
|
||||
print("add new channel", name)
|
||||
@ -122,6 +124,10 @@ class BSCache:
|
||||
def flush(self):
|
||||
self.pt.queue.clear()
|
||||
|
||||
@property
|
||||
def uses_dispatcher(self):
|
||||
return bool(self.kwargs["host"])
|
||||
|
||||
|
||||
|
||||
def check_availability(name):
|
||||
|
Reference in New Issue
Block a user