This commit is contained in:
Michael Hansen
2024-01-16 17:06:30 -06:00
parent 33e6d80786
commit ebc686d9ad
6 changed files with 27 additions and 1 deletions
+1
View File
@@ -119,6 +119,7 @@ class LEDsEventHandler(AsyncEventHandler):
self.color(_GREEN) self.color(_GREEN)
await asyncio.sleep(0.3) await asyncio.sleep(0.3)
self.color(_BLACK) self.color(_BLACK)
await asyncio.sleep(0.3)
elif SatelliteDisconnected.is_type(event.type): elif SatelliteDisconnected.is_type(event.type):
self.color(_RED) self.color(_RED)
+1
View File
@@ -119,6 +119,7 @@ class LEDsEventHandler(AsyncEventHandler):
self.color(_GREEN) self.color(_GREEN)
await asyncio.sleep(0.3) await asyncio.sleep(0.3)
self.color(_BLACK) self.color(_BLACK)
await asyncio.sleep(0.3)
elif SatelliteDisconnected.is_type(event.type): elif SatelliteDisconnected.is_type(event.type):
self.color(_RED) self.color(_RED)
+11
View File
@@ -119,6 +119,17 @@ def apply_settings(settings: Settings) -> None:
error("installing audio enhancements") error("installing audio enhancements")
return 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) generate_services(settings)
password = passwordbox("sudo password:") password = passwordbox("sudo password:")
+9 -1
View File
@@ -84,17 +84,25 @@ def configure_feedback(settings: Settings) -> None:
while True: while True:
choice = menu("Main > Satellite > Feedback", [("respeaker", "ReSpeaker")]) choice = menu("Main > Satellite > Feedback", [("respeaker", "ReSpeaker")])
if choice == "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 = radiolist(
"Event Service:", "Event Service:",
[ [
("2mic", "2mic LEDs"), ("2mic", "2mic LEDs"),
("4mic", "4mic LEDs"), ("4mic", "4mic LEDs"),
], ],
selected_service,
) )
if event_service is not None: if event_service is not None:
settings.satellite.event_service_command = [ settings.satellite.event_service_command = [
str(PROGRAM_DIR / "script" / "run_{event_service}"), str(PROGRAM_DIR / "script" / f"run_{event_service}"),
"--uri", "--uri",
"tcp://127.0.0.1:10500", "tcp://127.0.0.1:10500",
] ]
+3
View File
@@ -222,6 +222,9 @@ def install_services(settings: Settings, password: str):
assert settings.wake.system is not None, "No wake word system" assert settings.wake.system is not None, "No wake word system"
installed_services.append(WakeWordSystem(settings.wake.system).value.lower()) installed_services.append(WakeWordSystem(settings.wake.system).value.lower())
if settings.satellite.event_service_command:
installed_services.append("event")
install_commands = [] install_commands = []
for service in installed_services: for service in installed_services:
service_filename = f"wyoming-{service}.service" service_filename = f"wyoming-{service}.service"
+2
View File
@@ -0,0 +1,2 @@
gpiozero
spidev