forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename air pollutants to air quality (home-assistant#19448)
* mv component folder * moved in airquality * changed names in files * renamed test init * renamed test air quality * renamed in tests * renamed coverage * fixed naming * corrected attr names * changed attr names
- Loading branch information
1 parent
6872373
commit 3a5ba77
Showing
10 changed files
with
97 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""The tests for Air Quality platforms.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""The tests for the Air Quality component.""" | ||
from homeassistant.components.air_quality import ( | ||
ATTR_ATTRIBUTION, ATTR_N2O, | ||
ATTR_OZONE, ATTR_PM_10) | ||
from homeassistant.setup import async_setup_component | ||
|
||
|
||
async def test_state(hass): | ||
"""Test Air Quality state.""" | ||
config = { | ||
'air_quality': { | ||
'platform': 'demo', | ||
} | ||
} | ||
|
||
assert await async_setup_component(hass, 'air_quality', config) | ||
|
||
state = hass.states.get('air_quality.demo_air_quality_home') | ||
assert state is not None | ||
|
||
assert state.state == '14' | ||
|
||
|
||
async def test_attributes(hass): | ||
"""Test Air Quality attributes.""" | ||
config = { | ||
'air_quality': { | ||
'platform': 'demo', | ||
} | ||
} | ||
|
||
assert await async_setup_component(hass, 'air_quality', config) | ||
|
||
state = hass.states.get('air_quality.demo_air_quality_office') | ||
assert state is not None | ||
|
||
data = state.attributes | ||
assert data.get(ATTR_PM_10) == 16 | ||
assert data.get(ATTR_N2O) is None | ||
assert data.get(ATTR_OZONE) is None | ||
assert data.get(ATTR_ATTRIBUTION) == \ | ||
'Powered by Home Assistant' |