[codegen] Fix templatable int type to use cg.int_ (#15571)

This commit is contained in:
J. Nick Koston
2026-04-08 09:37:11 -10:00
committed by GitHub
parent 7de060ed55
commit 019d415bbd
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -179,7 +179,7 @@ async def at581x_settings_to_code(config, action_id, template_arg, args):
cg.add(var.set_frequency(template_))
if (sens_dist := config.get(CONF_SENSING_DISTANCE)) is not None:
template_ = await cg.templatable(sens_dist, args, int)
template_ = await cg.templatable(sens_dist, args, cg.int_)
cg.add(var.set_sensing_distance(template_))
if selfcheck := config.get(CONF_POWERON_SELFCHECK_TIME):
@@ -199,7 +199,7 @@ async def at581x_settings_to_code(config, action_id, template_arg, args):
cg.add(var.set_trigger_keep(template_))
if (stage_gain := config.get(CONF_STAGE_GAIN)) is not None:
template_ = await cg.templatable(stage_gain, args, int)
template_ = await cg.templatable(stage_gain, args, cg.int_)
cg.add(var.set_stage_gain(template_))
if power := config.get(CONF_POWER_CONSUMPTION):
+2 -2
View File
@@ -202,7 +202,7 @@ async def ezo_pmp_dose_volume_over_time_to_code(config, action_id, template_arg,
template_ = await cg.templatable(config[CONF_VOLUME], args, cg.double)
cg.add(var.set_volume(template_))
template_ = await cg.templatable(config[CONF_DURATION], args, int)
template_ = await cg.templatable(config[CONF_DURATION], args, cg.int_)
cg.add(var.set_duration(template_))
return var
@@ -236,7 +236,7 @@ async def ezo_pmp_dose_with_constant_flow_rate_to_code(
template_ = await cg.templatable(config[CONF_VOLUME_PER_MINUTE], args, cg.double)
cg.add(var.set_volume(template_))
template_ = await cg.templatable(config[CONF_DURATION], args, int)
template_ = await cg.templatable(config[CONF_DURATION], args, cg.int_)
cg.add(var.set_duration(template_))
return var
+1 -1
View File
@@ -348,7 +348,7 @@ async def fan_turn_on_to_code(config, action_id, template_arg, args):
template_ = await cg.templatable(oscillating, args, bool)
cg.add(var.set_oscillating(template_))
if (speed := config.get(CONF_SPEED)) is not None:
template_ = await cg.templatable(speed, args, int)
template_ = await cg.templatable(speed, args, cg.int_)
cg.add(var.set_speed(template_))
if (direction := config.get(CONF_DIRECTION)) is not None:
template_ = await cg.templatable(direction, args, FanDirection)
+1 -1
View File
@@ -137,6 +137,6 @@ PMWCS3_NEW_I2C_ADDRESS_SCHEMA = cv.maybe_simple_value(
async def pmwcs3newi2caddress_to_code(config, action_id, template_arg, args):
parent = await cg.get_variable(config[CONF_ID])
var = cg.new_Pvariable(action_id, template_arg, parent)
address = await cg.templatable(config[CONF_ADDRESS], args, int)
address = await cg.templatable(config[CONF_ADDRESS], args, cg.int_)
cg.add(var.set_new_address(address))
return var