Skip to content

Commit

Permalink
feat/ggwave
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 15, 2023
1 parent db8a6d9 commit 51b5de7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions hivemind_core/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -222,10 +230,15 @@ 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()

loop.start()

self.status.set_stopping()
self.presence.stop()
if self.ggwave is not None:
self.ggwave.stop()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ click
click_default_group
rich
pyOpenSSL
hivemind-ggwave
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 51b5de7

Please sign in to comment.