mirror of
https://github.com/esphome/esphome.git
synced 2026-05-22 01:42:49 +08:00
[htu21d] Fix set_heater action reading wrong config key (#15378)
This commit is contained in:
@@ -118,6 +118,6 @@ async def set_heater_level_to_code(config, action_id, template_arg, args):
|
||||
async def set_heater_to_code(config, action_id, template_arg, args):
|
||||
var = cg.new_Pvariable(action_id, template_arg)
|
||||
await cg.register_parented(var, config[CONF_ID])
|
||||
status_ = await cg.templatable(config[CONF_LEVEL], args, bool)
|
||||
status_ = await cg.templatable(config[CONF_STATUS], args, bool)
|
||||
cg.add(var.set_status(status_))
|
||||
return var
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
sensor:
|
||||
- platform: htu21d
|
||||
id: htu21d_sensor
|
||||
i2c_id: i2c_bus
|
||||
model: htu21d
|
||||
temperature:
|
||||
@@ -9,3 +10,14 @@ sensor:
|
||||
heater:
|
||||
name: Heater
|
||||
update_interval: 15s
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: "Test HTU21D Actions"
|
||||
on_press:
|
||||
- htu21d.set_heater:
|
||||
id: htu21d_sensor
|
||||
status: true
|
||||
- htu21d.set_heater_level:
|
||||
id: htu21d_sensor
|
||||
level: 5
|
||||
|
||||
Reference in New Issue
Block a user