custom-components / weatheralerts

A sensor that gives you weather alerts from alerts.weather.gov.
MIT License
127 stars 15 forks source link

error being generated twice per minute: list index out of range #18

Closed bbrendon closed 4 years ago

bbrendon commented 5 years ago
ERROR (MainThread) [custom_components.weatheralerts.sensor] list index out of range
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

bbrendon commented 5 years ago

bump

vmcosco commented 5 years ago

Having the same issue with SAME# 026125

ludeeus commented 5 years ago

That usually mean that the SAMEID can not be used, try a different one

bbrendon commented 5 years ago

There really isn't another ID for my area. A few weeks ago there was an alert and it pulled the data fine.

bbrendon commented 5 years ago

...and apparently there is an issue for this upstream. https://github.com/zebpalmer/WeatherAlerts/issues/12

ludeeus commented 5 years ago

Really? It works when there are alerts? Don't hold your breath, the upstream Lib looks abandoned

bbrendon commented 5 years ago

Yes. It’s been working okay other than the log message. The alert summary gets cut off after about three sentences. I’ve been trying to decide if I should use this or dark sky. Darksky has a problem where it duplicates the same alert sometimes.

ludeeus commented 5 years ago

That's interesting... What sameid are you using?

niemyjski commented 5 years ago

I'm also having the same issue.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

niemyjski commented 4 years ago

I'm still seeing this

roblandry commented 4 years ago

Here is how i fixed mine...

Change this on Line 70

            last_event = nws.alerts[0]

To this:

            if nws.alerts:
                last_event = nws.alerts[0]

The error is because there are no alerts available, and we are ASSUMING there is something in the dictionary.