Skip to content

Commit

Permalink
add: configuration via homebridge UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rsporny committed Jul 15, 2021
1 parent f5e572d commit 8f4466a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Radosław Sporny
Copyright (c) 2021 Panda Unit sp. z o.o.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
53 changes: 53 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"pluginAlias": "ElectromagneticLock",
"pluginType": "accessory",
"singular": false,
"headerDisplay": "Homebridge plugin to control electromagnetic lock via Raspberry Pi GPIO pins connected to relay.",
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"description": "accessory name, e.g. Lock"
},
"lockPin": {
"title": "Lock GPIO pin",
"type": "integer",
"required": true,
"description": "pin for unlocking lock (use gpio numbering, not physical)"
},
"doorPin": {
"title": "Door contact sensor GPIO pin",
"type": "integer",
"description": "door contact sensor, ignored when lockWithMemory is set to false"
},
"activeLow": {
"title": "Relay activated by low state?",
"type": "boolean",
"default": true,
"description": "true: relay activated by low state (0), false: relay activated by high state (1), affects lockPin, default: true"
},
"reedSwitchActiveLow": {
"title": "Contact sensor relay activated by low state?",
"type": "boolean",
"default": true,
"description": "true: reed switch activated by low state (0), false: reed switch activated by high state (1), affects doorPin, default: true"
},
"unlockingDuration": {
"title": "Unlocking duration (seconds)",
"type": "integer",
"default": 2,
"description": "how long lockPin should be active (seconds), default: 2"
},
"lockWithMemory": {
"title": "Lock with memory?",
"type": "boolean",
"default": true,
"description": "true: electromagnetic lock that stays unlocked until full door cycle, false: stays unlocked only for unlockingDuration seconds, default: true"
}
}
}
}

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ function ElectromagneticLockAccessory(log, config) {

this.infoService = new Service.AccessoryInformation();
this.infoService
.setCharacteristic(Characteristic.Manufacturer, 'Radoslaw Sporny')
.setCharacteristic(Characteristic.Manufacturer, 'Panda Unit')
.setCharacteristic(Characteristic.Model, 'RaspberryPi GPIO Electromagnetic Lock')
.setCharacteristic(Characteristic.SerialNumber, 'Version 1.1.0');
.setCharacteristic(Characteristic.SerialNumber, 'Version 1.1.1');

this.unlockTimeout;

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-gpio-electromagnetic-lock",
"version": "1.1.0",
"version": "1.1.1",
"description": "Homebridge plugin to control electromagnetic lock via Raspberry Pi GPIO pins",
"license": "MIT",
"keywords": [
Expand All @@ -15,7 +15,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/rsporny/homebridge-gpio-electromagnetic-lock"
"url": "https://github.com/pandaunit/homebridge-gpio-electromagnetic-lock"
},
"dependencies": {
"rpio": "^2.2.0",
Expand All @@ -27,7 +27,7 @@
},
"maintainers": [
{
"name": "rsporny",
"name": "pandaunit",
"email": "[email protected]"
}
]
Expand Down

0 comments on commit 8f4466a

Please sign in to comment.