forked from platypush/platypush
[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.
This commit is contained in:
parent
2c197c275e
commit
a345b12244
1 changed files with 1 additions and 3 deletions
|
@ -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, *_, **__):
|
||||
|
|
Loading…
Reference in a new issue