Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plugin loader to correctly activate plugins #92

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

fernandodpr
Copy link
Contributor

It fixes a bug on my previous pr.

The bug was caused by the plugin loader not correctly using the plugin_name attribute to identify plugins when matching them with their configurations in config.yaml. Instead, it was using the class name or other identifiers that didn't align with the names specified in the configuration file. This mismatch meant that plugins, especially community plugins, were not being recognized and thus not activated as intended.

Changing the plugin loader to utilize the plugin_name attribute defined within each plugin fixed the problem.

And a typo, thank you @jeremiah-k .

fernandodpr and others added 2 commits November 7, 2024 23:34
- Ensure core plugins default to active unless specified otherwise
- Use 'plugin_name' to identify and activate plugins from configuration
@fernandodpr
Copy link
Contributor Author

Logs to make review easier. Here we can see how It loads nodediscovery and helloworld correctly.

python main.py
HEAD is now at 84f63d1 Hello_world plugin to test the new plugin loader
From https://github.com/fernandodpr/MMR-NodeDiscovery-Plugin
 * tag               DEV        -> FETCH_HEAD
Already up to date.
2024-11-07 23:26:27 +0100 INFO:Plugins:Updated repository MMR-NodeDiscovery-Plugin to DEV
HEAD is now at 84f63d1 Hello_world plugin to test the new plugin loader
From https://github.com/fernandodpr/MMR-NodeDiscovery-Plugin
 * tag               DEV        -> FETCH_HEAD
Already up to date.
2024-11-07 23:26:28 +0100 INFO:Plugins:Updated repository MMR-NodeDiscovery-Plugin to DEV
2024-11-07 23:26:28 +0100 DEBUG:Plugin:health:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:map:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:mesh_relay:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:ping:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:telemetry:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:weather:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:help:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:nodes:Started with priority=10
2024-11-07 23:26:28 +0100 INFO:Plugins:Plugin 'drop' is inactive or not configured, skipping
2024-11-07 23:26:28 +0100 DEBUG:Plugin:debug:Started with priority=1
2024-11-07 23:26:28 +0100 DEBUG:Plugin:helloworld:Started with priority=10
2024-11-07 23:26:28 +0100 DEBUG:Plugin:nodediscovery:Started with priority=10
2024-11-07 23:26:28 +0100 INFO:Meshtastic:Connecting to host 192.168...

@jeremiah-k jeremiah-k merged commit e8b65a6 into geoffwhittington:main Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants