Skip to content

Commit 1d3f1bd

Browse files
committed
2 parents 4c71191 + a6c23e2 commit 1d3f1bd

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "gomod"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"

examples/client/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ func main() {
6161

6262
myButton.SetText("Bye!")
6363
cButton.SetColour(color.RGBA{0, 255, 255, 255})
64+
sd.UnsetDecorator(19)
6465
}

streamdeck.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ func (sd *StreamDeck) SetDecorator(btnIndex int, d ButtonDecorator) {
7070
}
7171
}
7272

73+
// UnsetDecorator removes a ButtonDecorator from a given button
74+
func (sd *StreamDeck) UnsetDecorator(btnIndex int) {
75+
delete(sd.decorators, btnIndex)
76+
// If there's a button there, update it
77+
btn, ok := sd.buttons[btnIndex]
78+
if ok {
79+
sd.updateButton(btn)
80+
}
81+
}
82+
7383
// ButtonUpdateHandler allows a user of this library to signal when something external has changed, such that this button should be update
7484
func (sd *StreamDeck) ButtonUpdateHandler(b Button) {
7585
sd.buttons[b.GetButtonIndex()] = b

0 commit comments

Comments
 (0)