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

Question: what is the expected format of included config file? #153

Closed
wsw70 opened this issue Feb 8, 2021 · 2 comments
Closed

Question: what is the expected format of included config file? #153

wsw70 opened this issue Feb 8, 2021 · 2 comments

Comments

@wsw70
Copy link
Contributor

wsw70 commented Feb 8, 2021

The documentation states

It is recommended you put your pyscript configuration its own yaml file in the pyscript folder.

I have a working pyscript section in configuration.yaml:

pyscript:
  allow_all_imports: true
  hass_is_global: true
  zigbee:
    light:
      salon_interrupteur_canape:
        single:
          - group.salon,off
          - group.salon_avant,toggle
        double:
          - group.salon,toggle
(...)

I tried to create a pyscript/config.yaml file with

  allow_all_imports: true
  hass_is_global: true
  zigbee:
    light:
      salon_interrupteur_canape:
        single:
          - group.salon,off
          - group.salon_avant,toggle
        double:
          - group.salon,toggle
(...)

and include it configuration.yaml as:

pyscript:
  config: !include pyscript/config.yaml

It did not work, there were errors about missing entries in the configuration that I call for instance as pyscript.config['zigbee']['light'].keys() (to use the config above).

I then tried to move allow_all_imports: true and hass_is_global: true into configuration.yaml and other similar combinations but I never actually managed to have the separate file working.

  • what should be its format?
  • should it only include the apps configuration? Or also allow_all_imports: true and hass_is_global: true
  • should I change the way I call the configuration variables in my apps?
@dlashua
Copy link
Contributor

dlashua commented Feb 8, 2021

you almost had it. in configuration.yaml you should have:

pyscript: !include pyscript/config.yaml

@wsw70
Copy link
Contributor Author

wsw70 commented Feb 8, 2021

I actually automatically wrote it like this (similar to the other includes), then before reloading I realized that the docs says something else:

pyscript:
   config: !include pyscript/config.yaml

And did not try my first intuition :)

Your code works, I opened a PR to correct the docs (#154)

@wsw70 wsw70 closed this as completed Feb 8, 2021
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

No branches or pull requests

2 participants