Move Notion coordinator to its own module (#112756)

Co-authored-by: Cretezy <Cretezy@users.noreply.github.com>
This commit is contained in:
Aaron Bach 2024-03-12 14:51:13 -06:00 committed by GitHub
parent df03e704f8
commit 20647af5ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 176 additions and 142 deletions

View file

@ -17,6 +17,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import NotionEntity
from .const import DOMAIN, SENSOR_MOLD, SENSOR_TEMPERATURE
from .coordinator import NotionDataUpdateCoordinator
from .model import NotionEntityDescription
@ -45,7 +46,7 @@ async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up Notion sensors based on a config entry."""
coordinator = hass.data[DOMAIN][entry.entry_id]
coordinator: NotionDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
async_add_entities(
[
@ -54,7 +55,6 @@ async def async_setup_entry(
listener_id,
sensor.uuid,
sensor.bridge.id,
sensor.system_id,
description,
)
for listener_id, listener in coordinator.data.listeners.items()