Files
Abílio CostaGitHubClaude Opus 4.8copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
9004f3a89a Add get_prices_for_date service action to OMIE (#175820)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-07 15:49:00 +02:00

35 lines
1.1 KiB
Python

"""The OMIE - Spain and Portugal electricity prices integration."""
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType
from .const import DOMAIN
from .coordinator import OMIEConfigEntry, OMIECoordinator
from .services import async_setup_services
PLATFORMS = [Platform.SENSOR]
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the OMIE integration."""
async_setup_services(hass)
return True
async def async_setup_entry(hass: HomeAssistant, entry: OMIEConfigEntry) -> bool:
"""Set up from a config entry."""
entry.runtime_data = OMIECoordinator(hass, entry)
await entry.runtime_data.async_config_entry_first_refresh()
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: OMIEConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)