modified: mycroft/client/enclosure/__init__.py

modified:   mycroft/client/wifisetup/main.py
pull/748/head
kfezer@gmail.com 2017-05-02 13:15:53 -07:00 committed by Art McGee
parent 19529472d7
commit 227d9c6772
2 changed files with 11 additions and 13 deletions

View File

@ -131,17 +131,17 @@ class EnclosureReader(Thread):
self.ws.emit(Message("mycroft.wifi.start"))
if "unit.factory-reset" in data:
#self.ws.emit(
#Message("enclosure.eyes.spin"))
#subprocess.call(
#'rm ~/.mycroft/identity/identity2.json',
#shell=True)
self.ws.emit(
Message("enclosure.eyes.spin"))
subprocess.call(
'rm ~/.mycroft/identity/identity2.json',
shell=True)
self.ws.emit(Message("mycroft.wifi.reset"))
#time.sleep(4)
#self.ws.emit(Message("enclosure.mouth.reset"))
#self.ws.emit(Message("speak", {
#'utterance': "This unit has been reset"}))
#subprocess.call('systemctl reboot -i', shell=True)
self.ws.emit(Message("speak", {
'utterance': "This unit has been reset"}))
time.sleep(4)
self.ws.emit(Message("enclosure.mouth.reset"))
subprocess.call('systemctl reboot -i', shell=True)
if "unit.enable-ssh" in data:
subprocess.call('sudo touch /boot/ssh', shell=True)

View File

@ -549,11 +549,9 @@ class WiFi:
LOG.error("Error: {0}".format(e))
self.stop()
def reset(self, message):
def reset(self, event=None):
"""Resets the wifi to the default """
LOG.info("Resetting the WPA_SUPPLICANT File")
self.ws.emit(Message("speak", {
'utterance': "Erasing Wireless Networks"}))
try:
subprocess.call(
"echo " + WPA_SUPPLICANT +