hass-core/homeassistant/components/nest/sensor.py
Allen Porter 52b66e88c7
Update Nest integration to support Google Nest Device Access (new API) (#41689)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-21 10:17:49 +02:00

17 lines
635 B
Python

"""Support for Nest sensors that dispatches between API versions."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from .const import DATA_SDM
from .sensor_legacy import async_setup_legacy_entry
from .sensor_sdm import async_setup_sdm_entry
async def async_setup_entry(
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
) -> None:
"""Set up the sensors."""
if DATA_SDM not in entry.data:
return await async_setup_legacy_entry(hass, entry, async_add_entities)
return await async_setup_sdm_entry(hass, entry, async_add_entities)