Rename air pollutants to air quality (#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
This commit is contained in:
Eliseo Martelli authored and Paulus Schoutsen committed 2019-01-05 11:42:36 -05:00
1 parent 68723730a7
commit 3a5ba77e04
10 files changed
+96 -96

No files matched your search

@@ -1 +0,0 @@
"""The tests for Air Pollutants platforms."""
@@ -1,42 +0,0 @@
"""The tests for the Air Pollutants component."""
from homeassistant.components.air_pollutants import (
ATTR_AIR_POLLUTANTS_ATTRIBUTION, ATTR_AIR_POLLUTANTS_N2O,
ATTR_AIR_POLLUTANTS_OZONE, ATTR_AIR_POLLUTANTS_PM_10)
from homeassistant.setup import async_setup_component
async def test_state(hass):
"""Test Air Pollutants state."""
config = {
'air_pollutants': {
'platform': 'demo',
}
}
assert await async_setup_component(hass, 'air_pollutants', config)
state = hass.states.get('air_pollutants.demo_air_pollutants_home')
assert state is not None
assert state.state == '14'
async def test_attributes(hass):
"""Test Air Pollutants attributes."""
config = {
'air_pollutants': {
'platform': 'demo',
}
}
assert await async_setup_component(hass, 'air_pollutants', config)
state = hass.states.get('air_pollutants.demo_air_pollutants_office')
assert state is not None
data = state.attributes
assert data.get(ATTR_AIR_POLLUTANTS_PM_10) == 16
assert data.get(ATTR_AIR_POLLUTANTS_N2O) is None
assert data.get(ATTR_AIR_POLLUTANTS_OZONE) is None
assert data.get(ATTR_AIR_POLLUTANTS_ATTRIBUTION) == \
'Powered by Home Assistant'
+1
View File
@@ -0,0 +1 @@
"""The tests for Air Quality platforms."""
@@ -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'