Skip to content

Commit

Permalink
feat/PHAL_validator (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: jarbasai <jarbasai@mailfence.com>
  • Loading branch information
NeonJarbas and JarbasAl authored Mar 14, 2022
1 parent 08a64fd commit 97fc42c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ovos_plugin_manager/templates/phal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
from ovos_utils.messagebus import get_mycroft_bus


class PHALValidator:
@staticmethod
def validate(config=None):
""" this method is called before loading the plugin.
If it returns False the plugin is not loaded.
This allows a plugin to run platform checks"""
return config.get("enabled", True)


class PHALPlugin:
"""
This base class is intended to be used to interface with the hardware
that is running Mycroft. It exposes all possible commands which
are expected be sent to a PHAL plugin.
All of the handlers are optional and for convenience only
"""
validator = PHALValidator

def __init__(self, bus=None, name=""):
self._mouth_events = False
Expand Down

0 comments on commit 97fc42c

Please sign in to comment.