Skip to content

Fix/clear motion state from status request#683

Open
mnaggatz wants to merge 4 commits intoJulius2342:masterfrom
mnaggatz:fix/clear-motion-state-from-status-request
Open

Fix/clear motion state from status request#683
mnaggatz wants to merge 4 commits intoJulius2342:masterfrom
mnaggatz:fix/clear-motion-state-from-status-request

Conversation

@mnaggatz
Copy link
Copy Markdown
Contributor

@mnaggatz mnaggatz commented May 9, 2026

Fixes #682

Depends on #680

This PR builds on the status request OpeningDevice position update from #680. Please review/merge that PR first; after it lands, this branch can be rebased onto master so the diff only contains the motion-state cleanup.

During live testing with a Somfy roller shutter, the KLF200 sent a complete movement sequence for opening and closing. The final successful sequence included:

GW_COMMAND_RUN_STATUS_NTF: run_status=EXECUTION_COMPLETED
GW_SESSION_FINISHED_NTF
GW_NODE_STATE_POSITION_CHANGED_NTF: current_position=0 %, target=0 %, state=DONE

pyvlx currently clears is_opening / is_closing when the final GW_NODE_STATE_POSITION_CHANGED_NTF is processed. If that final DONE state frame is missed or delayed, Home Assistant can keep showing the cover as opening / closing even though the physical movement has already completed.

The heartbeat/status request path can later report the concrete final MP position together with run_status=EXECUTION_COMPLETED. With the preceding status request position update, pyvlx already uses that MP value to recover the position. This PR also clears stale motion state from that completed status request.

Changes:

  • When a generic OpeningDevice receives a concrete NodeParameter(0) / MP value from FrameStatusRequestNotification
  • and the notification has run_status == RunStatus.EXECUTION_COMPLETED
  • clear is_opening / is_closing
  • clear state_received_at / estimated_completion
  • keep motion state unchanged for RunStatus.EXECUTION_ACTIVE

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/pyvlx
  node_updater.py
Project Total  

This report was generated by python-coverage-comment-action

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.

RollerShutter can remain opening/closing if final DONE state frame is missed

1 participant