From a345b12244487847261d9192476698835825491e Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 13 Apr 2024 21:00:30 +0200 Subject: [PATCH] [assistant.picovoice] Leverage upstream `_on_mute_changed`. The plugin should leverage `AssistantPlugin._on_mute_changed` to handle the boilerplate state managent on mute/unmute actions instead of re-implementing the same logic. --- platypush/plugins/assistant/picovoice/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/platypush/plugins/assistant/picovoice/__init__.py b/platypush/plugins/assistant/picovoice/__init__.py index 7baf0e6c4..c90ac315d 100644 --- a/platypush/plugins/assistant/picovoice/__init__.py +++ b/platypush/plugins/assistant/picovoice/__init__.py @@ -2,7 +2,6 @@ import os from typing import Optional, Sequence from platypush.context import get_plugin -from platypush.message.event.assistant import MicMutedEvent, MicUnmutedEvent from platypush.plugins import RunnablePlugin, action from platypush.plugins.assistant import AssistantPlugin from platypush.plugins.tts.picovoice import TtsPicovoicePlugin @@ -239,11 +238,10 @@ class AssistantPicovoicePlugin(AssistantPlugin, RunnablePlugin): :param muted: Set to True or False. """ - self._is_muted = muted if self._assistant: self._assistant.set_mic_mute(muted) - self._send_event(MicMutedEvent if muted else MicUnmutedEvent) + super()._on_mute_changed(muted) @action def toggle_mute(self, *_, **__):