config: Warn on subscribing to unknown variable

This commit is contained in:
Peter Eisenmann
2024-06-25 08:04:05 +02:00
parent ce8d254827
commit e461d33cf1

View File

@@ -160,7 +160,10 @@ class Config:
self.subscriptions[variable].append(func)
else:
self.subscriptions[variable] = [func]
func(self.variables[variable])
if variable in self.variables:
func(self.variables[variable])
elif not self.variables['test_mode']:
print(f'subscribing to unknown variable {variable}')
def unsubscribe(self, obj):
with self.subscription_lock: