Skip to content

Commit

Permalink
fix: streamdeck plus lcd strip not blanking
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Oct 30, 2023
1 parent f2d98b3 commit ed56920
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/device-types/streamdeck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class StreamDeckWrapper implements WrappedDevice {
#queueOutputId: number
#queue: ImageWriteQueue | undefined
#queueLcdStrip: ImageWriteQueue | undefined
#hasDrawnLcdStrip = false

#companionSupportsScaling = false

Expand Down Expand Up @@ -83,6 +84,8 @@ export class StreamDeckWrapper implements WrappedDevice {

// Check if generated image is still valid
if (this.#queueOutputId === outputId) {
this.#hasDrawnLcdStrip = true

try {
await this.#deck.fillLcdRegion(key * encoderSize.width + xPad, 0, newbuffer, {
format: 'rgb',
Expand Down Expand Up @@ -208,6 +211,12 @@ export class StreamDeckWrapper implements WrappedDevice {
.generateBasicCard(width, height, imageRs.PixelFormat.Rgba, hostname, status)
.then(async (buffer) => {
if (outputId === this.#queueOutputId) {
if (this.#hasDrawnLcdStrip) {
// Blank everything first, to ensure the strip is cleared
this.#hasDrawnLcdStrip = false
await this.#deck.clearPanel()
}

// still valid
await this.#deck.fillPanelBuffer(buffer, {
format: 'rgba',
Expand Down

0 comments on commit ed56920

Please sign in to comment.