Skip to content

Commit

Permalink
chore: fix studio examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 9, 2024
1 parent 6240d88 commit 87f52b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/node/examples/streamdeck-studio.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ function generateEncoderColor(value, max) {
.catch((e) => console.error('Fill failed:', e))
}

const firstButton = streamDeck.CONTROLS.find((control) => control.type === 'button')
const img = await sharp(path.resolve(__dirname, 'fixtures/github_logo.png'))
.flatten()
.resize(streamDeck.BUTTON_WIDTH_PX, streamDeck.BUTTON_HEIGHT_PX)
.resize(firstButton.pixelSize.width, firstButton.pixelSize.height)
.raw()
.toBuffer()

Expand Down
5 changes: 3 additions & 2 deletions packages/tcp/examples/streamdeck-tcp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ connectionManager.on('connected', async (streamDeck) => {
console.log('all versions', versions)
})

const firstButton = streamDeck.CONTROLS.find((control) => control.type === 'button')
const img = await sharp(path.resolve('fixtures/github_logo.png'))
.flatten()
.resize(streamDeck.BUTTON_WIDTH_PX, streamDeck.BUTTON_HEIGHT_PX)
.resize(firstButton.pixelSize.width, firstButton.pixelSize.height)
.raw()
.toBuffer()

Expand All @@ -54,7 +55,7 @@ connectionManager.on('connected', async (streamDeck) => {

if (fullImg) {
console.log('send fill')
streamDeck.fillPanelBuffer(fullImg).catch((e) => console.log('fullImg failed', e))
// streamDeck.fillPanelBuffer(fullImg).catch((e) => console.log('fullImg failed', e))

console.log('post send fill')
}
Expand Down

0 comments on commit 87f52b1

Please sign in to comment.