diff --git a/src/components/lights/effects/EffectControllerButtonDialog.vue b/src/components/lights/effects/EffectControllerButtonDialog.vue index 61816ed..ef038ce 100644 --- a/src/components/lights/effects/EffectControllerButtonDialog.vue +++ b/src/components/lights/effects/EffectControllerButtonDialog.vue @@ -54,6 +54,14 @@ @input-valid="(v) => (propertiesValid = v)" @update:model-value="(p) => (properties = p)" /> + + + + + + diff --git a/src/stores/effects-controller.store.ts b/src/stores/effects-controller.store.ts index 2f0575e..1095f71 100644 --- a/src/stores/effects-controller.store.ts +++ b/src/stores/effects-controller.store.ts @@ -125,9 +125,14 @@ export const useEffectsControllerStore = defineStore('effectsController', { }), ); }, - async disableLightsColors() { + /** + * Remove all color effects from the given fixtures. + * Uses "selectedLightsGroupIds if none given" + */ + async disableLightsColors(lightGroupIds?: number[]) { + const ids = lightGroupIds ?? this.selectedLightsGroupIds; await Promise.all( - this.selectedLightsGroupIds.map((id) => { + ids.map((id) => { return applyLightsEffectColor({ body: [], path: { id }, @@ -135,9 +140,14 @@ export const useEffectsControllerStore = defineStore('effectsController', { }), ); }, - async disableLightsMovement() { + /** + * Remove all movement effects from the given fixtures. + * Uses "selectedLightsGroupIds if none given" + */ + async disableLightsMovement(lightGroupIds?: number[]) { + const ids = lightGroupIds ?? this.selectedLightsGroupIds; await Promise.all( - this.selectedLightsGroupIds.map((id) => { + ids.map((id) => { return applyLightsEffectMovement({ body: [], path: { id }, @@ -241,6 +251,13 @@ export const useEffectsControllerStore = defineStore('effectsController', { this.setMovementEffect(button.properties.effectProps, button.properties.lightsGroupIds); return; } + case 'LightsButtonReset': { + await Promise.all([ + this.disableLightsColors(button.properties.lightsGroupIds), + this.disableLightsMovement(button.properties.lightsGroupIds), + ]); + return; + } case 'LightsButtonStrobe': { await this.enableStrobe(button.properties.lightsGroupIds); return;