2020-10-27 14:20:01 +00:00
|
|
|
"""Support for Nest cameras that dispatches between API versions."""
|
2016-12-03 19:46:04 +00:00
|
|
|
|
2020-10-27 14:20:01 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
2021-04-22 18:23:19 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2021-07-26 23:43:52 +00:00
|
|
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
2016-12-03 19:46:04 +00:00
|
|
|
|
2020-10-27 14:20:01 +00:00
|
|
|
from .camera_sdm import async_setup_sdm_entry
|
|
|
|
from .const import DATA_SDM
|
2020-12-22 20:42:37 +00:00
|
|
|
from .legacy.camera import async_setup_legacy_entry
|
2016-11-28 00:18:47 +00:00
|
|
|
|
|
|
|
|
2020-10-27 14:20:01 +00:00
|
|
|
async def async_setup_entry(
|
2021-07-26 23:43:52 +00:00
|
|
|
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
2020-10-27 14:20:01 +00:00
|
|
|
) -> None:
|
|
|
|
"""Set up the cameras."""
|
|
|
|
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)
|