Skip to content

Fix: use correct method name in on_change_state D-Bus handler#570

Merged
Core447 merged 1 commit into
StreamController:mainfrom
tyvsmith:fix/change-state-method-name
Mar 7, 2026
Merged

Fix: use correct method name in on_change_state D-Bus handler#570
Core447 merged 1 commit into
StreamController:mainfrom
tyvsmith:fix/change-state-method-name

Conversation

@tyvsmith

@tyvsmith tyvsmith commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The --change-state CLI feature (added in #460) calls gl.page_manager.get_best_page_path_match_from_name(), but this method does not exist on PageManagerBackend. The correct method is find_matching_page_path(), which is what on_change_page and the api_page_requests handler already use correctly.

Two call sites are affected:

  • src/app.pyon_change_state D-Bus handler (used when SC is already running)
  • src/backend/DeckManagement/DeckController.pyapi_state_requests handler (used when SC is not running and processes queued requests at startup)

The AttributeError is silently swallowed by GTK's action handler, so --change-state exits successfully but has no effect.

Fixes #571

Fix

Replace get_best_page_path_match_from_name with find_matching_page_path in both call sites.

Testing

Verified on a live StreamController instance (installed via AUR streamcontroller-git):

  • Before fix: streamcontroller --change-state AL08L2C53065 Desktop 4,1 1 exits silently with no effect, no log output
  • After fix: state changes correctly on the physical Stream Deck, log confirms: Successfully changed state of (4,1) to state 1 on device AL08L2C53065

on_change_state in app.py and the api_state_requests handler in
DeckController.py both call get_best_page_path_match_from_name, which
does not exist on PageManagerBackend. The correct method is
find_matching_page_path, matching on_change_page and api_page_requests.

This causes --change-state CLI commands to fail silently (AttributeError
swallowed by GTK's action handler) when SC is running, and crash at
startup when SC is not running.
@tyvsmith tyvsmith force-pushed the fix/change-state-method-name branch from 8ad3c6b to 771c328 Compare March 7, 2026 01:40
@tyvsmith tyvsmith marked this pull request as ready for review March 7, 2026 01:41
Copilot AI review requested due to automatic review settings March 7, 2026 01:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the --change-state CLI path resolution by calling the correct PageManagerBackend method, ensuring state-change requests actually resolve a page and execute instead of failing silently.

Changes:

  • Update on_change_state (D-Bus handler) to use find_matching_page_path().
  • Update queued startup processing (api_state_requests) to use find_matching_page_path().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/app.py Fixes D-Bus on_change_state page lookup to use the existing page-matching API.
src/backend/DeckManagement/DeckController.py Fixes queued state-change request handling at startup to resolve page paths via the correct method.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Core447

Core447 commented Mar 7, 2026

Copy link
Copy Markdown
Member

Thank you!

@Core447 Core447 merged commit a3aa3fd into StreamController:main Mar 7, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Bug: --change-state CLI silently fails (calls non-existent method)

3 participants