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

GeoRSS got error on 0.80.0b2 #17233

Closed
awarecan opened this issue Oct 8, 2018 · 1 comment · Fixed by #17239
Closed

GeoRSS got error on 0.80.0b2 #17233

awarecan opened this issue Oct 8, 2018 · 1 comment · Fixed by #17239

Comments

@awarecan
Copy link
Contributor

awarecan commented Oct 8, 2018

Home Assistant release with the issue:

0.80.0b2

Last working Home Assistant release (if known):
0.79.x

Operating environment (Hass.io/Docker/Windows/etc.):

Hassbian
Python 3.5.3

Component/platform:

https://www.home-assistant.io/components/sensor.geo_rss_events/

Description of problem:
Got error during the start up

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

sensor:
  - platform: geo_rss_events
    name: CAL FIRE Incidents
    url: http://cdfdata.fire.ca.gov/incidents/rss.xml
    radius: 100.0

Traceback (if applicable):

Oct 07 20:44:56 hassbian hass[30622]: 2018-10-07 20:44:56 DEBUG (Thread-9) [homeassistant.components.sensor.geo_rss_events] latitude=33.****, longitude=-117.****, url=http://cdfdata.fire.ca.gov/incidents/rss.xml, radius=100.0
Oct 07 20:44:57 hassbian hass[30622]: 2018-10-07 20:44:57 ERROR (MainThread) [homeassistant.components.sensor] geo_rss_events: Error on device update!
Oct 07 20:44:57 hassbian hass[30622]: Traceback (most recent call last):
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 251, in _async_add_entity
Oct 07 20:44:57 hassbian hass[30622]:     await entity.async_device_update(warning=False)
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
Oct 07 20:44:57 hassbian hass[30622]:     await self.hass.async_add_job(self.update)
Oct 07 20:44:57 hassbian hass[30622]:   File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
Oct 07 20:44:57 hassbian hass[30622]:     yield self  # This tells Task to wait for completion.
Oct 07 20:44:57 hassbian hass[30622]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
Oct 07 20:44:57 hassbian hass[30622]:     future.result()
Oct 07 20:44:57 hassbian hass[30622]:   File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
Oct 07 20:44:57 hassbian hass[30622]:     raise self._exception
Oct 07 20:44:57 hassbian hass[30622]:   File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
Oct 07 20:44:57 hassbian hass[30622]:     result = self.fn(*self.args, **self.kwargs)
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/geo_rss_events.py", line 127, in update
Oct 07 20:44:57 hassbian hass[30622]:     status, feed_entries = self._feed.update()
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/georss_client/__init__.py", line 59, in update
Oct 07 20:44:57 hassbian hass[30622]:     return UPDATE_OK, self._filter_entries(entries)
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/georss_client/__init__.py", line 95, in _filter_entries
Oct 07 20:44:57 hassbian hass[30622]:     filtered_entries))
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/georss_client/__init__.py", line 94, in <lambda>
Oct 07 20:44:57 hassbian hass[30622]:     entry.distance_to_home <= self._filter_radius,
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/georss_client/__init__.py", line 184, in distance_to_home
Oct 07 20:44:57 hassbian hass[30622]:     self._home_coordinates, self.geometry)
Oct 07 20:44:57 hassbian hass[30622]:   File "/srv/homeassistant/lib/python3.5/site-packages/georss_client/__init__.py", line 234, in distance_to_geometry
Oct 07 20:44:57 hassbian hass[30622]:     if geometry.type == 'Point':
Oct 07 20:44:57 hassbian hass[30622]: AttributeError: 'NoneType' object has no attribute 'type'

Additional information:

It caused by #16939
cc @exxamalte

@exxamalte
Copy link
Contributor

Quick analysis: This is caused by feed entries that do not define any geometry (geo location data) at all. I have already fixed this (and included tests) in the next version of the georss-client library.
Give me a couple of hours and I'll release a new version of the library and can have a PR ready.

@ghost ghost added the in progress label Oct 8, 2018
@ghost ghost removed the in progress label Oct 8, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants