mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 07:58:09 +01:00
Update __init__.py
This commit is contained in:
parent
12dc2ca591
commit
9f58bcf298
1 changed files with 6 additions and 6 deletions
|
@ -237,14 +237,14 @@ async def to_code(config):
|
|||
cg.add(var.set_enable_rssi(config[CONF_ENABLE_RSSI]))
|
||||
for sens_conf in config.get(CONF_SENSORS, ()):
|
||||
sens_id = sens_conf[CONF_ID]
|
||||
sensor = await cg.get_variable(sens_id)
|
||||
sensor_device = await cg.get_variable(sens_id)
|
||||
bcst_id = sens_conf.get(CONF_BROADCAST_ID, sens_id.id)
|
||||
cg.add(var.add_sensor(bcst_id, sensor))
|
||||
cg.add(var.add_sensor(bcst_id, sensor_device))
|
||||
for sens_conf in config.get(CONF_BINARY_SENSORS, ()):
|
||||
sens_id = sens_conf[CONF_ID]
|
||||
sensor = await cg.get_variable(sens_id)
|
||||
sensor_device = await cg.get_variable(sens_id)
|
||||
bcst_id = sens_conf.get(CONF_BROADCAST_ID, sens_id.id)
|
||||
cg.add(var.add_binary_sensor(bcst_id, sensor))
|
||||
cg.add(var.add_binary_sensor(bcst_id, sensor_device))
|
||||
if CONF_LORA_RSSI in config:
|
||||
sens = await Sensor.new_sensor(config[CONF_LORA_RSSI])
|
||||
cg.add(var.set_rssi_sensor(sens))
|
||||
sensor_device = await sensor.new_sensor(config[CONF_LORA_RSSI])
|
||||
cg.add(var.set_rssi_sensor(sensor_device))
|
||||
|
|
Loading…
Reference in a new issue