rolfberkenbosch / meteoalert-api

MIT License
12 stars 10 forks source link

Alert lookup is broken #27

Closed attila123456 closed 2 years ago

attila123456 commented 2 years ago

I haven't been getting alerts for some time and after some digging in the code, this part seems to be the root cause:

            cap_url = None
            for link in entry.get('link'):
                if 'hub' in link.get('@href'):
                    cap_url = link.get('@href')

this is the <link> element in question:

    <link href="https://feeds.meteoalarm.org/api/v1/warnings/feeds-netherlands/83495e3b-f9f9-4f3c-b3e3-b30b4449d1e3" type="application/cap+xml"/>

"hub" is nowhere in the href value. Perhaps searching for type="application/cap+xml" would be better?

rolfberkenbosch commented 2 years ago

Thanks for the commit, I just released a new version. Are you able to test it with your home-assistant ?

rolfberkenbosch commented 2 years ago

I have just test it @attila123456 and it worked. So i have update the package and also create a pull request @homeassistant. Hopefully it will be merged soon. Thanks again for your commit!