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

Update plugin load to respect explicitly disabled plugins #93

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions neon_enclosure/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,6 @@ def start(self):
LOG.info(f"Started PHAL")
self.started.set()

def load_plugins(self):
for name, plug in find_phal_plugins().items():
LOG.info(f"Loading {name}")
config = self.user_config.get(name) or {}
try:
if hasattr(plug, "validator"):
enabled = plug.validator.validate(config)
else:
enabled = config.get("enabled")
except Exception as e:
LOG.exception(e)
enabled = False
if enabled:
try:
self.drivers[name] = plug(bus=self.bus, config=config)
LOG.info(f"PHAL plugin loaded: {name}")
except Exception:
LOG.exception(f"failed to load PHAL plugin: {name}")
continue

def shutdown(self):
LOG.info("Shutting Down")
try:
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ovos-phal==0.0.5a15
ovos-phal~=0.0.4,>=0.0.5a17
neon-utils[network]~=1.9
ovos_utils~=0.0,>=0.0.32
click~=8.0
Expand Down
Loading