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

2021.4 secret changes breaks lovelace gen #25

Closed
Petro31 opened this issue Apr 3, 2021 · 0 comments · Fixed by #26
Closed

2021.4 secret changes breaks lovelace gen #25

Petro31 opened this issue Apr 3, 2021 · 0 comments · Fixed by #26

Comments

@Petro31
Copy link
Contributor

Petro31 commented Apr 3, 2021

This pr changed how secrets work: home-assistant/core#47034. It causes lovelace_gen to break.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/lovelace/websocket.py", line 30, in send_with_error_handling
    result = await func(hass, connection, msg, config)
  File "/usr/src/homeassistant/homeassistant/components/lovelace/websocket.py", line 72, in websocket_lovelace_config
    return await config.async_load(msg["force"])
  File "/usr/src/homeassistant/homeassistant/components/lovelace/dashboard.py", line 188, in async_load
    is_updated, config = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/lovelace/dashboard.py", line 207, in _load_config
    config = load_yaml(self.path, Secrets(Path(self.hass.config.config_dir)))
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 112, in load_yaml
    return parse_yaml(conf_file, secrets)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 124, in parse_yaml
    yaml.load(content, Loader=lambda stream: SafeLineLoader(stream, secrets))
  File "/usr/local/lib/python3.8/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.8/site-packages/yaml/constructor.py", line 51, in get_single_data
    return self.construct_document(node)
  File "/usr/local/lib/python3.8/site-packages/yaml/constructor.py", line 55, in construct_document
    data = self.construct_object(node)
  File "/usr/local/lib/python3.8/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 254, in _ordered_dict
    nodes = loader.construct_pairs(node)
  File "/usr/local/lib/python3.8/site-packages/yaml/constructor.py", line 155, in construct_pairs
    value = self.construct_object(value_node, deep=deep)
  File "/usr/local/lib/python3.8/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 173, in _include_yaml
    return _add_reference(load_yaml(fname, loader.secrets), loader, node)
  File "/config/custom_components/lovelace_gen/__init__.py", line 32, in load_yaml
    stream = io.StringIO(jinja.get_template(fname).render({**args, "_global": llgen_config}))
TypeError: 'Secrets' object is not a mapping
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 a pull request may close this issue.

1 participant