[Modbus Controller] Fix code generation that was using incorrect int type and failing in some tests.

This commit is contained in:
Tercio Gaudencio Filho 2024-09-12 11:43:46 -03:00
parent 3350bafcb9
commit 06e65a0747
No known key found for this signature in database
GPG key ID: 7218D7B2F57BE9CB

View file

@ -302,17 +302,17 @@ async def to_code(config):
for conf in config.get(CONF_ON_COMMAND_SENT, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(
trigger, [(int, "function_code"), (int, "address")], conf
trigger, [(cg.int_, "function_code"), (cg.int_, "address")], conf
)
for conf in config.get(CONF_ON_ONLINE, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(
trigger, [(int, "function_code"), (int, "address")], conf
trigger, [(cg.int_, "function_code"), (cg.int_, "address")], conf
)
for conf in config.get(CONF_ON_OFFLINE, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(
trigger, [(int, "function_code"), (int, "address")], conf
trigger, [(cg.int_, "function_code"), (cg.int_, "address")], conf
)