Skip to content

Commit 491edfd

Browse files
committed
Correct plugin data is passed to callback.
1 parent 0fa6482 commit 491edfd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

myDevices/plugins/manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def load_plugin_from_file(self, filename):
8080
pass
8181
try:
8282
self.override_plugin_value(config, section, 'register_callback', plugin)
83-
getattr(plugin['instance'], plugin['register_callback'])(lambda x: self.data_changed(x, plugin))
83+
getattr(plugin['instance'], plugin['register_callback'])(lambda value, plugin=plugin: self.data_changed(value, plugin))
8484
except:
8585
pass
8686
try:
@@ -102,6 +102,7 @@ def load_plugins(self):
102102
self.load_plugin_from_file(os.path.join(root, filename))
103103
#Remove any disabled plugins that were only loaded because they are inherited from.
104104
self.plugins = {key:value for key, value in self.plugins.items() if value['enabled']}
105+
info('Enabled plugins: {}'.format(self.plugins.keys()))
105106

106107
def get_plugin(self, filename, section):
107108
"""Return the plugin for the corresponding filename and section."""

0 commit comments

Comments
 (0)