Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam committed Jan 16, 2024
1 parent 33e6d80 commit ebc686d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/2mic_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ async def handle_event(self, event: Event) -> bool:
self.color(_GREEN)
await asyncio.sleep(0.3)
self.color(_BLACK)
await asyncio.sleep(0.3)
elif SatelliteDisconnected.is_type(event.type):
self.color(_RED)

Expand Down
1 change: 1 addition & 0 deletions examples/4mic_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ async def handle_event(self, event: Event) -> bool:
self.color(_GREEN)
await asyncio.sleep(0.3)
self.color(_BLACK)
await asyncio.sleep(0.3)
elif SatelliteDisconnected.is_type(event.type):
self.color(_RED)

Expand Down
11 changes: 11 additions & 0 deletions installer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ def apply_settings(settings: Settings) -> None:
error("installing audio enhancements")
return

if settings.satellite.event_service_command and (("2mic" in settings.satellite.event_service_command) or ("4mic" in settings.satellite.event_service_command)):
result = run_with_gauge(
"Installing event requirements...",
[
pip_install("-r", str(PROGRAM_DIR / "requirements_respeaker.txt"))
],
)
if not result:
error("installing event requirements")
return

generate_services(settings)

password = passwordbox("sudo password:")
Expand Down
10 changes: 9 additions & 1 deletion installer/satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,25 @@ def configure_feedback(settings: Settings) -> None:
while True:
choice = menu("Main > Satellite > Feedback", [("respeaker", "ReSpeaker")])
if choice == "respeaker":
selected_service: Optional[str] = None
if settings.satellite.event_service_command:
if "2mic" in settings.satellite.event_service_command[0]:
selected_service = "2mic"
elif "4mic" in settings.satellite.event_service_command[0]:
selected_service = "4mic"

event_service = radiolist(
"Event Service:",
[
("2mic", "2mic LEDs"),
("4mic", "4mic LEDs"),
],
selected_service,
)

if event_service is not None:
settings.satellite.event_service_command = [
str(PROGRAM_DIR / "script" / "run_{event_service}"),
str(PROGRAM_DIR / "script" / f"run_{event_service}"),
"--uri",
"tcp://127.0.0.1:10500",
]
Expand Down
3 changes: 3 additions & 0 deletions installer/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ def install_services(settings: Settings, password: str):
assert settings.wake.system is not None, "No wake word system"
installed_services.append(WakeWordSystem(settings.wake.system).value.lower())

if settings.satellite.event_service_command:
installed_services.append("event")

install_commands = []
for service in installed_services:
service_filename = f"wyoming-{service}.service"
Expand Down
2 changes: 2 additions & 0 deletions requirements_respeaker.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gpiozero
spidev

0 comments on commit ebc686d

Please sign in to comment.