mirror of
https://github.com/esphome/esphome.git
synced 2024-12-11 16:04:54 +01:00
Update sensor.py
This commit is contained in:
parent
b7a7dcc4dc
commit
fb046fd9d1
1 changed files with 7 additions and 6 deletions
|
@ -42,6 +42,7 @@ CONFIG_SCHEMA = (
|
|||
.extend(i2c.i2c_device_schema(0x40))
|
||||
)
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
await cg.register_component(var, config)
|
||||
|
@ -55,9 +56,9 @@ async def to_code(config):
|
|||
sens = await sensor.new_sensor(config[CONF_HUMIDITY])
|
||||
cg.add(var.set_humidity(sens))
|
||||
|
||||
#if CONF_HEATER in config:
|
||||
# conf = config[CONF_HEATER]
|
||||
# if not conf:
|
||||
# cg.add(var.set_heater(0, 0))
|
||||
# else:
|
||||
# cg.add(var.set_heater(conf[CONF_TEMPERATURE], conf[CONF_DURATION]))
|
||||
# if CONF_HEATER in config:
|
||||
# conf = config[CONF_HEATER]
|
||||
# if not conf:
|
||||
# cg.add(var.set_heater(0, 0))
|
||||
# else:
|
||||
# cg.add(var.set_heater(conf[CONF_TEMPERATURE], conf[CONF_DURATION]))
|
Loading…
Reference in a new issue