Ejemplo n.º 1
0
 def enable_selene(self):
     config = {
         "stt": {"module": "mycroft"},
         "server": {
             "url": "https://api.mycroft.ai",
             "version": "v1"
         },
         "listener": {
             "wake_word_upload": {
                 "url": "https://training.mycroft.ai/precise/upload"
             }
         }
     }
     conf = LocalConf(USER_CONFIG)
     conf.update(config)
     conf.store()
     self.using_mock = False
     self.bus.emit(Message("configuration.patch", {"config": config}))
Ejemplo n.º 2
0
 def enable_mock(self):
     url = "http://0.0.0.0:{p}".format(p=CONFIGURATION["backend_port"])
     version = CONFIGURATION["api_version"]
     config = {
         "server": {
             "url": url,
             "version": version
         },
         # no web ui to set location, best guess from ip address
         # should get at least timezone right
         "location": ip_geolocate("0.0.0.0"),
         "listener": {
             "wake_word_upload": {
                 "url": "http://0.0.0.0:{p}/precise/upload".format(
                     p=CONFIGURATION["backend_port"])
             }
         }
     }
     conf = LocalConf(USER_CONFIG)
     conf.update(config)
     conf.store()
     self.using_mock = True
     self.bus.emit(Message("configuration.patch", {"config": config}))