fix pep8
parent
582b77891e
commit
b38af90fac
|
@ -225,10 +225,10 @@ def has_been_paired():
|
|||
Returns:
|
||||
bool: True if ever paired with backend (not factory reset)
|
||||
"""
|
||||
id = IdentityManager.get()
|
||||
return id.uuid is not None and id.uuid != ""
|
||||
|
||||
|
||||
id = IdentityManager.get()
|
||||
return id.uuid is not None and id.uuid != ""
|
||||
|
||||
|
||||
def is_paired():
|
||||
""" Determine if this device is actively paired with a web backend
|
||||
|
||||
|
|
|
@ -357,22 +357,26 @@ class Enclosure(object):
|
|||
if has_been_paired():
|
||||
# TODO: Enclosure/localization
|
||||
self.ws.emit(Message("speak", {
|
||||
'utterance': "This unit is not connected to the Internet. Either "
|
||||
"plug in a network cable or hold the button on top for "
|
||||
"two seconds, then select wifi from the menu"}))
|
||||
'utterance': "This unit is not connected to the Internet."
|
||||
" Either plug in a network cable or hold the "
|
||||
"button on top for two seconds, then select "
|
||||
"wifi from the menu"
|
||||
}))
|
||||
else:
|
||||
# Begin the unit startup process, this is the first time it
|
||||
# is being run with factory defaults.
|
||||
|
||||
|
||||
# TODO: This logic should be in Enclosure_Mark1
|
||||
# TODO: Enclosure/localization
|
||||
|
||||
|
||||
# Don't listen to mic during this out-of-box experience
|
||||
self.ws.emit(Message("mycroft.mic.mute", None))
|
||||
|
||||
|
||||
# Kick off wifi-setup automatically
|
||||
self.ws.emit(Message("mycroft.wifi.start", {'msg': "Hello I am "
|
||||
"Mycroft, your new assistant. To assist you I need to be "
|
||||
"connected to the internet. You can either plug me in "
|
||||
"with a network cable, or use wifi. To setup wifi ",
|
||||
'allow_timeout': False}))
|
||||
self.ws.emit(Message("mycroft.wifi.start",
|
||||
{'msg': "Hello I am Mycroft, your new "
|
||||
"assistant. To assist you I need to be "
|
||||
"connected to the internet. You can "
|
||||
"either plug me in with a network cable,"
|
||||
" or use wifi. To setup wifi ",
|
||||
'allow_timeout': False}))
|
||||
|
|
|
@ -294,17 +294,17 @@ class WiFi:
|
|||
'''
|
||||
if self.starting:
|
||||
return
|
||||
|
||||
|
||||
self.starting = True
|
||||
LOG.info("Starting access point...")
|
||||
|
||||
|
||||
self.intro_msg = ""
|
||||
if event and event.data.get("msg"):
|
||||
self.intro_msg = event.data.get("msg")
|
||||
self.allow_timeout = True
|
||||
if event and event.data.get("allow_timeout"):
|
||||
self.allow_timeout = event.data.get("allow_timeout")
|
||||
|
||||
|
||||
# Fire up our access point
|
||||
self.ap.up()
|
||||
if not self.server:
|
||||
|
@ -543,7 +543,7 @@ class WiFi:
|
|||
self.server.server.server_close()
|
||||
self.server.join()
|
||||
self.server = None
|
||||
LOG.info("Access point stopped!")
|
||||
LOG.info("Access point stopped!")
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
|
|
|
@ -384,6 +384,6 @@ def stop_speaking():
|
|||
kill([config.get('tts').get('module')])
|
||||
kill(["aplay"])
|
||||
time.sleep(0.25)
|
||||
|
||||
|
||||
# This consumes the signal
|
||||
check_for_signal('stoppingTTS')
|
||||
|
|
Loading…
Reference in New Issue