homebridge-august
Advanced tools
Comparing version 0.0.9 to 0.0.10-beta.0
@@ -44,2 +44,121 @@ { | ||
"required": ["augustId", "password", "validateCode", "notice"] | ||
}, | ||
"options": { | ||
"type": "object", | ||
"properties": { | ||
"devices": { | ||
"type": "array", | ||
"items": { | ||
"title": "Devices", | ||
"type": "object", | ||
"properties": { | ||
"lockId": { | ||
"title": "Device ID", | ||
"type": "string", | ||
"placeholder": "TSSQ97FRDMX7TPGU3Z2HWNRDPQXJ9YSM" | ||
}, | ||
"configLockName": { | ||
"title": "Device Name", | ||
"type": "string", | ||
"placeholder": "August", | ||
"condition": { | ||
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].lockId);" | ||
} | ||
}, | ||
"hide_device": { | ||
"title": "Hide Device", | ||
"type": "boolean", | ||
"description": "If true then devices that are reported as offline will be shown as off in HomeKit.", | ||
"condition": { | ||
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].lockId);" | ||
} | ||
}, | ||
"lock": { | ||
"type": "object", | ||
"properties": { | ||
"hide_contactsensor": { | ||
"title": "Hide Lock's Contact Sensor", | ||
"type": "boolean", | ||
"condition": { | ||
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].lockId);" | ||
} | ||
} | ||
} | ||
}, | ||
"firmware": { | ||
"title": "Firmware Override", | ||
"type": "string", | ||
"placeholder": "1.2.8", | ||
"condition": { | ||
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].lockId);" | ||
} | ||
}, | ||
"refreshRate": { | ||
"title": "Device Refresh Rate", | ||
"type": "number", | ||
"minimum": 30, | ||
"placeholder": 360, | ||
"description": "Indicates the number of seconds between polls of August API.", | ||
"condition": { | ||
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].lockId && !model.options.devices[arrayIndices].hide_device);" | ||
} | ||
}, | ||
"logging": { | ||
"title": "Device Logging Override Setting", | ||
"type": "string", | ||
"oneOf": [ | ||
{ | ||
"title": "Standard Logging", | ||
"enum": ["standard"] | ||
}, | ||
{ | ||
"title": "No Logging", | ||
"enum": ["none"] | ||
}, | ||
{ | ||
"title": "Debug Logging", | ||
"enum": ["debug"] | ||
} | ||
], | ||
"condition": { | ||
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].lockId && !model.options.devices[arrayIndices].hide_device);" | ||
} | ||
} | ||
}, | ||
"required": ["lockId", "configLockName", "logging"] | ||
}, | ||
"uniqueItems": true | ||
}, | ||
"refreshRate": { | ||
"title": "Refresh Rate", | ||
"type": "number", | ||
"minimum": 30, | ||
"placeholder": 360, | ||
"description": "Indicates the number of seconds between polls of August API." | ||
}, | ||
"pushRate": { | ||
"title": "Push Rate", | ||
"type": "number", | ||
"placeholder": 1, | ||
"description": "Indicates the number of seconds between pushes to August API." | ||
}, | ||
"logging": { | ||
"title": "Logging Setting", | ||
"type": "string", | ||
"oneOf": [ | ||
{ | ||
"title": "Standard Logging", | ||
"enum": ["standard"] | ||
}, | ||
{ | ||
"title": "No Logging", | ||
"enum": ["none"] | ||
}, | ||
{ | ||
"title": "Debug Logging", | ||
"enum": ["debug"] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
@@ -60,4 +179,30 @@ }, | ||
] | ||
}, | ||
{ | ||
"type": "fieldset", | ||
"title": "Optional August Device Settings", | ||
"expandable": true, | ||
"expanded": false, | ||
"items": [ | ||
{ | ||
"key": "options.devices", | ||
"notitle": false, | ||
"type": "tabarray", | ||
"title": "{{ value.configLockName || value.lockId || 'New Lock Device' }}", | ||
"expandable": true, | ||
"expanded": false, | ||
"orderable": false, | ||
"items": [ | ||
"options.devices[].configLockName", | ||
"options.devices[].lockId", | ||
"options.devices[].hide_device", | ||
"options.devices[].lock.hide_contactsensor", | ||
"options.devices[].firmware", | ||
"options.devices[].refreshRate", | ||
"options.devices[].logging" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'; | ||
import { AugustPlatform } from '../platform'; | ||
import { device } from '../settings'; | ||
import { device, devicesConfig } from '../settings'; | ||
/** | ||
@@ -9,11 +9,23 @@ * Platform Accessory | ||
*/ | ||
export declare class LockManagement { | ||
export declare class LockMechanism { | ||
private readonly platform; | ||
private accessory; | ||
device: device; | ||
service: Service; | ||
device: device & devicesConfig; | ||
lockService: Service; | ||
contactSensorService?: Service; | ||
batteryService: Service; | ||
LockTargetState: CharacteristicValue; | ||
LockCurrentState: CharacteristicValue; | ||
BatteryLevel: CharacteristicValue; | ||
StatusLowBattery: CharacteristicValue; | ||
ContactSensorState: CharacteristicValue; | ||
lockStatus: any; | ||
retryCount: any; | ||
state: any; | ||
locked: any; | ||
unlocked: any; | ||
lockDetails: any; | ||
battery: any; | ||
doorState: any; | ||
currentFirmwareVersion: any; | ||
deviceLogging: string; | ||
@@ -23,3 +35,3 @@ deviceRefreshRate: number; | ||
doLockUpdate: any; | ||
constructor(platform: AugustPlatform, accessory: PlatformAccessory, device: device); | ||
constructor(platform: AugustPlatform, accessory: PlatformAccessory, device: device & devicesConfig); | ||
/** | ||
@@ -42,5 +54,5 @@ * Parse the device status from the August api | ||
setLockTargetState(value: CharacteristicValue): Promise<void>; | ||
config(device: any): Promise<void>; | ||
refreshRate(device: any): Promise<void>; | ||
logs(device: any): Promise<void>; | ||
config(device: device & devicesConfig): Promise<void>; | ||
refreshRate(device: device & devicesConfig): Promise<void>; | ||
logs(device: device & devicesConfig): Promise<void>; | ||
/** | ||
@@ -47,0 +59,0 @@ * Logging for Device |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LockManagement = void 0; | ||
exports.LockMechanism = void 0; | ||
const rxjs_1 = require("rxjs"); | ||
@@ -11,3 +11,3 @@ const operators_1 = require("rxjs/operators"); | ||
*/ | ||
class LockManagement { | ||
class LockMechanism { | ||
constructor(platform, accessory, device) { | ||
@@ -20,2 +20,8 @@ this.platform = platform; | ||
this.config(device); | ||
if (this.LockCurrentState === undefined) { | ||
this.LockCurrentState = this.accessory.context.LockCurrentState | this.platform.Characteristic.LockCurrentState.UNKNOWN; | ||
} | ||
if (this.LockTargetState === undefined) { | ||
this.LockTargetState = this.accessory.context.LockTargetState | this.platform.Characteristic.LockTargetState.UNSECURED; | ||
} | ||
// default placeholders | ||
@@ -34,15 +40,30 @@ // this is subject we use to track when we need to POST changes to the August API | ||
.updateValue(accessory.context.firmwareRevision); | ||
//LockManagement Service | ||
(this.service = | ||
this.accessory.getService(this.platform.Service.LockManagement) || this.accessory.addService(this.platform.Service.LockManagement)), | ||
// Lock Mechanism Service | ||
(this.lockService = | ||
this.accessory.getService(this.platform.Service.LockMechanism) || this.accessory.addService(this.platform.Service.LockMechanism)), | ||
accessory.displayName; | ||
//Service Name | ||
this.service.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName); | ||
// Service Name | ||
this.lockService.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName); | ||
//Required Characteristics" see https://developers.homebridge.io/#/service/LockMechanism | ||
//Initial Device Parse | ||
this.parseStatus(); | ||
this.service.getCharacteristic(this.platform.Characteristic.LockTargetState).onSet(this.setLockTargetState.bind(this)); | ||
this.service.getCharacteristic(this.platform.Characteristic.LockCurrentState).onGet(() => { | ||
return this.LockCurrentState; | ||
}); | ||
// Initial Device Parse | ||
this.refreshStatus(); | ||
// Create handlers for required characteristics | ||
this.lockService.getCharacteristic(this.platform.Characteristic.LockTargetState).onSet(this.setLockTargetState.bind(this)); | ||
// Contact Sensor Service | ||
if (device.LockStatus.doorState) { | ||
this.warnLog(`Lock: ${accessory.displayName} Removing Contact Sensor Service`); | ||
this.contactSensorService = this.accessory.getService(this.platform.Service.ContactSensor); | ||
accessory.removeService(this.contactSensorService); | ||
} | ||
else if (!this.contactSensorService) { | ||
this.warnLog(`Lock: ${accessory.displayName} Add Contact Sensor Service`); | ||
(this.contactSensorService = | ||
this.accessory.getService(this.platform.Service.ContactSensor) || this.accessory.addService(this.platform.Service.ContactSensor)), | ||
`${accessory.displayName} Contact Sensor`; | ||
this.contactSensorService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Contact Sensor`); | ||
} | ||
else { | ||
this.warnLog(`Lock: ${accessory.displayName} Contact Sensor Service Not Added`); | ||
} | ||
// Battery Service | ||
(this.batteryService = | ||
@@ -52,3 +73,2 @@ this.accessory.getService(this.platform.Service.Battery) || this.accessory.addService(this.platform.Service.Battery)), | ||
// Retrieve initial values and updateHomekit | ||
this.refreshStatus(); | ||
this.updateHomeKitCharacteristics(); | ||
@@ -88,12 +108,44 @@ // Start an update interval | ||
async parseStatus() { | ||
/*if (this.lockStatus.retryCount) { | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.JAMMED; | ||
} else if (this.lockStatus.state.locked) { | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.SECURED; | ||
} else if (this.lockStatus.state.unlocked) { | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.UNSECURED; | ||
} else {*/ | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.UNKNOWN; | ||
//} | ||
this.debugLog(`Lock: ${this.accessory.displayName} parseStatus`); | ||
// Lock Mechanism | ||
if (this.retryCount) { | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.JAMMED; | ||
} | ||
else if (this.locked) { | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.SECURED; | ||
} | ||
else if (this.unlocked) { | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.UNSECURED; | ||
} | ||
else { | ||
this.LockCurrentState = this.platform.Characteristic.LockCurrentState.UNKNOWN; | ||
} | ||
// Battery | ||
this.BatteryLevel = Number(this.battery) * 100; | ||
this.batteryService.getCharacteristic(this.platform.Characteristic.BatteryLevel).updateValue(this.BatteryLevel); | ||
if (this.battery < 15) { | ||
this.StatusLowBattery = this.platform.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW; | ||
} | ||
else { | ||
this.StatusLowBattery = this.platform.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL; | ||
} | ||
this.debugLog(`Lock: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel},` + ` StatusLowBattery: ${this.StatusLowBattery}`); | ||
// Contact Sensor | ||
if (this.doorState === 'open') { | ||
this.ContactSensorState = this.platform.Characteristic.ContactSensorState.CONTACT_NOT_DETECTED; | ||
this.debugLog(`Contact Sensor: ${this.accessory.displayName} ContactSensorState: ${this.ContactSensorState}`); | ||
} | ||
else if (this.doorState === 'closed') { | ||
this.ContactSensorState = this.platform.Characteristic.ContactSensorState.CONTACT_DETECTED; | ||
this.debugLog(`Contact Sensor: ${this.accessory.displayName} ContactSensorState: ${this.ContactSensorState}`); | ||
} | ||
else { | ||
this.debugLog(`Contact Sensor: ${this.accessory.displayName} openState: ${this.doorState}`); | ||
} | ||
// Update Firmware | ||
this.accessory | ||
.getService(this.platform.Service.AccessoryInformation) | ||
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.currentFirmwareVersion) | ||
.getCharacteristic(this.platform.Characteristic.FirmwareRevision) | ||
.updateValue(this.currentFirmwareVersion); | ||
} | ||
@@ -106,6 +158,18 @@ /** | ||
const august = this.platform.august; | ||
// Update Lock Status | ||
const lockStatus = await august.status(this.device.lockId); | ||
this.debugLog(JSON.stringify(lockStatus)); | ||
this.lockStatus = lockStatus; | ||
this.debugLog(`Lock: ${this.accessory.displayName} device: ${JSON.stringify(this.device)}`); | ||
this.retryCount = this.lockStatus.retryCount; | ||
this.state = this.lockStatus.state; | ||
this.locked = this.lockStatus.state.locked; | ||
this.unlocked = this.lockStatus.state.unlocked; | ||
this.debugLog(`Lock: ${this.accessory.displayName} lockStatus (refreshStatus): ${JSON.stringify(this.lockStatus)}`); | ||
// Update Lock Details | ||
const lockDetails = await august.details(this.device.lockId); | ||
this.lockDetails = lockDetails; | ||
this.battery = this.lockDetails.battery; | ||
this.doorState = this.lockDetails.doorState; | ||
this.currentFirmwareVersion = this.lockDetails.currentFirmwareVersion; | ||
this.debugLog(`Lock: ${this.accessory.displayName} lockDetails (refreshStatus): ${JSON.stringify(this.lockDetails)}`); | ||
// Update HomeKit | ||
this.parseStatus(); | ||
@@ -123,4 +187,14 @@ this.updateHomeKitCharacteristics(); | ||
try { | ||
// Attempt to make the API request | ||
this.debugLog(`Lock: ${this.accessory.displayName} pushChanges: ${JSON.stringify(this.device)}`); | ||
const august = this.platform.august; | ||
if (this.LockTargetState === this.platform.Characteristic.LockTargetState.UNSECURED) { | ||
const lockStatus = await august.unlock(this.device.lockId); | ||
this.debugLog(`Lock: ${this.accessory.displayName} lockStatus (pushChanges): ${JSON.stringify(lockStatus)}`); | ||
} | ||
else if (this.LockTargetState === this.platform.Characteristic.LockTargetState.SECURED) { | ||
const lockStatus = await august.lock(this.device.lockId); | ||
this.debugLog(`Lock: ${this.accessory.displayName} lockStatus (pushChanges): ${JSON.stringify(lockStatus)}`); | ||
} | ||
else { | ||
this.errorLog(`Lock: ${this.accessory.displayName} lockStatus (pushChanges) failed, this.LockTargetState: ${this.LockTargetState}`); | ||
} | ||
} | ||
@@ -135,2 +209,3 @@ catch (e) { | ||
async updateHomeKitCharacteristics() { | ||
// Lock Mechanism | ||
if (this.LockTargetState === undefined) { | ||
@@ -140,5 +215,37 @@ this.debugLog(`Lock: ${this.accessory.displayName} LockTargetState: ${this.LockTargetState}`); | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.LockTargetState, this.LockTargetState); | ||
this.accessory.context.LockCurrentState = this.LockTargetState; | ||
this.lockService.updateCharacteristic(this.platform.Characteristic.LockTargetState, this.LockTargetState); | ||
this.debugLog(`Lock: ${this.accessory.displayName} updateCharacteristic LockTargetState: ${this.LockTargetState}`); | ||
} | ||
if (this.LockCurrentState === undefined) { | ||
this.debugLog(`Lock: ${this.accessory.displayName} LockCurrentState: ${this.LockCurrentState}`); | ||
} | ||
else { | ||
this.accessory.context.LockCurrentState = this.LockCurrentState; | ||
this.lockService.updateCharacteristic(this.platform.Characteristic.LockCurrentState, this.LockCurrentState); | ||
this.debugLog(`Lock: ${this.accessory.displayName} updateCharacteristic LockCurrentState: ${this.LockCurrentState}`); | ||
} | ||
// Battery | ||
if (this.BatteryLevel === undefined) { | ||
this.debugLog(`Lock: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`); | ||
} | ||
else { | ||
this.batteryService.updateCharacteristic(this.platform.Characteristic.BatteryLevel, this.BatteryLevel); | ||
this.debugLog(`Lock: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`); | ||
} | ||
if (this.StatusLowBattery === undefined) { | ||
this.debugLog(`Lock: ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`); | ||
} | ||
else { | ||
this.batteryService.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, this.StatusLowBattery); | ||
this.debugLog(`Lock: ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`); | ||
} | ||
// Contact Sensor | ||
if (this.ContactSensorState === undefined) { | ||
this.debugLog(`Contact Sensor: ${this.accessory.displayName} ContactSensorState: ${this.ContactSensorState}`); | ||
} | ||
else { | ||
this.contactSensorService?.updateCharacteristic(this.platform.Characteristic.ContactSensorState, this.ContactSensorState); | ||
this.debugLog(`Contact Sensor: ${this.accessory.displayName} updateCharacteristic ContactSensorState: ${this.ContactSensorState}`); | ||
} | ||
} | ||
@@ -152,4 +259,4 @@ async setLockTargetState(value) { | ||
let config = {}; | ||
if (device.thermostat) { | ||
config = device.thermostat; | ||
if (device.lock) { | ||
config = ''; | ||
} | ||
@@ -226,3 +333,3 @@ if (device.logging !== undefined) { | ||
} | ||
exports.LockManagement = LockManagement; | ||
exports.LockMechanism = LockMechanism; | ||
//# sourceMappingURL=lock.js.map |
import August from 'august-api'; | ||
import { API, Characteristic, DynamicPlatformPlugin, Logger, PlatformAccessory, Service } from 'homebridge'; | ||
import { AugustPlatformConfig, device } from './settings'; | ||
import { AugustPlatformConfig, device, devicesConfig } from './settings'; | ||
/** | ||
@@ -17,5 +17,6 @@ * HomebridgePlatform | ||
version: any; | ||
august: August; | ||
debugMode: boolean; | ||
platformLogging: string; | ||
august: August; | ||
registeringDevice: boolean; | ||
constructor(log: Logger, config: AugustPlatformConfig, api: API); | ||
@@ -38,4 +39,4 @@ logs(): void; | ||
private createLock; | ||
unregisterPlatformAccessories(existingAccessory: PlatformAccessory, device: device): void; | ||
locationinfo(location: any): void; | ||
private registerDevice; | ||
unregisterPlatformAccessories(existingAccessory: PlatformAccessory, device: device & devicesConfig): void; | ||
/** | ||
@@ -42,0 +43,0 @@ * If device level logging is turned on, log to log.warn |
@@ -139,15 +139,44 @@ "use strict"; | ||
// A 6-digit code will be sent to your email or phone (depending on what you used for your augustId). Send the code back: | ||
this.august.validate(this.config.credentials.validateCode); // Example code | ||
this.august.validate(this.config.credentials.validateCode); | ||
} | ||
// Example | ||
const myLocks = await this.august.locks(); | ||
this.debugLog(JSON.stringify(myLocks)); | ||
const lockIds = Object.keys(myLocks); | ||
this.debugLog(JSON.stringify(lockIds)); | ||
for (const lockId of lockIds) { | ||
this.debugLog(JSON.stringify(lockId)); | ||
const device = await this.august.details(lockId); | ||
this.debugLog(JSON.stringify(device)); | ||
this.createLock(device); | ||
// August Locks | ||
const devices = await this.august.details(); | ||
if (devices.length !== 0) { | ||
this.infoLog(`Total August Locks Found: ${devices.length}`); | ||
} | ||
else { | ||
this.infoLog(`Total August Locks Found: ${devices.length}`); | ||
} | ||
const deviceLists = devices; | ||
if (!this.config.options?.devices) { | ||
this.debugLog(`August Device Config Not Set: ${JSON.stringify(this.config.options?.devices)}`); | ||
const devices = deviceLists.map((v) => v); | ||
for (const device of devices) { | ||
if (device.configDeviceName) { | ||
device.deviceName = device.configDeviceName; | ||
} | ||
this.errorLog(`device: ${JSON.stringify(device)}`); | ||
this.createLock(device); | ||
} | ||
} | ||
else if (this.config.options.devices) { | ||
this.warnLog(`August Device Config Set: ${JSON.stringify(this.config.options?.devices)}`); | ||
const deviceConfigs = this.config.options?.devices; | ||
const mergeBylockId = (a1, a2) => a1.map((itm) => ({ | ||
...a2.find((item) => item.lockId.toUpperCase().replace(/[^A-Z0-9]+/g, '') === itm.lockId.toUpperCase().replace(/[^A-Z0-9]+/g, '') && item), | ||
...itm, | ||
})); | ||
const devices = mergeBylockId(deviceLists, deviceConfigs); | ||
this.debugLog(`August Devices: ${JSON.stringify(devices)}`); | ||
for (const device of devices) { | ||
if (device.configDeviceName) { | ||
device.deviceName = device.configDeviceName; | ||
} | ||
this.errorLog(`device: ${JSON.stringify(device)}`); | ||
this.createLock(device); | ||
} | ||
} | ||
else { | ||
this.errorLog('August ID & Password Supplied, Issue with Auth.'); | ||
} | ||
} | ||
@@ -165,3 +194,3 @@ catch (e) { | ||
// the accessory already exists | ||
if (!this.config.disablePlugin) { | ||
if (this.registerDevice(device)) { | ||
this.infoLog(`Restoring existing accessory from cache: ${device.LockName} DeviceID: ${device.lockId}`); | ||
@@ -178,3 +207,3 @@ // if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.: | ||
// this is imported from `platformAccessory.ts` | ||
new lock_1.LockManagement(this, existingAccessory, device); | ||
new lock_1.LockMechanism(this, existingAccessory, device); | ||
this.debugLog(`${device.LockName} (${device.lockId}) uuid: ${existingAccessory.UUID}`); | ||
@@ -186,3 +215,3 @@ } | ||
} | ||
else if (!this.config.disablePlugin) { | ||
else if (this.registerDevice(device)) { | ||
// the accessory does not yet exist, so we need to create it | ||
@@ -202,3 +231,3 @@ this.infoLog(`Adding new accessory: ${device.LockName} Lock ID: ${device.lockId}`); | ||
// this is imported from `platformAccessory.ts` | ||
new lock_1.LockManagement(this, accessory, device); | ||
new lock_1.LockMechanism(this, accessory, device); | ||
this.debugLog(`${device.LockName} (${device.lockId}) uuid: ${accessory.UUID}`); | ||
@@ -216,2 +245,13 @@ // link the accessory to your platform | ||
} | ||
registerDevice(device) { | ||
if (!device.hide_device && !this.config.disablePlugin) { | ||
this.registeringDevice = true; | ||
this.debugLog(`Device: ${device.LockName} Enabled`); | ||
} | ||
else { | ||
this.registeringDevice = false; | ||
this.debugLog(`Device: ${device.LockName} Plugin Disabled`); | ||
} | ||
return this.registeringDevice; | ||
} | ||
unregisterPlatformAccessories(existingAccessory, device) { | ||
@@ -222,9 +262,2 @@ // remove platform accessories when no longer present | ||
} | ||
locationinfo(location) { | ||
if (this.platformLogging?.includes('debug')) { | ||
if (location) { | ||
this.warnLog(JSON.stringify(location)); | ||
} | ||
} | ||
} | ||
/** | ||
@@ -231,0 +264,0 @@ * If device level logging is turned on, log to log.warn |
@@ -24,2 +24,3 @@ import { PlatformConfig } from 'homebridge'; | ||
logging?: string; | ||
devices?: Array<devicesConfig>; | ||
}; | ||
@@ -51,3 +52,2 @@ export declare type device = { | ||
Bridge: Bridge; | ||
OfflineKeys: OfflineKeys; | ||
parametersToSet: Record<any, undefined>; | ||
@@ -58,7 +58,5 @@ users: Record<any, undefined>; | ||
cameras: any[]; | ||
geofenceLimits: GeofenceLimits; | ||
pins: Pins; | ||
lockId: string; | ||
}; | ||
export interface BatteryInfo { | ||
export declare type BatteryInfo = { | ||
level: number; | ||
@@ -69,4 +67,4 @@ warningState: string; | ||
lastChangeVoltage: number; | ||
} | ||
export interface HostLockInfo { | ||
}; | ||
export declare type HostLockInfo = { | ||
serialNumber: string; | ||
@@ -76,4 +74,4 @@ manufacturer: string; | ||
productTypeID: number; | ||
} | ||
export interface LockStatus { | ||
}; | ||
export declare type LockStatus = { | ||
status: string; | ||
@@ -84,4 +82,4 @@ dateTime: string; | ||
doorState: string; | ||
} | ||
export interface Bridge { | ||
}; | ||
export declare type Bridge = { | ||
_id: string; | ||
@@ -95,4 +93,4 @@ mfgBridgeID: string; | ||
hyperBridge: boolean; | ||
} | ||
export interface Status { | ||
}; | ||
export declare type Status = { | ||
current: string; | ||
@@ -102,65 +100,20 @@ lastOffline: string; | ||
lastOnline: string; | ||
} | ||
export interface Lock { | ||
}; | ||
export declare type Lock = { | ||
_id: string; | ||
LockID: string; | ||
macAddress: string; | ||
}; | ||
export interface devicesConfig extends device { | ||
configLockName?: string; | ||
lockId: string; | ||
lock: lock; | ||
hide_device?: boolean; | ||
logging?: string; | ||
refreshRate?: number; | ||
firmware?: string; | ||
} | ||
export interface OfflineKeys { | ||
created: any[]; | ||
loaded: Loaded[]; | ||
deleted: any[]; | ||
loadedhk: Loadedhk[]; | ||
} | ||
export interface Loaded { | ||
created: string; | ||
key: string; | ||
slot: number; | ||
UserID: string; | ||
loaded: string; | ||
} | ||
export interface Loadedhk { | ||
key: string; | ||
slot: number; | ||
UserID: string; | ||
created: string; | ||
loaded: string; | ||
} | ||
export interface GeofenceLimits { | ||
ios: Ios; | ||
} | ||
export interface Ios { | ||
debounceInterval: number; | ||
gpsAccuracyMultiplier: number; | ||
maximumGeofence: number; | ||
minimumGeofence: number; | ||
minGPSAccuracyRequired: number; | ||
} | ||
export interface Pins { | ||
created: any[]; | ||
loaded: Loaded2[]; | ||
disabled: any[]; | ||
disabling: any[]; | ||
enabling: any[]; | ||
deleting: any[]; | ||
updating: any[]; | ||
} | ||
export interface Loaded2 { | ||
_id: string; | ||
type: string; | ||
lockID: string; | ||
userID: string; | ||
state: string; | ||
pin: string; | ||
slot: number; | ||
accessType: string; | ||
callingUserID: string; | ||
apiKey: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
loadedDate: string; | ||
firstName: string; | ||
lastName: string; | ||
unverified: boolean; | ||
} | ||
export declare type lock = { | ||
hide_contactsensor?: boolean; | ||
}; | ||
//# sourceMappingURL=settings.d.ts.map |
{ | ||
"displayName": "Homebridge August", | ||
"name": "homebridge-august", | ||
"version": "0.0.9", | ||
"version": "0.0.10-beta.0", | ||
"description": "The [Homebridge](https://homebridge.io) August plugin allows you to access your [August](https://august.com) & [Yale](https://shopyalehome.com) device(s) from HomeKit.", | ||
@@ -63,6 +63,6 @@ "author": "donavanbecker", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.3", | ||
"npm-check-updates": "^16.3.2", | ||
"typescript": "^4.8.4", | ||
"npm-check-updates": "^16.3.3", | ||
"prettier": "2.7.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103501
41
1127
1
1