1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

[climate] Update components to use `climate_schema(...)` (#8788)

This commit is contained in:
Jesse Hills
2025-05-14 17:36:21 +12:00
committed by GitHub
parent a12bd78ceb
commit de27ce79dc
32 changed files with 180 additions and 255 deletions

View File

@@ -1,7 +1,5 @@
import esphome.codegen as cg
from esphome.components import climate
import esphome.config_validation as cv
from esphome.const import CONF_ID
from .. import (
UPONOR_SMATRIX_DEVICE_SCHEMA,
@@ -19,15 +17,12 @@ UponorSmatrixClimate = uponor_smatrix_ns.class_(
UponorSmatrixDevice,
)
CONFIG_SCHEMA = climate.CLIMATE_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(UponorSmatrixClimate),
}
).extend(UPONOR_SMATRIX_DEVICE_SCHEMA)
CONFIG_SCHEMA = climate.climate_schema(UponorSmatrixClimate).extend(
UPONOR_SMATRIX_DEVICE_SCHEMA
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
var = await climate.new_climate(config)
await cg.register_component(var, config)
await climate.register_climate(var, config)
await register_uponor_smatrix_device(var, config)