Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modbus Controller] Added on_online and on_offline automation #7417

Merged
merged 10 commits into from
Nov 12, 2024
Prev Previous commit
Next Next commit
[Modbus Controller] Fix code generation that was using incorrect int …
…type and failing in some tests.
  • Loading branch information
0x3333 committed Sep 12, 2024
commit 06e65a0747539f2e00768393f71085ff39a2e840
6 changes: 3 additions & 3 deletions esphome/components/modbus_controller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down