Skip to content

fix: execute script mode IF and Python helpers - #51

Open
kocaemre wants to merge 1 commit into
OpenGrow-Box:mainfrom
kocaemre:fix/script-mode-if-call
Open

fix: execute script mode IF and Python helpers#51
kocaemre wants to merge 1 commit into
OpenGrow-Box:mainfrom
kocaemre:fix/script-mode-if-call

Conversation

@kocaemre

Copy link
Copy Markdown

Summary

  • Remove the duplicate stub _dsl_if implementation so DSL IF blocks use the existing block-aware control-flow handler.
  • Skip false DSL branches to the first statement after ELSE, and skip ELSE bodies after a true branch.
  • Queue and await Python-mode CALL/EMIT helper tasks so plain scripts like CALL(...) and EMIT(...) actually execute.
  • Add regression coverage for DSL IF/ELSE, Python CALL, and Python EMIT.

Fixes #50.

Test plan

  • Confirmed new regression tests failed before the implementation:
    • test_dsl_if_false_skips_to_else_branch
    • test_python_call_helper_executes_device_action
    • test_python_emit_helper_executes_event
  • python3 -m pytest tests/logic/modes/test_script_mode_logic.py -q — 6 passed
  • python3 -m pytest tests/logic/modes -q — 76 passed, 4 existing warnings
  • python3 -m pytest tests/logic -q — 563 passed, 1 skipped, 20 existing warnings
  • python3 -m py_compile custom_components/opengrowbox/OGBController/managers/OGBScriptMode.py tests/logic/modes/test_script_mode_logic.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Script Mode: DSL IF is broken, and Python CALL/EMIT never actually execute

1 participant