Enclosure mutes the mic and should unmute it
====  Tech Notes ====
Listens for 'mycroft.paired' and will unmute the mic when this occurs.
This was handled by the pairing skill but for clarity it should be
unmuted at the same place.
@@ -362,6 +362,13 @@ class Enclosure(object):
self.serial.close()
self.ws.close()
+ def _handle_pairing_complete(self, Message):
+ """
+ Handler for 'mycroft.paired', unmutes the mic after the pairing is
+ complete.
+ """
+ self.ws.emit(Message("mycroft.mic.unmute"))
+
def _do_net_check(self):
# TODO: This should live in the derived Enclosure, e.g. Enclosure_Mark1
LOG.info("Checking internet connection")
@@ -382,7 +389,10 @@ class Enclosure(object):
# TODO: Enclosure/localization
# Don't listen to mic during this out-of-box experience
- self.ws.emit(Message("mycroft.mic.mute", None))
+ self.ws.emit(Message("mycroft.mic.mute"))
+ # Setup handler to unmute mic at the end of on boarding
+ # i.e. after pairing is complete
+ self.ws.once('mycroft.paired', self._handle_pairing_complete)
# Kick off wifi-setup automatically
self.ws.emit(Message("mycroft.wifi.start",
