2020-10-21 08:17:49 +00:00
|
|
|
"""Support for Nest sensors that dispatches between API versions."""
|
2016-05-15 19:29:12 +00:00
|
|
|
|
2020-10-21 08:17:49 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
|
|
from homeassistant.helpers.typing import HomeAssistantType
|
2019-03-21 05:56:46 +00:00
|
|
|
|
2020-10-21 08:17:49 +00:00
|
|
|
from .const import DATA_SDM
|
2020-12-22 20:42:37 +00:00
|
|
|
from .legacy.sensor import async_setup_legacy_entry
|
2020-10-21 08:17:49 +00:00
|
|
|
from .sensor_sdm import async_setup_sdm_entry
|
2016-01-14 04:05:47 +00:00
|
|
|
|
|
|
|
|
2020-10-21 08:17:49 +00:00
|
|
|
async def async_setup_entry(
|
|
|
|
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
|
|
|
|
) -> None:
|
|
|
|
"""Set up the sensors."""
|
|
|
|
if DATA_SDM not in entry.data:
|
2020-10-24 18:48:28 +00:00
|
|
|
await async_setup_legacy_entry(hass, entry, async_add_entities)
|
2020-10-26 15:40:43 +00:00
|
|
|
return
|
|
|
|
|
2020-10-24 18:48:28 +00:00
|
|
|
await async_setup_sdm_entry(hass, entry, async_add_entities)
|