From 81f1af10abc34bcfb2aab7e037fc53a66bea4690 Mon Sep 17 00:00:00 2001 From: builderjer Date: Sat, 16 Mar 2024 16:23:48 -0600 Subject: [PATCH] updated validator requires https://github.com/OpenVoiceOS/ovos-i2csound/pull/9 --- ovos_PHAL_plugin_respeaker_2mic/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ovos_PHAL_plugin_respeaker_2mic/__init__.py b/ovos_PHAL_plugin_respeaker_2mic/__init__.py index 25ee680..cd102fd 100644 --- a/ovos_PHAL_plugin_respeaker_2mic/__init__.py +++ b/ovos_PHAL_plugin_respeaker_2mic/__init__.py @@ -1,5 +1,4 @@ from ovos_bus_client.message import Message -from ovos_PHAL.detection import is_respeaker_2mic from ovos_plugin_manager.phal import PHALPlugin from ovos_PHAL_plugin_respeaker_2mic.drivers import get_led, get_button @@ -7,11 +6,18 @@ class Respeaker2MicValidator: @staticmethod def validate(config=None): - # TODO does it work for 2 and 6 mic ? - return is_respeaker_2mic() + if exists('/home/ovos/.config/mycroft/i2c_platform'): + with open('/home/ovos/.config/mycroft/i2c_platform', 'r') as f: + platform = f.readline() + LOG.debug(f"2mic platform {platform}") + if platform == 'wm8960': + return True + return False class Respeaker2MicControlPlugin(PHALPlugin): + validator = Respeaker2MicValidator + def __init__(self, bus=None, config=None): super().__init__(bus=bus, name="ovos-PHAL-plugin-respeaker-2mic", config=config) self.button = get_button()