2020-11-06 08:57:02 +00:00
|
|
|
"""Support for Nest climate that dispatches between API versions."""
|
2016-11-05 00:22:47 +00:00
|
|
|
|
2020-11-06 08:57:02 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
|
|
from homeassistant.helpers.typing import HomeAssistantType
|
2016-11-05 00:22:47 +00:00
|
|
|
|
2020-11-06 08:57:02 +00:00
|
|
|
from .climate_sdm import async_setup_sdm_entry
|
|
|
|
from .const import DATA_SDM
|
2020-12-22 20:42:37 +00:00
|
|
|
from .legacy.climate import async_setup_legacy_entry
|
2016-08-19 07:17:28 +00:00
|
|
|
|
2019-03-21 05:56:46 +00:00
|
|
|
|
2020-11-06 08:57:02 +00:00
|
|
|
async def async_setup_entry(
|
|
|
|
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
|
|
|
|
) -> None:
|
|
|
|
"""Set up the climate platform."""
|
|
|
|
if DATA_SDM not in entry.data:
|
|
|
|
await async_setup_legacy_entry(hass, entry, async_add_entities)
|
|
|
|
return
|
|
|
|
await async_setup_sdm_entry(hass, entry, async_add_entities)
|