This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script detects printing start and stop events based on power consumption. | |
// When the stop event is detected, it waits for 15 minutes to enable printer to cool down and shutdown event is triggered. | |
let CONFIG = { | |
cooldownDelay: 15 * 60 * 1000, // 15 minutes | |
idlePowerMax: 12, // 12 Watts (in reality 7-8W) | |
}; | |
let cooldownTimer = null; | |
let printingStarted = false; |
OlderNewer