mirror of
https://github.com/koush/scrypted.git
synced 2026-05-02 20:50:26 +01:00
29 lines
674 B
Vue
29 lines
674 B
Vue
<template>
|
|
<v-slider class="mx-5" thumb-label="always" v-model="lazyValue.brightness" @change="onChange"
|
|
|
|
append-icon="brightness_high"
|
|
prepend-icon="brightness_low"
|
|
></v-slider>
|
|
</template>
|
|
|
|
<script>
|
|
import RPCInterface from "./RPCInterface.vue";
|
|
import throttle from "lodash/throttle";
|
|
|
|
export default {
|
|
mixins: [RPCInterface],
|
|
methods: {
|
|
debounceSetBrightness: throttle(function() {
|
|
this.rpc().setBrightness(this.lazyValue.brightness);
|
|
}, 500),
|
|
onChange() {
|
|
if (this.device) {
|
|
this.debounceSetBrightness();
|
|
return;
|
|
}
|
|
this.rpc().setBrightness(this.lazyValue.brightness);
|
|
}
|
|
}
|
|
};
|
|
</script>
|