From 7045251e1b48c2823b4d1eba75f8d3c01a24afba Mon Sep 17 00:00:00 2001 From: Austen Dicken Date: Tue, 11 Jun 2024 22:58:44 -0500 Subject: [PATCH] Encoder layout support --- src/components/PiComponent.vue | 58 +++++++++------- src/components/PluginComponent.vue | 41 ++++++++--- src/modules/common/settings.js | 9 +++ src/modules/common/streamdeck.js | 10 +++ src/modules/plugin/entityConfigFactory.js | 83 ++++++++++++++++++++++- src/modules/plugin/svgUtils.js | 16 +++++ 6 files changed, 184 insertions(+), 33 deletions(-) diff --git a/src/components/PiComponent.vue b/src/components/PiComponent.vue index cab5cfd..597e441 100644 --- a/src/components/PiComponent.vue +++ b/src/components/PiComponent.vue @@ -46,6 +46,13 @@ + +
@@ -67,32 +74,34 @@
-
- - -
+

{{ controllerType }} actions

@@ -201,6 +210,7 @@ const rotationTickBucketSizeMs = ref(300) const useCustomTitle = ref(false) const buttonTitle = ref("{{friendly_name}}") +const useEncoderLayout = ref(false) const useStateImagesForOnOffStates = ref(false) // determined by action ID (manifest) const useCustomButtonLabels = ref(false) const buttonLabels = ref("") @@ -247,6 +257,7 @@ onMounted(() => { hideIcon.value = settings["display"]["hideIcon"]; useCustomTitle.value = settings["display"]["useCustomTitle"] buttonTitle.value = settings["display"]["buttonTitle"] || "{{friendly_name}}" + useEncoderLayout.value = settings["display"]["useEncoderLayout"] useCustomButtonLabels.value = settings["display"]["useCustomButtonLabels"] buttonLabels.value = settings["display"]["buttonLabels"] serviceShortPress.value = settings["button"]["serviceShortPress"] @@ -340,13 +351,14 @@ function saveGlobalSettings() { function saveSettings() { let settings = { - version: 4, + version: 5, controllerType: controllerType.value, display: { entityId: entity.value, useCustomTitle: useCustomTitle.value, + useEncoderLayout: useEncoderLayout.value, buttonTitle: buttonTitle.value, enableServiceIndicator: enableServiceIndicator.value, hideIcon: hideIcon.value, diff --git a/src/components/PluginComponent.vue b/src/components/PluginComponent.vue index 093d419..18c57c2 100644 --- a/src/components/PluginComponent.vue +++ b/src/components/PluginComponent.vue @@ -5,6 +5,7 @@