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.10.0b2 breaks bwalarm #133

Closed
tomlut opened this issue Oct 2, 2021 · 1 comment · Fixed by #134
Closed

2021.10.0b2 breaks bwalarm #133

tomlut opened this issue Oct 2, 2021 · 1 comment · Fixed by #134

Comments

@tomlut
Copy link

tomlut commented Oct 2, 2021

The component:

  • Current version: v1.12.10
  • Last known working version (if any):

Your setup:

  • Home Assistant version: 2021.10.0b2
  • Last known working Home Assistant version (if any): 2021.9.7
  • OS: HassOS
  • Browser name & version: Firefox 92.0.1

Describe the bug

The following error is generated when running the 2021.10 beta version of home assiatant and the alarm integration is not set up:

This error originated from a custom integration.

Logger: homeassistant.bootstrap
Source: custom_components/bwalarm/alarm_control_panel.py:892
Integration: bwalarm (documentation)
First occurred: 16:11:37 (1 occurrences)
Last logged: 16:11:37

Error setting up integration alarm_control_panel - received exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 104, in async_setup_component
    return await task  # type: ignore
  File "/usr/src/homeassistant/homeassistant/setup.py", line 214, in _async_setup_component
    processed_config = await conf_util.async_process_component_config(
  File "/usr/src/homeassistant/homeassistant/config.py", line 887, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 532, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 537, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 491, in <module>
    class BWAlarm(AlarmControlPanelEntity):
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 892, in BWAlarm
    def _save_yaml(self, fname: str, data: JSON_TYPE) -> None:
NameError: name 'JSON_TYPE' is not defined

To Reproduce

  1. Install the 2021.10 beta version of Home Assistant

Expected behavior

The integration to set up.
Your bwalarm.yaml

Home Assistant log

Screenshots

Additional context

@spacegaier
Copy link

spacegaier commented Oct 2, 2021

Issue seems to come from here:

from homeassistant.util.ruamel_yaml import JSON_TYPE

The ruamel part has been removed from HA (home-assistant/core#55672), so the import should now be:

from homeassistant.util.yaml.loader import JSON_TYPE

Or could be replaced by a Union if you don't want to rely on HA internals, see https://discord.com/channels/330944238910963714/427516175237382144/893754774149804123

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.

2 participants