Remove deprecated yaml config from honeywell (#62469)
This commit is contained in:
parent
3898dfd248
commit
d1980e7351
4 changed files with 4 additions and 82 deletions
|
@ -5,9 +5,8 @@ import datetime
|
|||
from typing import Any
|
||||
|
||||
import somecomfort
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
|
@ -31,25 +30,12 @@ from homeassistant.components.climate.const import (
|
|||
SUPPORT_TARGET_TEMPERATURE,
|
||||
SUPPORT_TARGET_TEMPERATURE_RANGE,
|
||||
)
|
||||
from homeassistant.config_entries import SOURCE_IMPORT
|
||||
from homeassistant.const import (
|
||||
ATTR_TEMPERATURE,
|
||||
CONF_PASSWORD,
|
||||
CONF_REGION,
|
||||
CONF_USERNAME,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||
|
||||
from .const import (
|
||||
_LOGGER,
|
||||
CONF_COOL_AWAY_TEMPERATURE,
|
||||
CONF_DEV_ID,
|
||||
CONF_HEAT_AWAY_TEMPERATURE,
|
||||
CONF_LOC_ID,
|
||||
DEFAULT_COOL_AWAY_TEMPERATURE,
|
||||
DEFAULT_HEAT_AWAY_TEMPERATURE,
|
||||
DOMAIN,
|
||||
)
|
||||
|
||||
|
@ -59,25 +45,6 @@ ATTR_PERMANENT_HOLD = "permanent_hold"
|
|||
|
||||
PRESET_HOLD = "Hold"
|
||||
|
||||
PLATFORM_SCHEMA = vol.All(
|
||||
cv.deprecated(CONF_REGION),
|
||||
PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_USERNAME): cv.string,
|
||||
vol.Required(CONF_PASSWORD): cv.string,
|
||||
vol.Optional(
|
||||
CONF_COOL_AWAY_TEMPERATURE, default=DEFAULT_COOL_AWAY_TEMPERATURE
|
||||
): vol.Coerce(int),
|
||||
vol.Optional(
|
||||
CONF_HEAT_AWAY_TEMPERATURE, default=DEFAULT_HEAT_AWAY_TEMPERATURE
|
||||
): vol.Coerce(int),
|
||||
vol.Optional(CONF_REGION): cv.string,
|
||||
vol.Optional(CONF_DEV_ID): cv.string,
|
||||
vol.Optional(CONF_LOC_ID): cv.string,
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
HVAC_MODE_TO_HW_MODE = {
|
||||
"SwitchOffAllowed": {HVAC_MODE_OFF: "off"},
|
||||
"SwitchAutoAllowed": {HVAC_MODE_HEAT_COOL: "auto"},
|
||||
|
@ -127,26 +94,6 @@ async def async_setup_entry(hass, config, async_add_entities, discovery_info=Non
|
|||
)
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the Honeywell climate platform.
|
||||
|
||||
Honeywell uses config flow for configuration now. If an entry exists in
|
||||
configuration.yaml, the import flow will attempt to import it and create
|
||||
a config entry.
|
||||
"""
|
||||
|
||||
if config["platform"] == "honeywell":
|
||||
_LOGGER.warning(
|
||||
"Loading honeywell via platform config is deprecated; The configuration"
|
||||
" has been migrated to a config entry and can be safely removed"
|
||||
)
|
||||
# No config entry exists and configuration.yaml config exists, trigger the import flow.
|
||||
if not hass.config_entries.async_entries(DOMAIN):
|
||||
await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=config
|
||||
)
|
||||
|
||||
|
||||
class HoneywellUSThermostat(ClimateEntity):
|
||||
"""Representation of a Honeywell US Thermostat."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue