mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-03 03:18:28 +02:00
Climate whirlpool (#1029)
* wip * transmitter ready * climate.whirlpool receiver implemented (#971) * receiver implemented * Support for two models of temp ranges * temperature type and lint * more lint Co-authored-by: Guillermo Ruffino <glm.net@gmail.com> * add test * not mess line endings Co-authored-by: mmanza <40872469+mmanza@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d447548893
commit
8040e3cf95
@@ -0,0 +1,26 @@
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.components import climate_ir
|
||||
from esphome.const import CONF_ID, CONF_MODEL
|
||||
|
||||
AUTO_LOAD = ['climate_ir']
|
||||
|
||||
whirlpool_ns = cg.esphome_ns.namespace('whirlpool')
|
||||
WhirlpoolClimate = whirlpool_ns.class_('WhirlpoolClimate', climate_ir.ClimateIR)
|
||||
|
||||
Model = whirlpool_ns.enum('Model')
|
||||
MODELS = {
|
||||
'DG11J1-3A': Model.MODEL_DG11J1_3A,
|
||||
'DG11J1-91': Model.MODEL_DG11J1_91,
|
||||
}
|
||||
|
||||
CONFIG_SCHEMA = climate_ir.CLIMATE_IR_WITH_RECEIVER_SCHEMA.extend({
|
||||
cv.GenerateID(): cv.declare_id(WhirlpoolClimate),
|
||||
cv.Optional(CONF_MODEL, default='DG11J1-3A'): cv.enum(MODELS, upper=True)
|
||||
})
|
||||
|
||||
|
||||
def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
yield climate_ir.register_climate_ir(var, config)
|
||||
cg.add(var.set_model(config[CONF_MODEL]))
|
||||
Reference in New Issue
Block a user