skill settings sync flag
parent
8a1b989935
commit
4c84f66e15
|
@ -126,7 +126,8 @@
|
||||||
"url": "https://api.mycroft.ai",
|
"url": "https://api.mycroft.ai",
|
||||||
"version": "v1",
|
"version": "v1",
|
||||||
"update": true,
|
"update": true,
|
||||||
"metrics": false
|
"metrics": false,
|
||||||
|
"sync_skill_settings": true
|
||||||
},
|
},
|
||||||
|
|
||||||
// The mycroft-core messagebus websocket
|
// The mycroft-core messagebus websocket
|
||||||
|
|
|
@ -137,6 +137,12 @@ class SettingsMetaUploader:
|
||||||
self.settings_meta = {}
|
self.settings_meta = {}
|
||||||
self.api = None
|
self.api = None
|
||||||
self.upload_timer = None
|
self.upload_timer = None
|
||||||
|
self.sync_enabled = self.config["server"].get("sync_skill_settings",
|
||||||
|
False)
|
||||||
|
if not self.sync_enabled:
|
||||||
|
LOG.info("Skill settings sync is disabled, settingsmeta will "
|
||||||
|
"not be uploaded")
|
||||||
|
|
||||||
self._stopped = None
|
self._stopped = None
|
||||||
|
|
||||||
# Property placeholders
|
# Property placeholders
|
||||||
|
@ -216,6 +222,8 @@ class SettingsMetaUploader:
|
||||||
The settingsmeta file does not change often, if at all. Only perform
|
The settingsmeta file does not change often, if at all. Only perform
|
||||||
the upload if a change in the file is detected.
|
the upload if a change in the file is detected.
|
||||||
"""
|
"""
|
||||||
|
if not self.sync_enabled:
|
||||||
|
return
|
||||||
synced = False
|
synced = False
|
||||||
if is_paired():
|
if is_paired():
|
||||||
self.api = DeviceApi()
|
self.api = DeviceApi()
|
||||||
|
@ -315,6 +323,11 @@ class SkillSettingsDownloader:
|
||||||
self.remote_settings = None
|
self.remote_settings = None
|
||||||
self.api = DeviceApi()
|
self.api = DeviceApi()
|
||||||
self.download_timer = None
|
self.download_timer = None
|
||||||
|
self.sync_enabled = Configuration.get()["server"]\
|
||||||
|
.get("sync_skill_settings", False)
|
||||||
|
if not self.sync_enabled:
|
||||||
|
LOG.info("Skill settings sync is disabled, backend settings will "
|
||||||
|
"not be downloaded")
|
||||||
|
|
||||||
def stop_downloading(self):
|
def stop_downloading(self):
|
||||||
"""Stop synchronizing backend and core."""
|
"""Stop synchronizing backend and core."""
|
||||||
|
@ -328,6 +341,8 @@ class SkillSettingsDownloader:
|
||||||
|
|
||||||
When used as a messagebus handler a message is passed but not used.
|
When used as a messagebus handler a message is passed but not used.
|
||||||
"""
|
"""
|
||||||
|
if not self.sync_enabled:
|
||||||
|
return
|
||||||
if is_paired():
|
if is_paired():
|
||||||
remote_settings = self._get_remote_settings()
|
remote_settings = self._get_remote_settings()
|
||||||
if remote_settings:
|
if remote_settings:
|
||||||
|
|
Loading…
Reference in New Issue