garage door added

This commit is contained in:
Chester 2022-03-07 16:44:43 +01:00
parent abe95f516f
commit 77df0609ca
3 changed files with 9 additions and 3 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "homebridge-smarthomeng", "name": "homebridge-smarthomeng",
"version": "2.0.0", "version": "2.0.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "homebridge-smarthomeng", "name": "homebridge-smarthomeng",
"version": "2.0.0", "version": "2.0.4",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"ws": "^8.4.2" "ws": "^8.4.2"

View File

@ -29,7 +29,7 @@ export class Doorbell implements AccessoryPlugin {
.setCharacteristic(this.platform.Characteristic.SerialNumber, accessory.singlepress); .setCharacteristic(this.platform.Characteristic.SerialNumber, accessory.singlepress);
this.platform.shng.addMonitor(accessory.contactstate, this.shngCallback.bind(this)); this.platform.shng.addMonitor(accessory.contactstate, this.shngCallback.bind(this));
this.platform.log.info('ContactSensor', accessory.name, 'created!'); this.platform.log.info('Doorbell', accessory.name, 'created!');
} }
identify(): void { identify(): void {

View File

@ -21,6 +21,7 @@ import { Doorbell } from './Accessories/Doorbell';
import { SecuritySystem } from './Accessories/SecuritySystem'; import { SecuritySystem } from './Accessories/SecuritySystem';
import { OccupancySensor } from './Accessories/OccupancySensor'; import { OccupancySensor } from './Accessories/OccupancySensor';
import { MotionSensor } from './Accessories/MotionSensor'; import { MotionSensor } from './Accessories/MotionSensor';
import { GarageDoor } from './Accessories/GarageDoor';
function uncapitalizeKeys(obj): Record<string, unknown> { function uncapitalizeKeys(obj): Record<string, unknown> {
function isObject(o: unknown): boolean { function isObject(o: unknown): boolean {
@ -146,6 +147,11 @@ export class SmartHomeNGPlatform implements StaticPlatformPlugin {
devices.push(new WindowCovering(this, accessory)); devices.push(new WindowCovering(this, accessory));
break; break;
// GarageDoor
case 'garagedoor':
devices.push(new GarageDoor(this, accessory));
break;
// Show error for (yet ?) unsupported device // Show error for (yet ?) unsupported device
default: default:
this.log.warn('Accessory type', accessory.type, 'for', accessory.name, 'not recognized !'); this.log.warn('Accessory type', accessory.type, 'for', accessory.name, 'not recognized !');