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

Air Quality Health Index #10

Closed
jm66 opened this issue Oct 16, 2019 · 5 comments · Fixed by #11
Closed

Air Quality Health Index #10

jm66 opened this issue Oct 16, 2019 · 5 comments · Fixed by #11

Comments

@jm66
Copy link
Contributor

jm66 commented Oct 16, 2019

Hi @michaeldavie, inspired by env_canada and following the module architecture, I put together aqhi_canada which work pretty much the same as env_canada:

from aqhi_canada.aqhi_data import AqhiData

aqhi = AqhiData(coordinates=(lat, long), language='english')
aqhi.conditions
{'aqhi': {'label': 'Air Quality Health Index', 'value': '2.1'}}

aqhi = AqhiData(coordinates=(lat, long), language='french')
aqhi.conditions
{'aqhi': {'label': 'Cote air santé', 'value': '2.1'}}

But pulling data from different source AQHI_XML_File_List.xml, http://dd.weather.gc.ca/air_quality/aqhi/{cgndb}/observation/realtime/xml/AQ_OBS_{lan}_CURRENT.xml and http://dd.weather.gc.ca/air_quality/aqhi/{cgndb}/observation/realtime/xml/AQ_FCST_{lan}_CURRENT.xml.

At first I thought it could be a different package, but since the data comes from Environment Canada as well, I believe it could be part of the env_canada. Please, let me know your thoughts and if you agree to add aqhi_data.py - I could happily submit a PR.

@michaeldavie
Copy link
Owner

Cool! I think that it makes sense it add it, and I can add it to the environment_canada component for Home Assistant as well. PR away!

jm66 added a commit to jm66/env_canada that referenced this issue Oct 18, 2019
- AqhiData class takes either lat/long or
  zone_abreviation and region_cgndb
- Provides current conditions, daily forecasts
  and hourly forecasts
- fixes michaeldavie#10
- Bonus: Adds .gitignore to exclude files from
  being tracked
@jm66
Copy link
Contributor Author

jm66 commented Oct 23, 2019

Thanks for merging the code. Please, let me know how I could help to add aqhi to the environment_canada component.

@michaeldavie
Copy link
Owner

I did some work on this today, and I think I'm going to merge the AQHI logic you developed into the existing ec_data file. That will make things simpler on the Home Assistant side, and I think it makes sense for the module as well. I'm going to try to work on this over the next next week; hopefully we'll get it into the 0.102 release, which is a little more than 3 weeks away.

@michaeldavie
Copy link
Owner

The AQHI data has been added to release v0.0.30, and I've opened a PR (home-assistant/core#28487) to add an AQHI sensor to Home Assistant in 0.102.

@jm66
Copy link
Contributor Author

jm66 commented Nov 4, 2019

Thanks a lot @michaeldavie im looking forward to adding the AQHI index to my alerts/notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants