Skip to content

Commit

Permalink
correct debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsounet committed Feb 6, 2024
1 parent 09d3817 commit f8fc5b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/pirLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ const Gpio = require("onoff").Gpio
class PIR {
constructor(config, callback) {
this.config = config
if (this.config.debug) log = (...args) => { console.log("[MMM-Pir] [LIB] [PIR]", ...args) }
this.callback = callback
this.default = {
debug: this.config.debug,
debug: false,
gpio: 21,
reverseValue: false
}
this.config = Object.assign({}, this.default, this.config)
if (this.config.debug) log = (...args) => { console.log("[MMM-Pir] [LIB] [PIR]", ...args) }
this.pir = null
this.running = false
}
Expand Down
5 changes: 3 additions & 2 deletions components/screenLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class SCREEN {
constructor(config, callback) {
this.config = config
this.sendSocketNotification = callback
if (this.config.debug) log = (...args) => { console.log("[MMM-Pir] [LIB] [SCREEN]", ...args) }
this.PathScript = path.dirname(require.resolve('../package.json'))+"/scripts"
this.interval = null
this.default = {
debug: false,
delay: 5 * 60 * 1000,
mode: 1,
gpio: 20,
Expand All @@ -25,7 +25,8 @@ class SCREEN {
wrandrForceRotation: "normal",
wrandrForceMode: null
}
this.config = Object.assign(this.default, this.config)
this.config = Object.assign({}, this.default, this.config)
if (this.config.debug) log = (...args) => { console.log("[MMM-Pir] [LIB] [SCREEN]", ...args) }
this.screen = {
mode: this.config.mode,
running: false,
Expand Down

0 comments on commit f8fc5b1

Please sign in to comment.