Move Notion coordinator to its own module (#112756)
Co-authored-by: Cretezy <Cretezy@users.noreply.github.com>
This commit is contained in:
parent
df03e704f8
commit
20647af5ae
6 changed files with 176 additions and 142 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue