diff --git a/hivemind_core/service.py b/hivemind_core/service.py index 623a4ad..c028e83 100644 --- a/hivemind_core/service.py +++ b/hivemind_core/service.py @@ -25,6 +25,7 @@ from hivemind_core.database import ClientDatabase from hivemind_core.protocol import HiveMindListenerProtocol, HiveMindClientConnection, HiveMindNodeType from hivemind_presence import LocalPresence +from hivemind_ggwave import GGWaveMaster from ovos_bus_client import MessageBusClient @@ -191,6 +192,13 @@ def __init__(self, upnp=websocket_config.get('upnp', False), port=self.port, zeroconf=websocket_config.get('zeroconf', False)) + try: + # TODO - silent_mode should be controlled via external events + # to start enrolling new devices on demand + self.ggwave = GGWaveMaster(bus=self.bus, silent_mode=True) + except Exception as e: + LOG.error(f"ggwave failed to start: {e}") + self.ggwave = None def run(self): self.status.set_alive() @@ -222,6 +230,9 @@ def run(self): application.listen(self.port, self.host) self.presence.start() + if self.ggwave is not None: + self.ggwave.start() + LOG.info("listening for ggwave audio handshakes") self.status.set_ready() @@ -229,3 +240,5 @@ def run(self): self.status.set_stopping() self.presence.stop() + if self.ggwave is not None: + self.ggwave.stop() diff --git a/requirements.txt b/requirements.txt index aa1d191..fb116e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,3 +8,4 @@ click click_default_group rich pyOpenSSL +hivemind-ggwave \ No newline at end of file diff --git a/setup.py b/setup.py index e5bd41e..e8deba5 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def get_version(): '# END_VERSION_BLOCK' in line): break version = f"{major}.{minor}.{build}" - if alpha: + if int(alpha) > 0: version += f"a{alpha}" return version