Update sensor.py

This commit is contained in:
optimusprimespace 2024-05-03 16:13:12 -04:00
parent b7a7dcc4dc
commit fb046fd9d1

View file

@ -42,6 +42,7 @@ CONFIG_SCHEMA = (
.extend(i2c.i2c_device_schema(0x40)) .extend(i2c.i2c_device_schema(0x40))
) )
async def to_code(config): async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config) await cg.register_component(var, config)
@ -55,9 +56,9 @@ async def to_code(config):
sens = await sensor.new_sensor(config[CONF_HUMIDITY]) sens = await sensor.new_sensor(config[CONF_HUMIDITY])
cg.add(var.set_humidity(sens)) cg.add(var.set_humidity(sens))
#if CONF_HEATER in config: # if CONF_HEATER in config:
# conf = config[CONF_HEATER] # conf = config[CONF_HEATER]
# if not conf: # if not conf:
# cg.add(var.set_heater(0, 0)) # cg.add(var.set_heater(0, 0))
# else: # else:
# cg.add(var.set_heater(conf[CONF_TEMPERATURE], conf[CONF_DURATION])) # cg.add(var.set_heater(conf[CONF_TEMPERATURE], conf[CONF_DURATION]))