Add voice_icon plugin
This commit is contained in:
parent
f1b2e7a3e4
commit
48824323aa
|
@ -1,3 +1,4 @@
|
||||||
from .fuel_check import FuelCheck
|
from .fuel_check import FuelCheck
|
||||||
from .air_bags import AirBags
|
from .air_bags import AirBags
|
||||||
plugins = [FuelCheck, AirBags]
|
from .voice_icon import VoiceIcon
|
||||||
|
plugins = [FuelCheck, AirBags, VoiceIcon]
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
"Voice Icon"
|
||||||
|
import time
|
||||||
|
|
||||||
|
from daemon import DaemonPlugin
|
||||||
|
|
||||||
|
class VoiceIcon(DaemonPlugin):
|
||||||
|
"Forwards Messages from message bus to OSD Frontend"
|
||||||
|
|
||||||
|
def initialize(self):
|
||||||
|
"Initialize plugin"
|
||||||
|
self.messagebus_client.on("recognizer_loop:wakeword", self.on_wakeword)
|
||||||
|
self.messagebus_client.on("recognizer_loop:record_end",
|
||||||
|
self.on_record_end)
|
||||||
|
self.messagebus_client.on("recognizer_loop:utterance",
|
||||||
|
self.on_utterance)
|
||||||
|
|
||||||
|
def check(self, data):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_wakeword(self, message):
|
||||||
|
self.emit("voice:wakeword", {})
|
||||||
|
|
||||||
|
def on_record_end(self, message):
|
||||||
|
self.emit("voice:record_end", {})
|
||||||
|
|
||||||
|
def on_utterance(self, message):
|
||||||
|
self.emit("voice:utterance", {"text": message.data["utterances"][0]})
|
Loading…
Reference in New Issue