Skip to content

Commit

Permalink
Merge pull request #53 from OpenVoiceOS/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Jun 1, 2023
2 parents 5f3f3b3 + 89d5a6c commit e985034
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 75 deletions.
53 changes: 11 additions & 42 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,32 @@
# Changelog

## [V0.0.9a6](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.9a6) (2023-05-24)
## [V0.0.10a3](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.10a3) (2023-05-31)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.9a5...V0.0.9a6)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.10a2...V0.0.10a3)

**Implemented enhancements:**
**Fixed bugs:**

- Port `init_module_config` from neon\_utils with unit tests [\#42](https://github.com/OpenVoiceOS/ovos-config/pull/42) ([NeonDaniel](https://github.com/NeonDaniel))
- Update config hash to sort keys to ensure hashes compare [\#52](https://github.com/OpenVoiceOS/ovos-config/pull/52) ([NeonDaniel](https://github.com/NeonDaniel))

**Closed issues:**

- Add method to init configuration [\#22](https://github.com/OpenVoiceOS/ovos-config/issues/22)

## [V0.0.9a5](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.9a5) (2023-05-24)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.9a4...V0.0.9a5)

**Implemented enhancements:**
## [V0.0.10a2](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.10a2) (2023-05-31)

- os.env [\#46](https://github.com/OpenVoiceOS/ovos-config/issues/46)
- Support envvar default configuration overrides [\#47](https://github.com/OpenVoiceOS/ovos-config/pull/47) ([NeonDaniel](https://github.com/NeonDaniel))

## [V0.0.9a4](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.9a4) (2023-05-23)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.9a3...V0.0.9a4)

**Merged pull requests:**

- Add configuration update unit tests and update documentation [\#45](https://github.com/OpenVoiceOS/ovos-config/pull/45) ([NeonDaniel](https://github.com/NeonDaniel))

## [V0.0.9a3](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.9a3) (2023-05-19)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.9a2...V0.0.9a3)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.10a1...V0.0.10a2)

**Closed issues:**

- 0.0.9a2 - Page not found [\#41](https://github.com/OpenVoiceOS/ovos-config/issues/41)
- 0.0.9a2 - Page not found [\#40](https://github.com/OpenVoiceOS/ovos-config/issues/40)

**Merged pull requests:**

- Fix setup.py bug [\#44](https://github.com/OpenVoiceOS/ovos-config/pull/44) ([NeonDaniel](https://github.com/NeonDaniel))
- Update build\_tests to use shared action [\#43](https://github.com/OpenVoiceOS/ovos-config/pull/43) ([NeonDaniel](https://github.com/NeonDaniel))

## [V0.0.9a2](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.9a2) (2023-05-07)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.9a1...V0.0.9a2)
- Clean install failed on missing ovos-tts-plugin-mimic [\#49](https://github.com/OpenVoiceOS/ovos-config/issues/49)

**Merged pull requests:**

- fix setup [\#39](https://github.com/OpenVoiceOS/ovos-config/pull/39) ([emphasize](https://github.com/emphasize))
- Skip config file reload when a non-config file is modified [\#51](https://github.com/OpenVoiceOS/ovos-config/pull/51) ([NeonDaniel](https://github.com/NeonDaniel))

## [V0.0.9a1](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.9a1) (2023-05-01)
## [V0.0.10a1](https://github.com/OpenVoiceOS/ovos-config/tree/V0.0.10a1) (2023-05-29)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.8...V0.0.9a1)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-config/compare/V0.0.9...V0.0.10a1)

**Merged pull requests:**

- Bump PyYAML to 6.0 [\#38](https://github.com/OpenVoiceOS/ovos-config/pull/38) ([goldyfruit](https://github.com/goldyfruit))
- refactor/better\_defaults [\#50](https://github.com/OpenVoiceOS/ovos-config/pull/50) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
34 changes: 17 additions & 17 deletions ovos_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def set_config_watcher(callback: Optional[callable] = None):
"""
paths = [Configuration.system.path] + \
[c.path for c in Configuration.xdg_configs]
if callback:
if callback and callback not in Configuration._callbacks:
Configuration._callbacks.append(callback)
if not Configuration._watchdog:
Configuration._watchdog = FileWatcher(
Expand All @@ -292,36 +292,36 @@ def _on_file_change(path: str):
Callback method for FileWatcher
@param path: Configuration file path reporting a change
"""
LOG.info(f'{path} changed on disk, reloading!')
# reload updated config
for cfg in Configuration.xdg_configs + [Configuration.system]:
for cfg in Configuration.xdg_configs + [Configuration.system,
Configuration.remote]:
if cfg.path == path:
old_cfg = hash(cfg)
try:
cfg.reload()
break
reloaded = True
except:
# got the file changed signal before write finished
sleep(0.5)
reloaded = False
try:
cfg.reload()
if not reloaded:
LOG.warning(f"Reload failed, retrying")
cfg.reload()
except:
LOG.exception("Failed to load configuration, "
"syntax seems invalid!")
new_cfg = hash(cfg)
if old_cfg == new_cfg:
LOG.info(f"{path} unchanged")
return
break
else:
LOG.info(f"Reloading all configuration files, got: {path}")
# reload all configs
try:
Configuration.reload()
except:
# got the file changed signal before write finished
sleep(0.5)
try:
Configuration.reload()
except:
LOG.exception("Failed to load configuration, "
"syntax seems invalid!")
LOG.info(f"Ignoring non-config file change: {path}")
return

LOG.info(f'{path} changed on disk')
LOG.debug(f"Calling {len(Configuration._callbacks)} callbacks")
for handler in Configuration._callbacks:
try:
handler()
Expand Down
3 changes: 3 additions & 0 deletions ovos_config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def __init__(self, path):
if path:
self.load_local(path)

def __hash__(self):
return hash(json.dumps(dict(self), sort_keys=True))

def _get_file_format(self, path=None):
"""The config file format
supported file extensions:
Expand Down
90 changes: 76 additions & 14 deletions ovos_config/mycroft.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
// TODO: save unmodified, lowercase upon demand
"lang": "en-us",

// Secondary languages will also have their resource files loaded into memory
// but intents will only be considered if that lang is tagged with the utterance at STT step
"secondary_langs": [],

// Measurement units, either 'metric' or 'imperial'
// Override: REMOTE
"system_unit": "metric",
Expand Down Expand Up @@ -50,16 +54,19 @@
},

// Mechanism used to play WAV audio files
// by default ovos-utils will try to detect best player
// Override: SYSTEM
"play_wav_cmdline": "paplay %1 --stream-name=mycroft-voice",
//"play_wav_cmdline": "paplay %1 --stream-name=mycroft-voice",

// Mechanism used to play MP3 audio files
// by default ovos-utils will try to detect best player
// Override: SYSTEM
"play_mp3_cmdline": "mpg123 %1",
//"play_mp3_cmdline": "mpg123 %1",

// Mechanism used to play OGG audio files
// by default ovos-utils will try to detect best player
// Override: SYSTEM
"play_ogg_cmdline": "ogg123 -q %1",
//"play_ogg_cmdline": "ogg123 -q %1",

// Location where the system resides
// NOTE: Although this is set here, an Enclosure can override the value.
Expand Down Expand Up @@ -140,6 +147,8 @@
"sync2way": true,
// values in skill settings missing in settingsmeta wont show up in selene
// this flag auto generates settingsmeta on the fly
// TODO - settings this to true may run into permission issues until settingsmeta.json gets XDG support
// it writes to skill base folder
"autogen_meta": false,

// blacklisted skills to not load
Expand Down Expand Up @@ -272,11 +281,10 @@
// Needs to be explicitly enabled, also see "protected_keys" under "system" above
// Possible backends
// - https://github.com/OpenVoiceOS/OVOS-local-backend
// - https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/pairing-your-device
"server": {
// Valid types: offline, selene, personal, neon, ovos
// Valid types: offline, personal
"backend_type": "offline",
// url for selene -> https://api.mycroft.ai
// url for self hosted personal backend
"url": "",
"version": "v1",
"update": false,
Expand Down Expand Up @@ -346,7 +354,7 @@
// if enabled the noise level is saved to a ipc file, useful for
// debuging if microphone is working but writes a lot to disk,
// recommended that you set "ipc_path" to a tmpfs
"mic_meter_ipc": true,
"mic_meter_ipc": false,

// Set 'save_path' to configure the location of files stored if
// 'record_wake_words' and/or 'save_utterances' are set to 'true'.
Expand All @@ -368,6 +376,13 @@
"url": ""
},

// Microphone plugin to be read audio
// NOTE: only in ovos-dinkum-listener
"microphone": {
// use "ovos-microphone-plugin-sounddevice" for MacOS support
"module": "ovos-microphone-plugin-alsa"
},

// Voice Activity Detection is used to determine when speech ended
"VAD": {
// silence method defined the main vad strategy
Expand Down Expand Up @@ -413,7 +428,7 @@
// Stop listing to the microphone during playback to prevent accidental triggering
// This is enabled by default, but instances with good microphone noise cancellation
// can disable this to listen all the time, allowing 'barge in' functionality.
"mute_during_output" : true,
"mute_during_output" : false,

// How much (if at all) to 'duck' the speaker output during listening. A
// setting of 0.0 will not duck at all. A 1.0 will completely mute output
Expand All @@ -440,11 +455,11 @@
// instant listen is an experimental setting, it removes the need for
// the pause between "hey mycroft" and starting to speak the utterance,
// this setting might slightly downgrade STT accuracy depending on engine used
"instant_listen": false,
"instant_listen": true,

// continuous listen is an experimental setting, it removes the need for
// wake words and uses VAD only, a streaming STT is strongly recommended
// this setting might downgrade STT accuracy depending on engine used
// this setting might downgrade STT accuracy depending on plugins used
"continuous_listen": false,

// hybrid listen is an experimental setting,
Expand Down Expand Up @@ -510,7 +525,7 @@
},

// DEPRECATED: the concept of enclosure will no longer exist in ovos-core
// this has been replaced with PHAL
// this has been replaced with PHAL, provides backwards compat for mycroft.client.enclosure module
"enclosure": {
// Platform name
// Override: SYSTEM (set by specific enclosures)
Expand Down Expand Up @@ -556,7 +571,7 @@
// Overrride: none
"session": {
// Time To Live, in seconds
"ttl": 180
"ttl": -1
},

// Speech to Text parameters
Expand All @@ -575,7 +590,7 @@
"tts": {
"pulse_duck": false,
"module": "ovos-tts-plugin-mimic3-server",
"fallback_module": "ovos-tts-plugin-mimic",
"fallback_module": "",
"ovos-tts-plugin-mimic": {
"voice": "ap"
},
Expand All @@ -584,15 +599,62 @@
}
},

// NLP plugins
// split utterances into words
// used by downstream tasks, handles lang specific nuances
"tokenization": {
// default plugin comes bundled with ovos-plugin-manager
"module": "ovos-tokenization-plugin-quebrafrases"
},
// split utterances into sub commands
// used to extract multiple intents from a single utterance
"segmentation": {
// default plugin comes bundled with ovos-plugin-manager
"module": "ovos-segmentation-plugin-quebrafrases"
},
// given an utterance extract keywords from it
// can be used to get search terms
"keyword_extract": {
// default plugin comes bundled with ovos-classifiers
"module": "ovos-keyword-extractor-heuristic"
},
// tag pronouns with the word they refer to
// used in normalization step
"coref": {
// default plugin comes bundled with ovos-classifiers
"module": "ovos-coref-solver-heuristic"
},
"postag": {
// default plugin comes bundled with ovos-classifiers
"module": "ovos-classifiers-postag-plugin"
},
// turn utterances into phoneme sequences, used to generate mouth movements
"g2p": {
"module": "ovos-g2p-plugin-dummy"
},

// DEPRECATED: this section is in the process of being fully removed,
// only providing default values for clean migration
"padatious": {
"intent_cache": "~/.local/share/mycroft/intent_cache",
"train_delay": 4,
"single_thread": false,
// fallback settings for padacioso (pure regex)
"regex_only": false,
// set regex_only to False to re-enable padatious (ovos-core < 0.0.8)
"regex_only": true,
"fuzz": true
},

// Translation plugins
"language": {
// default plugin comes bundled with ovos-classifiers
"detection_module": "ovos-lang-detect-ngram-lm",
// default is hosted by Neon but can be self hosted
// https://github.com/NeonGeckoCom/neon-lang-plugin-libretranslate
"translation_module": "libretranslate_plug"
},

// Media playback
"Audio": {
// message.context may contains a source and destination
// native audio (playback / TTS) will only be played if a
Expand Down
2 changes: 1 addition & 1 deletion ovos_config/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 0
VERSION_BUILD = 9
VERSION_BUILD = 10
VERSION_ALPHA = 0
# END_VERSION_BLOCK
Loading

0 comments on commit e985034

Please sign in to comment.