1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-28 20:53:45 +01:00
Files
core/homeassistant/components/droplet/__init__.py
Sarah Seidman ceeeb22040 Add integration for Droplet (#149989)
Co-authored-by: Norbert Rittel <norbert@rittel.de>
Co-authored-by: Josef Zweck <josef@zweck.dev>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-09-10 17:38:49 +02:00

38 lines
983 B
Python

"""The Droplet integration."""
from __future__ import annotations
import logging
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .coordinator import DropletConfigEntry, DropletDataCoordinator
PLATFORMS: list[Platform] = [
Platform.SENSOR,
]
logger = logging.getLogger(__name__)
async def async_setup_entry(
hass: HomeAssistant, config_entry: DropletConfigEntry
) -> bool:
"""Set up Droplet from a config entry."""
droplet_coordinator = DropletDataCoordinator(hass, config_entry)
await droplet_coordinator.async_config_entry_first_refresh()
config_entry.runtime_data = droplet_coordinator
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True
async def async_unload_entry(
hass: HomeAssistant, config_entry: DropletConfigEntry
) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)