pull/817/head
Åke Forslund 2017-06-13 14:17:21 +02:00
parent 582b77891e
commit b38af90fac
4 changed files with 24 additions and 20 deletions

View File

@ -225,10 +225,10 @@ def has_been_paired():
Returns: Returns:
bool: True if ever paired with backend (not factory reset) bool: True if ever paired with backend (not factory reset)
""" """
id = IdentityManager.get() id = IdentityManager.get()
return id.uuid is not None and id.uuid != "" return id.uuid is not None and id.uuid != ""
def is_paired(): def is_paired():
""" Determine if this device is actively paired with a web backend """ Determine if this device is actively paired with a web backend

View File

@ -357,22 +357,26 @@ class Enclosure(object):
if has_been_paired(): if has_been_paired():
# TODO: Enclosure/localization # TODO: Enclosure/localization
self.ws.emit(Message("speak", { self.ws.emit(Message("speak", {
'utterance': "This unit is not connected to the Internet. Either " 'utterance': "This unit is not connected to the Internet."
"plug in a network cable or hold the button on top for " " Either plug in a network cable or hold the "
"two seconds, then select wifi from the menu"})) "button on top for two seconds, then select "
"wifi from the menu"
}))
else: else:
# Begin the unit startup process, this is the first time it # Begin the unit startup process, this is the first time it
# is being run with factory defaults. # is being run with factory defaults.
# TODO: This logic should be in Enclosure_Mark1 # TODO: This logic should be in Enclosure_Mark1
# TODO: Enclosure/localization # TODO: Enclosure/localization
# Don't listen to mic during this out-of-box experience # 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", None))
# Kick off wifi-setup automatically # Kick off wifi-setup automatically
self.ws.emit(Message("mycroft.wifi.start", {'msg': "Hello I am " self.ws.emit(Message("mycroft.wifi.start",
"Mycroft, your new assistant. To assist you I need to be " {'msg': "Hello I am Mycroft, your new "
"connected to the internet. You can either plug me in " "assistant. To assist you I need to be "
"with a network cable, or use wifi. To setup wifi ", "connected to the internet. You can "
'allow_timeout': False})) "either plug me in with a network cable,"
" or use wifi. To setup wifi ",
'allow_timeout': False}))

View File

@ -294,17 +294,17 @@ class WiFi:
''' '''
if self.starting: if self.starting:
return return
self.starting = True self.starting = True
LOG.info("Starting access point...") LOG.info("Starting access point...")
self.intro_msg = "" self.intro_msg = ""
if event and event.data.get("msg"): if event and event.data.get("msg"):
self.intro_msg = event.data.get("msg") self.intro_msg = event.data.get("msg")
self.allow_timeout = True self.allow_timeout = True
if event and event.data.get("allow_timeout"): if event and event.data.get("allow_timeout"):
self.allow_timeout = event.data.get("allow_timeout") self.allow_timeout = event.data.get("allow_timeout")
# Fire up our access point # Fire up our access point
self.ap.up() self.ap.up()
if not self.server: if not self.server:
@ -543,7 +543,7 @@ class WiFi:
self.server.server.server_close() self.server.server.server_close()
self.server.join() self.server.join()
self.server = None self.server = None
LOG.info("Access point stopped!") LOG.info("Access point stopped!")
def run(self): def run(self):
try: try:

View File

@ -384,6 +384,6 @@ def stop_speaking():
kill([config.get('tts').get('module')]) kill([config.get('tts').get('module')])
kill(["aplay"]) kill(["aplay"])
time.sleep(0.25) time.sleep(0.25)
# This consumes the signal # This consumes the signal
check_for_signal('stoppingTTS') check_for_signal('stoppingTTS')