custom-components / feedparser

📰 RSS Feed Integration
MIT License
145 stars 33 forks source link

Feedparser will fail in HA 2023.6 #70

Closed Anto79-ops closed 1 year ago

Anto79-ops commented 1 year ago

Hi, running beta and its not liking feedparser.

This error originated from a custom integration.

Logger: homeassistant.loader
Source: custom_components/feedparser/sensor.py:46
Integration: feedparser (documentation)
First occurred: 4:08:04 PM (4 occurrences)
Last logged: 4:40:51 PM

Unexpected exception importing platform custom_components.feedparser.sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, 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 "/config/custom_components/feedparser/sensor.py", line 46, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'

has to be updated "to not use the asyncio.coroutine decorator"

From a fellow in the beta chat RobertD502

Just remove the @asyncio.coroutine decorator on line 46 of sensor.py and change "def async_setup_plaform" on line 47 to "async def async_setup_plaform"

That way you get to still use the component.
Dynamix72 commented 1 year ago

Can this be implemented in a new version of feedparser? So anyone can update?

FuzzyMistborn commented 1 year ago

If you need a release/update while waiting for a new one here, you can use my fork: https://github.com/FuzzyMistborn/feedparser as a custom repo in HACS.

VeZReVouLiS commented 1 year ago

From a fellow in the beta chat RobertD502

Just remove the @asyncio.coroutine decorator on line 46 of sensor.py and change "def async_setup_plaform" on line 47 to "async def async_setup_plaform"

That way you get to still use the component.

I just tried that, and it worked fine. Actually, i commented out the @asyncio.coroutine and added the async as suggested.

A made a restart and everything works as before.

Thanks a lot for the tip.

Scialla commented 1 year ago

Modify on line 46 & 47 don't work for me, now i've this error on log:

The feedparser platform for the sensor integration does not support platform setup. Please remove it from your config.

HA core in docker

Chreece commented 1 year ago

Modify on line 46 & 47 don't work for me, now i've this error on log:

The feedparser platform for the sensor integration does not support platform setup. Please remove it from your config.

HA core in docker

had the same problem, the line was false, copy this in lines 46,47:

"""@asyncio.coroutine"""
async def async_setup_platform(
Scialla commented 1 year ago

had the same problem, the line was false, copy this in lines 46,47:

"""@asyncio.coroutine"""
async def async_setup_platform(

Worked fine!

Thanks!

metbril commented 1 year ago

duplicate of #66. There is a PR #69 that, if released, will fix this.

ogajduse commented 1 year ago

Hey community, I have got a maintainer access to the repository recently. I am going to merge #72 and do a release. I have tested it and I can confirm that the patch works for me and the patch also brings back the local_time config option.

ogajduse commented 1 year ago

The 0.1.10 release with the fix is out https://github.com/custom-components/feedparser/releases/tag/0.1.10 :tada: