Skip to content

Commit

Permalink
Update plugin load to respect explicitly disabled plugins (#93)
Browse files Browse the repository at this point in the history
* Update to allow newer ovos-phal

* Remove `load_plugins` override method to use OVOS implementation

* Update ovos-PHAL dependency to include config handling update

---------

Co-authored-by: Daniel McKnight <daniel@neon.ai>
  • Loading branch information
NeonDaniel and Daniel McKnight committed Jun 28, 2024
1 parent b639c83 commit 63d6573
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
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

0 comments on commit 63d6573

Please sign in to comment.