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

Fix no attribute EVENT_PERSISTENT_NOTIFICATIONS_UPDATED #427

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

frenck
Copy link
Owner

@frenck frenck commented Oct 25, 2023

Description

The following error occurs:

2023-10-25 22:02:45.618 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up spook platform for sensor
Traceback (most recent call last):
  File "/home/frenck/code/home-assistant/core/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/home/frenck/code/home-assistant/core/config/custom_components/spook/sensor.py", line 22, in async_setup_entry
    await async_forward_platform_entry_setups_to_ectoplasm(
  File "/home/frenck/code/home-assistant/core/config/custom_components/spook/util.py", line 32, in async_forward_platform_entry_setups_to_ectoplasm
    module = importlib.import_module(f".{module_path}", __package__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/frenck/.pyenv/versions/3.11.4/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/frenck/code/home-assistant/core/config/custom_components/spook/ectoplasms/homeassistant/sensor.py", line 380, in <module>
    persistent_notification.EVENT_PERSISTENT_NOTIFICATIONS_UPDATED,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'homeassistant.components.persistent_notification' has no attribute 'EVENT_PERSISTENT_NOTIFICATIONS_UPDATED'

Motivation and Context

Fix that darn error.

How has this been tested?

With a lot of tears

Screenshots (if appropriate):

Nah, so much wasted disk space for that.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

oh it fixes #425

@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label Oct 25, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@frenck frenck merged commit 68b17f8 into main Oct 25, 2023
15 checks passed
@frenck frenck deleted the frenck-2023-1351 branch October 25, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError persistent_notification
1 participant