custom-components / weatheralerts

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

Duplicated Alerts from NWS - fix provided #71

Open mjnovotny82 opened 1 year ago

mjnovotny82 commented 1 year ago

NWS keeps duplicating some of their alerts where they keep the original alert and issue a second alert when the advisory is actually occurring.

It was very annoying to have two Wind Advisory alerts being announced every time.

Attached is NWS API output and my sensor.py fix.

NWS API output - weatheralerts--WIZ060-WIC089.txt

My fix: sensor.py.txt Line 19 = new Lines 159-195 = amended, lines 159-161 are new

regularguy01 commented 1 year ago

Are these really duplicates the oids all look different to me. Are you saying the text with in the oid is the same? I have not gotten duplicate alerts.

I rewrote alot of the yaml in mine though.