Remove deprecated YAML manual config for PVPC Hourly Pricing (#85614)

pull/83018/head^2
Eugenio Panadero 2023-01-10 20:49:54 +01:00 committed by GitHub
parent 67b238c8d1
commit caa8fc4d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 23 deletions

View File

@ -6,17 +6,16 @@ import logging
from aiopvpc import DEFAULT_POWER_KW, TARIFFS, PVPCData
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_registry import (
EntityRegistry,
async_get,
async_migrate_entries,
)
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.util import dt as dt_util
@ -41,22 +40,7 @@ UI_CONFIG_SCHEMA = vol.Schema(
vol.Required(ATTR_POWER_P3, default=DEFAULT_POWER_KW): VALID_POWER,
}
)
CONFIG_SCHEMA = vol.Schema(
vol.All(cv.deprecated(DOMAIN), {DOMAIN: cv.ensure_list(UI_CONFIG_SCHEMA)}),
extra=vol.ALLOW_EXTRA,
)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the electricity price sensor from configuration.yaml."""
for conf in config.get(DOMAIN, []):
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN, data=conf, context={"source": SOURCE_IMPORT}
)
)
return True
CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

View File

@ -32,10 +32,6 @@ class TariffSelectorConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return self.async_show_form(step_id="user", data_schema=UI_CONFIG_SCHEMA)
async def async_step_import(self, import_info):
"""Handle import from config file."""
return await self.async_step_user(import_info)
class PVPCOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle PVPC options."""