Update "Set brightness" action (#28)
This commit is contained in:
parent
9c27320ed8
commit
91e1a6bfe4
6 changed files with 8 additions and 2 deletions
Binary file not shown.
|
After Width: | Height: | Size: 224 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 224 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
import streamDeck, { action, DidReceiveSettingsEvent, WillAppearEvent, KeyDownEvent, SingletonAction } from "@elgato/streamdeck";
|
import streamDeck, { action, DidReceiveSettingsEvent, WillAppearEvent, KeyDownEvent, PropertyInspectorDidAppearEvent, SingletonAction } from "@elgato/streamdeck";
|
||||||
|
|
||||||
@action({ UUID: "org.igox.busylight.brigthness.set" })
|
@action({ UUID: "org.igox.busylight.brigthness.set" })
|
||||||
export class SetBrightness extends SingletonAction<BrightnessSettings> {
|
export class SetBrightness extends SingletonAction<BrightnessSettings> {
|
||||||
|
|
@ -25,7 +25,13 @@ export class SetBrightness extends SingletonAction<BrightnessSettings> {
|
||||||
|
|
||||||
const { settings } = ev.payload;
|
const { settings } = ev.payload;
|
||||||
await ev.action.setSettings(settings);
|
await ev.action.setSettings(settings);
|
||||||
await ev.action.setTitle(`${settings.brightness} %`);
|
await ev.action.setTitle(`${settings.brightness}%`);
|
||||||
|
}
|
||||||
|
|
||||||
|
override async onPropertyInspectorDidAppear(ev: PropertyInspectorDidAppearEvent<BrightnessSettings>): Promise<void> {
|
||||||
|
streamDeck.logger.debug(`>>> Received onPropertyInspectorDidAppear. Setting action icon <<<`);
|
||||||
|
|
||||||
|
await ev.action.setImage(`imgs/actions/buttons/brigthness/brigthness.png`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue