Fix indentation of write_lambda for modbus_controller number (#2722)

This commit is contained in:
Jesse Hills 2021-11-15 10:59:48 +13:00
parent c2f57baec2
commit fea3c48098
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -129,14 +129,14 @@ async def to_code(config):
return_type=cg.optional.template(float), return_type=cg.optional.template(float),
) )
cg.add(var.set_template(template_)) cg.add(var.set_template(template_))
if CONF_WRITE_LAMBDA in config: if CONF_WRITE_LAMBDA in config:
template_ = await cg.process_lambda( template_ = await cg.process_lambda(
config[CONF_WRITE_LAMBDA], config[CONF_WRITE_LAMBDA],
[ [
(ModbusNumber.operator("ptr"), "item"), (ModbusNumber.operator("ptr"), "item"),
(cg.float_, "x"), (cg.float_, "x"),
(cg.std_vector.template(cg.uint16).operator("ref"), "payload"), (cg.std_vector.template(cg.uint16).operator("ref"), "payload"),
], ],
return_type=cg.optional.template(float), return_type=cg.optional.template(float),
) )
cg.add(var.set_write_template(template_)) cg.add(var.set_write_template(template_))