{{ message }}
fix: wrap replacement deck in BetterDeck on resume from sleep#565
Merged
Core447 merged 1 commit intoMar 5, 2026
Merged
Conversation
On resume from suspend, on_resumed() called get_device_by_serial() which returns a raw StreamDeck SDK device, then assigned it directly to deck_controller.deck. This replaced the BetterDeck wrapper (which provides get_rotation() and key-index remapping) with the raw device. The subsequent update_all_inputs() call crashed immediately with: AttributeError: 'StreamDeckOriginalV2' has no attribute 'get_rotation' Fix: preserve the existing rotation from the old BetterDeck, then wrap the new raw device in a fresh BetterDeck before assigning it. Fixes StreamController#464
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes #464 — StreamController becomes non-functional after the laptop resumes from sleep, requiring a manual app restart.
Root cause:
DeckControllerstores its device as aBetterDeckwrapper (defined inBetterDeck.py).BetterDeckprovidesget_rotation()and transparent key-index remapping for rotated decks.On resume,
on_resumed()callsget_device_by_serial()which returns a rawStreamDeckSDK device (not aBetterDeck), then assigns it directly:update_all_inputs()callsself.deck_controller.deck.get_rotation()at line 1980/1982 ofDeckController.py, which fails because the raw SDK object doesn't have that method:Fix:
Preserve the existing rotation from the old
BetterDeck, then wrap the new raw device in a freshBetterDeckbefore assigning it — exactly asDeckController.__init__does on first load:BetterDeckis already imported inDeckManager.py.Test plan