Skip to content

Commit ba01fbe

Browse files
Update index.js
1 parent c69cdd8 commit ba01fbe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ function ElecticRimLockAccessory(log, config) {
2424
this.version = require('./package.json').version;
2525
this.lastLockTargetState = 1;
2626

27-
if (!this.pin) throw new Error("You must provide a config value for pin.");
27+
if (!this.name || !this.pin) {
28+
this.log.warn("You must provide a valid config value for name and pin.");
29+
this.disabled = true;
30+
return;
31+
}
2832
if (this.duration == null || this.duration % 1 != 0) this.duration = 500;
2933
this.log("Tiro GPIO version: " + this.version);
3034
this.log("Switch pin: " + this.pin);

0 commit comments

Comments
 (0)