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

Add air pollutants component #18707

merged 9 commits into from Dec 14, 2018


Copy link

fabaff commented Nov 25, 2018


The air_pollutants component (as mentioned in this arch issue) should standardized the handling of air quality and pollution details like the weather platform does.

Related issue (if applicable): fixes home-assistant/architecture#109

Pull request in with documentation (if applicable): home-assistant/

Example entry for configuration.yaml (if applicable):

  - platform: demo


  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
from homeassistant.components.air_pollutants import AirPollutantsEntity
from homeassistant.const import (TEMP_CELSIUS, TEMP_FAHRENHEIT)

This comment has been minimized.


houndci-bot Dec 5, 2018

'homeassistant.const.TEMP_CELSIUS' imported but unused
'homeassistant.const.TEMP_FAHRENHEIT' imported but unused

@fabaff fabaff force-pushed the air-pollutants branch from 04532ac to bde7d2c Dec 6, 2018

fabaff added some commits Nov 25, 2018

@fabaff fabaff force-pushed the air-pollutants branch from bde7d2c to a2eeb46 Dec 10, 2018

Copy link

MartinHjelmare left a comment

Looks good! One comment.

async def async_setup(hass, config):
"""Set up the air pollutants component."""
component =[DOMAIN] = EntityComponent(_LOGGER, DOMAIN, hass)

This comment has been minimized.


MartinHjelmare Dec 10, 2018


Should we set the default scan interval to 30 seconds as for sensors, instead of 15 seconds as is the main default?

This comment has been minimized.


fabaff Dec 11, 2018


We should.

@fabaff fabaff referenced this pull request Dec 11, 2018



3 of 3 tasks complete
Copy link

MartinHjelmare left a comment



This comment has been minimized.

Copy link

MartinHjelmare commented Dec 11, 2018

Do we need more 👍 from members in the architecture issue before merging this?

if ozone is not None:

particulate_matter_0_1 = self.particulate_matter_0_1

This comment has been minimized.


balloob Dec 14, 2018


We've used a PROP_TO_ATTR dictionary before to prevent the repetition.

This comment has been minimized.


fabaff Dec 15, 2018



@balloob balloob merged commit b88cf64 into dev Dec 14, 2018

6 checks passed

Hound No violations found. Woof!
WIP ready for review
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed
coverage/coveralls Coverage increased (+0.005%) to 92.952%

@delete-merged-branch delete-merged-branch bot deleted the air-pollutants branch Dec 14, 2018

@wafflebot wafflebot bot removed the in progress label Dec 14, 2018

mxworm added a commit to mxworm/home-assistant that referenced this pull request Dec 14, 2018

Merge branch 'dev' into current
* dev: (88 commits)
  huawei_lte: Fetch only required data (home-assistant#17618)
  Adding support for Plum Lightpad (home-assistant#16576)
  Fix restore state for manual alarm control panel (home-assistant#19284)
  Set InsteonEntity name to be combo of description and address. (home-assistant#17262)
  Device config for Fibaro hub integration (home-assistant#19171)
  Add air pollutants component (home-assistant#18707)
  Updated ELIQ Online sensor to async API (home-assistant#19248)
  Set unavailable when unreachable (home-assistant#19012)
  Make variable `entity_id` available to value_template for MQTT binary sensor (home-assistant#19195)
  home-assistant#17333: update to use DOMAIN constants and standards. (home-assistant#19242)
  Fix race in entity_platform.async_add_entities (home-assistant#19222)
  Fix race in entity_platform.async_add_entities (home-assistant#19222)
  Bumped version to 0.84.2
  Fix call to super() (home-assistant#19279)
  Fix OwnTracks deadlocking (home-assistant#19260)
  Fix list (fixes home-assistant#19235) (home-assistant#19258)
  Add automation and script events to logbook filter events (home-assistant#19253)
  Bump aioasuswrt (home-assistant#19229)
  Review comments
  Move check to websocket

@fabaff fabaff referenced this pull request Dec 15, 2018


Add air pollutants PROP_TO_ATTR #19336

3 of 3 tasks complete

dshokouhi added a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018

Add air pollutants component (home-assistant#18707)
* Add air pollutants component

* Fix lint issue

* Update docstrings

* Revert change

* Remove entries

* Remove imports

* Fix variable and other fixes

* Change tests


@balloob balloob referenced this pull request Jan 10, 2019


0.85.0 #19897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment