Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
remotebuzzer: add debounce time to admin panel now linted
Browse files Browse the repository at this point in the history
  • Loading branch information
jacques42 committed Aug 16, 2021
1 parent e8215cc commit 38a21dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,8 @@
'range_max' => 100,
'range_step' => 5,
'unit' => 'milliseconds',
],
'remotebuzzer_logfile' => [
],
'remotebuzzer_logfile' => [
'view' => 'expert',
'type' => 'hidden',
'name' => 'remotebuzzer[logfile]',
Expand Down
20 changes: 15 additions & 5 deletions src/js/remotebuzzer_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,9 @@ if (config.remotebuzzer.userotary) {
log('ROTARY support active');
const rotaryClk = new Gpio(config.remotebuzzer.rotaryclkgpio, 'in', 'both');
const rotaryDt = new Gpio(config.remotebuzzer.rotarydtgpio, 'in', 'both');
const rotaryBtn = new Gpio(config.remotebuzzer.rotarybtngpio, 'in', 'both', {debounceTimeout: config.remotebuzzer.debounce});
const rotaryBtn = new Gpio(config.remotebuzzer.rotarybtngpio, 'in', 'both', {
debounceTimeout: config.remotebuzzer.debounce
});

rotaryClkPin = 0;
rotaryDtPin = 0;
Expand All @@ -535,7 +537,9 @@ if (config.remotebuzzer.userotary) {
if (config.remotebuzzer.usebuttons) {
log('BUTTON support active');
if (config.remotebuzzer.picturebutton) {
const pictureButton = new Gpio(config.remotebuzzer.picturegpio, 'in', 'both', {debounceTimeout: config.remotebuzzer.debounce});
const pictureButton = new Gpio(config.remotebuzzer.picturegpio, 'in', 'both', {
debounceTimeout: config.remotebuzzer.debounce
});

if (!config.remotebuzzer.collagebutton && config.collage.enabled) {
pictureButton.watch(watchPictureGPIOwithCollage);
Expand All @@ -549,21 +553,27 @@ if (config.remotebuzzer.usebuttons) {

/* COLLAGE BUTTON */
if (config.remotebuzzer.collagebutton && config.collage.enabled) {
const collageButton = new Gpio(config.remotebuzzer.collagegpio, 'in', 'both', {debounceTimeout: config.remotebuzzer.debounce});
const collageButton = new Gpio(config.remotebuzzer.collagegpio, 'in', 'both', {
debounceTimeout: config.remotebuzzer.debounce
});
collageButton.watch(watchCollageGPIO);
log('Looking for Collage Button on Raspberry GPIO', config.remotebuzzer.collagegpio);
}

/* SHUTDOWN BUTTON */
if (config.remotebuzzer.shutdownbutton) {
const shutdownButton = new Gpio(config.remotebuzzer.shutdowngpio, 'in', 'both', {debounceTimeout: config.remotebuzzer.debounce});
const shutdownButton = new Gpio(config.remotebuzzer.shutdowngpio, 'in', 'both', {
debounceTimeout: config.remotebuzzer.debounce
});
shutdownButton.watch(watchShutdownGPIO);
log('Looking for Shutdown Button on Raspberry GPIO', config.remotebuzzer.shutdowngpio);
}

/* PRINT BUTTON */
if (config.remotebuzzer.printbutton) {
const printButton = new Gpio(config.remotebuzzer.printgpio, 'in', 'both', {debounceTimeout: config.remotebuzzer.debounce});
const printButton = new Gpio(config.remotebuzzer.printgpio, 'in', 'both', {
debounceTimeout: config.remotebuzzer.debounce
});
printButton.watch(watchPrintGPIO);
log('Looking for Print Button on Raspberry GPIO', config.remotebuzzer.printgpio);
}
Expand Down

0 comments on commit 38a21dc

Please sign in to comment.