Add voice_icon plugin
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| from .fuel_check import FuelCheck | ||||
| from .air_bags import AirBags | ||||
| plugins = [FuelCheck, AirBags] | ||||
| from .voice_icon import VoiceIcon | ||||
| plugins = [FuelCheck, AirBags, VoiceIcon] | ||||
|   | ||||
							
								
								
									
										27
									
								
								plugins/voice_icon.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								plugins/voice_icon.py
									
									
									
									
									
										Normal file
									
								
							| @@ -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]}) | ||||
		Reference in New Issue
	
	Block a user