9import esphome.codegen
as cg
10import esphome.config_validation
as cv
11from esphome.components
import climate
12from esphome.const
import CONF_ID
14from .
import home_io_control_ns
15from .platform_common
import (
16 create_companion_sensors,
17 inject_companion_sensor_ids,
18 platform_schema_extension,
20 CONF_HOME_IO_CONTROL_ID,
21 CONF_STATUS_POLL_INTERVAL,
24DEPENDENCIES = [
"home_io_control"]
26IOHomeClimate = home_io_control_ns.class_(
"IOHomeClimate", climate.Climate, cg.Component)
30 return inject_companion_sensor_ids(config, CONF_ID)
37 if CONF_STATUS_POLL_INTERVAL
in config:
39 "status_poll_interval is not supported for the climate platform: IO-Homecontrol "
40 "heating is write-only and never polls",
41 path=[CONF_STATUS_POLL_INTERVAL],
46CONFIG_SCHEMA = cv.All(
47 climate.climate_schema(IOHomeClimate)
48 .extend(platform_schema_extension())
49 .extend(cv.COMPONENT_SCHEMA),
50 _reject_status_poll_interval,
51 _inject_companion_ids,
56 var = cg.new_Pvariable(config[CONF_ID])
57 await cg.register_component(var, config)
58 await climate.register_climate(var, config)
60 parent = await cg.get_variable(config[CONF_HOME_IO_CONTROL_ID])
61 await wire_device_binding(var, parent, config)
62 await create_companion_sensors(config, parent)
_inject_companion_ids(config)
_reject_status_poll_interval(config)