Skip to content

Commit

Permalink
Set SCAN_INTERVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
fabaff committed Dec 11, 2018
1 parent a2eeb46 commit 3f31a36
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions homeassistant/components/air_pollutants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/air_pollutants/
"""
from datetime import timedelta
import logging

from homeassistant.helpers.entity_component import EntityComponent
Expand All @@ -12,10 +13,6 @@

_LOGGER = logging.getLogger(__name__)

DOMAIN = 'air_pollutants'

ENTITY_ID_FORMAT = DOMAIN + '.{}'

ATTR_AIR_POLLUTANTS_AQI = 'air_quality_index'
ATTR_AIR_POLLUTANTS_ATTRIBUTION = 'attribution'
ATTR_AIR_POLLUTANTS_C02 = 'carbon_dioxide'
Expand All @@ -29,10 +26,17 @@
ATTR_AIR_POLLUTANTS_PM_2_5 = 'particulate_matter_2_5'
ATTR_AIR_POLLUTANTS_SO2 = 'sulphur_dioxide'

DOMAIN = 'air_pollutants'

ENTITY_ID_FORMAT = DOMAIN + '.{}'

SCAN_INTERVAL = timedelta(seconds=30)


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

Expand Down

0 comments on commit 3f31a36

Please sign in to comment.