Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config as YAML files instead of python. Live translation of logs and TTS #31

Merged
merged 6 commits into from
Jul 29, 2023

Conversation

danic85
Copy link
Collaborator

@danic85 danic85 commented Jul 28, 2023

This will allow module creators to add a corresponding config yaml file for their module that will be made available automatically in the framework via the Config.get([module], [parameter]) syntax.

Also contains a method get_all_pins() to display the list of pins in use by the various modules. Useful for conflict detection and module planning.

Currently untested

Creating a module
Create the python module (described in documentation)
Create a corresponding .yaml file in the config directory.
Populate the file with your module configuration parameters
Add a docs section that includes the following:

  • description of the module
  • events including pub and sub with details of published and subscribed events
module_name:
    pin: 12 #This must be the name of the pin parameter if present
    something_else: value 
    docs:
      description: "Your module description"
      events:
        sub:
          - eventtopic:
              description: "Description of event."
              args:
                - name: type
        pub:
          - eventtopic:
              description: "Description of event."
              args:
                - name: type

The config.py script will import all yaml files in this directory and merge them into a single config, accessible via Config.get([module], [parameter]). Ensure that your name does not conflict with other existing modules.

Live Translation
The live translation module translation.py allows live translation of logs and TTS output via google translate.

Call translate.request(msg) and optionally specify the source and destination languages.

The config/translation.yml specifies the default languages.

@danic85 danic85 changed the title WIP: Config as YAML files instead of python Config as YAML files instead of python. Live translation of logs and TTS Jul 29, 2023
@danic85 danic85 marked this pull request as ready for review July 29, 2023 09:41
@danic85 danic85 merged commit 71ac12b into develop Jul 29, 2023
@danic85 danic85 deleted the feature/config branch July 29, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant