@@ -58,36 +58,36 @@
Setup
Features
Help/About
From 55e8822bd84a0a01d2a6fb5ca6ab2b7c2fd0c8eb Mon Sep 17 00:00:00 2001
From: Donavan Becker
Date: Thu, 31 Oct 2024 22:44:17 -0500
Subject: [PATCH 2/7] 2.2.8
---
docs/functions/default.html | 2 +-
docs/index.html | 4 +-
package-lock.json | 26 +--
package.json | 2 +-
src/platform.ts | 422 ++++++++++++++++++------------------
src/settings.ts | 296 ++++++++++++-------------
6 files changed, 377 insertions(+), 375 deletions(-)
diff --git a/docs/functions/default.html b/docs/functions/default.html
index 3de3f77..fc246a6 100644
--- a/docs/functions/default.html
+++ b/docs/functions/default.html
@@ -1 +1 @@
-default | @homebridge-plugins/homebridge-august- default(api): void
Returns void
+default | @homebridge-plugins/homebridge-august- default(api): void
Returns void
diff --git a/docs/index.html b/docs/index.html
index e85b28a..c0c0d1a 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,9 +4,9 @@
-The Homebridge August
+
The Homebridge August
plugin allows you to access your August & Yale Lock(s) from HomeKit with
- Homebridge.
+ Homebridge.
Installation
diff --git a/package-lock.json b/package-lock.json
index b909e65..bf3718e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -30,7 +30,7 @@
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.14",
"@types/mdast": "^4.0.4",
- "@types/node": "^22.8.5",
+ "@types/node": "^22.8.6",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@vitest/coverage-v8": "^2.1.4",
@@ -5363,9 +5363,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
- "version": "22.8.5",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.5.tgz",
- "integrity": "sha512-5iYk6AMPtsMbkZqCO1UGF9W5L38twq11S2pYWkybGHH2ogPUvXWNlQqJBzuEZWKj/WRH+QTeiv6ySWqJtvIEgA==",
+ "version": "22.8.6",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.6.tgz",
+ "integrity": "sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==",
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.8"
@@ -8062,9 +8062,9 @@
"peer": true
},
"node_modules/electron-to-chromium": {
- "version": "1.5.49",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz",
- "integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==",
+ "version": "1.5.50",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.50.tgz",
+ "integrity": "sha512-eMVObiUQ2LdgeO1F/ySTXsvqvxb6ZH2zPGaMYsWzRDdOddUa77tdmI0ltg+L16UpbWdhPmuF3wIQYyQq65WfZw==",
"license": "ISC"
},
"node_modules/emittery": {
@@ -15511,9 +15511,9 @@
"license": "MIT"
},
"node_modules/pubnub": {
- "version": "8.2.9",
- "resolved": "https://registry.npmjs.org/pubnub/-/pubnub-8.2.9.tgz",
- "integrity": "sha512-NDQRbQ79e2OkUpnuw3EC5Rkee/gEcbI0RXPVCFPhno4G+XMRMVqWpqUf0jNLWY1DQ0rxfk4pupqft68JLHlqSQ==",
+ "version": "8.2.10",
+ "resolved": "https://registry.npmjs.org/pubnub/-/pubnub-8.2.10.tgz",
+ "integrity": "sha512-w+PmaYYGC+bAV1sPR6o/OQPTYywlm7pxXxzKRzJwegvVgD7HRZqCOTY5IHUjTrKF0y+3nsoiWBzXZNGaoGHvRg==",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"agentkeepalive": "^3.5.2",
@@ -18225,9 +18225,9 @@
}
},
"node_modules/tslib": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz",
- "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==",
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
},
"node_modules/tunnel-agent": {
diff --git a/package.json b/package.json
index 89e8b09..3808b61 100644
--- a/package.json
+++ b/package.json
@@ -72,7 +72,7 @@
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.14",
"@types/mdast": "^4.0.4",
- "@types/node": "^22.8.5",
+ "@types/node": "^22.8.6",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@vitest/coverage-v8": "^2.1.4",
diff --git a/src/platform.ts b/src/platform.ts
index bb1cc7a..1eb0b5a 100644
--- a/src/platform.ts
+++ b/src/platform.ts
@@ -1,15 +1,18 @@
-
/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* platform.ts: homebridge-august.
*/
-import August from 'august-yale';
-import { readFileSync, writeFileSync } from 'fs';
-import { LockMechanism } from './devices/lock.js';
-import { PLUGIN_NAME, PLATFORM_NAME } from './settings.js';
+import type { API, DynamicPlatformPlugin, Logging, PlatformAccessory } from 'homebridge'
+
+import type { AugustPlatformConfig, credentials, device, devicesConfig, options } from './settings.js'
+
+import { readFileSync, writeFileSync } from 'node:fs'
+import { argv } from 'node:process'
+
+import August from 'august-yale'
-import type { AugustPlatformConfig, credentials, device, devicesConfig, options } from './settings.js';
-import type { API, DynamicPlatformPlugin, Logging, PlatformAccessory } from 'homebridge';
+import { LockMechanism } from './devices/lock.js'
+import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js'
/**
* HomebridgePlatform
@@ -17,22 +20,22 @@ import type { API, DynamicPlatformPlugin, Logging, PlatformAccessory } from 'hom
* parse the user config and discover/register accessories with Homebridge.
*/
export class AugustPlatform implements DynamicPlatformPlugin {
- public accessories: PlatformAccessory[];
- public readonly api: API;
- public readonly log: Logging;
- public config!: AugustPlatformConfig;
-
- platformConfig!: AugustPlatformConfig['options'];
- platformLogging!: options['logging'];
- platformRefreshRate!: options['refreshRate'];
- platformPushRate!: options['pushRate'];
- platformUpdateRate!: options['updateRate'];
- registeringDevice!: boolean;
- debugMode!: boolean;
- version!: string;
+ public accessories: PlatformAccessory[]
+ public readonly api: API
+ public readonly log: Logging
+ public config!: AugustPlatformConfig
+
+ platformConfig!: AugustPlatformConfig
+ platformLogging!: options['logging']
+ platformRefreshRate!: options['refreshRate']
+ platformPushRate!: options['pushRate']
+ platformUpdateRate!: options['updateRate']
+ registeringDevice!: boolean
+ debugMode!: boolean
+ version!: string
// August API
- augustConfig!: August;
+ augustConfig!: August
constructor(
log: Logging,
@@ -40,13 +43,13 @@ export class AugustPlatform implements DynamicPlatformPlugin {
api: API,
) {
// Initialize
- this.accessories = [];
- this.api = api;
- this.log = log;
+ this.accessories = []
+ this.api = api
+ this.log = log
// only load if configured
if (!config) {
- return;
+ return
}
// Plugin options into our config variables.
@@ -55,53 +58,52 @@ export class AugustPlatform implements DynamicPlatformPlugin {
name: config.name,
credentials: config.credentials as credentials,
options: config.options as object,
- };
+ }
// Plugin Configuration
- this.getPlatformLogSettings();
- this.getPlatformRateSettings();
- this.getPlatformConfigSettings();
- this.getVersion();
+ this.getPlatformConfigSettings()
+ this.getPlatformRateSettings()
+ this.getPlatformLogSettings()
+ this.getVersion()
- // Finish initializing the plugin
+ // Finish initializing the platform
this.debugLog(`Finished initializing platform: ${config.name}`);
// verify the config
(async () => {
try {
- this.verifyConfig();
- this.debugLog('Config OK');
+ this.verifyConfig()
+ this.debugLog('Config OK')
} catch (e: any) {
- await this.errorLog(`Verify Config, Error Message: ${e.message}, Submit Bugs Here: https://bit.ly/august-bug-report`);
- await this.debugErrorLog(`Verify Config, Error: ${e}`);
- return;
+ await this.errorLog(`Verify Config, Error Message: ${e.message}, Submit Bugs Here: https://bit.ly/august-bug-report`)
+ await this.debugErrorLog(`Verify Config, Error: ${e}`)
}
- })();
+ })()
// When this event is fired it means Homebridge has restored all cached accessories from disk.
// Dynamic Platform plugins should only register new accessories after this event was fired,
// in order to ensure they weren't added to homebridge already. This event can also be used
// to start discovery of new accessories.
this.api.on('didFinishLaunching', async () => {
- await this.debugLog('Executed didFinishLaunching callback');
+ await this.debugLog('Executed didFinishLaunching callback')
// run the method to discover / register your devices as accessories
if (this.config.credentials?.isValidated === false || this.config.credentials?.isValidated === undefined) {
- await this.debugWarnLog(`Config Credentials: ${JSON.stringify(this.config.credentials)}`);
+ await this.debugWarnLog(`Config Credentials: ${JSON.stringify(this.config.credentials)}`)
try {
- await this.validated();
+ await this.validated()
} catch (e: any) {
- this.errorLog(`Validate: ${e}`);
+ this.errorLog(`Validate: ${e}`)
}
} else {
- await this.debugWarnLog(`Config Credentials: ${JSON.stringify(this.config.credentials)}`);
+ await this.debugWarnLog(`Config Credentials: ${JSON.stringify(this.config.credentials)}`)
try {
- await this.discoverDevices();
+ await this.discoverDevices()
} catch (e: any) {
- await this.errorLog(`Validated, Discover Devices: ${e}`);
+ await this.errorLog(`Validated, Discover Devices: ${e}`)
}
}
- });
+ })
}
/**
@@ -109,10 +111,10 @@ export class AugustPlatform implements DynamicPlatformPlugin {
* It should be used to setup event handlers for characteristics and update respective values.
*/
async configureAccessory(accessory: PlatformAccessory): Promise {
- await this.debugLog(`Loading accessory from cache: ${accessory.displayName}`);
+ await this.debugLog(`Loading accessory from cache: ${accessory.displayName}`)
// add the restored accessory to the accessories cache so we can track if it has already been registered
- this.accessories.push(accessory);
+ this.accessories.push(accessory)
}
/**
@@ -120,13 +122,13 @@ export class AugustPlatform implements DynamicPlatformPlugin {
*/
async verifyConfig() {
if (!this.config.credentials) {
- throw 'Missing Credentials';
+ throw new Error('Missing Credentials')
} else {
if (!this.config.credentials.augustId) {
- throw 'Missing August ID (E-mail/Phone Number';
+ throw new Error('Missing August ID (E-mail/Phone Number)')
}
if (!this.config.credentials.password) {
- throw 'Missing August Password';
+ throw new Error('Missing August Password')
}
}
}
@@ -137,85 +139,82 @@ export class AugustPlatform implements DynamicPlatformPlugin {
* this process then looks to see if session is already validated and if the validateCode in config;
* if isValidated is false then it will validate iwth the validateCode and save isValidated as true in the config.json file
* will also make the validateCode undefined
- * @param this.config.credentials.installId
- * @param this.config.credentials.isValidated
- * @param this.config.credentials.validateCode
*/
async validated() {
if (!this.config.credentials?.installId) {
- this.config.credentials!.installId = this.api.hap.uuid.generate(`${this.config.credentials?.augustId}`);
+ this.config.credentials!.installId = this.api.hap.uuid.generate(`${this.config.credentials?.augustId}`)
}
- await this.augustCredentials();
+ await this.augustCredentials()
if (!this.config.credentials?.isValidated && this.config.credentials?.validateCode) {
- const validateCode = this.config.credentials?.validateCode;
- const isValidated = await August.validate(this.config.credentials!, validateCode);
+ const validateCode = this.config.credentials?.validateCode
+ const isValidated = await August.validate(this.config.credentials!, validateCode)
// If validated successfully, set flag for future use, and you can now use the API
- this.config.credentials.isValidated = isValidated;
+ this.config.credentials.isValidated = isValidated
// load in the current config
- const { pluginConfig, currentConfig } = await this.pluginConfig();
+ const { pluginConfig, currentConfig } = await this.pluginConfig()
- pluginConfig.credentials.isValidated = this.config.credentials?.isValidated;
+ pluginConfig.credentials.isValidated = this.config.credentials?.isValidated
if (this.config.credentials.isValidated) {
- pluginConfig.credentials.validateCode = undefined;
+ pluginConfig.credentials.validateCode = undefined
}
- await this.debugWarnLog(`isValidated: ${pluginConfig.credentials.isValidated}`);
- await this.debugWarnLog(`validateCode: ${pluginConfig.credentials.validateCode}`);
+ await this.debugWarnLog(`isValidated: ${pluginConfig.credentials.isValidated}`)
+ await this.debugWarnLog(`validateCode: ${pluginConfig.credentials.validateCode}`)
// save the config, ensuring we maintain pretty json
- writeFileSync(this.api.user.configPath(), JSON.stringify(currentConfig, null, 4));
+ writeFileSync(this.api.user.configPath(), JSON.stringify(currentConfig, null, 4))
if (!isValidated) {
- return;
+ this.debugErrorLog('Validate Code is Invalid, Please Check Your Code and Restart Homebridge.')
} else {
try {
- await this.discoverDevices();
- await this.debugWarnLog(`isValidated: ${this.config.credentials?.isValidated}`);
+ await this.discoverDevices()
+ await this.debugWarnLog(`isValidated: ${this.config.credentials?.isValidated}`)
} catch (e: any) {
- await this.errorLog(`Validate, Discover Devices: ${e}`);
+ await this.errorLog(`Validate, Discover Devices: ${e}`)
}
}
} else {
// load in the current config
- const { pluginConfig, currentConfig } = await this.pluginConfig();
+ const { pluginConfig, currentConfig } = await this.pluginConfig()
// set the refresh token
- pluginConfig.credentials.installId = this.config.credentials?.installId;
+ pluginConfig.credentials.installId = this.config.credentials?.installId
- await this.debugWarnLog(`installId: ${pluginConfig.credentials.installId}`);
+ await this.debugWarnLog(`installId: ${pluginConfig.credentials.installId}`)
// save the config, ensuring we maintain pretty json
- writeFileSync(this.api.user.configPath(), JSON.stringify(currentConfig, null, 4));
+ writeFileSync(this.api.user.configPath(), JSON.stringify(currentConfig, null, 4))
// A 6-digit code will be sent to your email or phone (depending on what you used for your augustId).
// Need some way to get this code from the user.
- August.authorize(this.config.credentials!);
- await this.warnLog('Input Your August email verification code into the validateCode config and restart Homebridge.');
+ August.authorize(this.config.credentials!)
+ await this.warnLog('Input Your August email verification code into the validateCode config and restart Homebridge.')
}
}
async augustCredentials() {
if (!this.config.credentials) {
- throw 'Missing Credentials';
+ throw new Error('Missing Credentials')
} else {
- this.augustConfig = new August(this.config.credentials);
- await this.debugLog(`August Credentials: ${JSON.stringify(this.augustConfig)}`);
+ this.augustConfig = new August(this.config.credentials)
+ await this.debugLog(`August Credentials: ${JSON.stringify(this.augustConfig)}`)
}
}
async pluginConfig() {
- const currentConfig = JSON.parse(readFileSync(this.api.user.configPath(), 'utf8'));
+ const currentConfig = JSON.parse(readFileSync(this.api.user.configPath(), 'utf8'))
// check the platforms section is an array before we do array things on it
if (!Array.isArray(currentConfig.platforms)) {
- throw new Error('Cannot find platforms array in config');
+ throw new TypeError('Cannot find platforms array in config')
}
// find this plugins current config
- const pluginConfig = currentConfig.platforms.find((x: { platform: string; }) => x.platform === PLATFORM_NAME);
+ const pluginConfig = currentConfig.platforms.find((x: { platform: string }) => x.platform === PLATFORM_NAME)
if (!pluginConfig) {
- throw new Error(`Cannot find config for ${PLATFORM_NAME} in platforms array`);
+ throw new Error(`Cannot find config for ${PLATFORM_NAME} in platforms array`)
}
// check the .credentials is an object before doing object things with it
if (typeof pluginConfig.credentials !== 'object') {
- throw new Error('pluginConfig.credentials is not an object');
+ throw new TypeError('pluginConfig.credentials is not an object')
}
- return { pluginConfig, currentConfig };
+ return { pluginConfig, currentConfig }
}
/**
@@ -223,28 +222,28 @@ export class AugustPlatform implements DynamicPlatformPlugin {
*/
async discoverDevices() {
// August Locks
- const devices = await August.details(this.config.credentials!, '');
- let deviceLists: any[];
+ const devices = await August.details(this.config.credentials!, '')
+ let deviceLists: any[]
if (devices.length > 1) {
- deviceLists = devices;
- await this.infoLog(`Total August Locks Found: ${deviceLists.length}`);
+ deviceLists = devices
+ await this.infoLog(`Total August Locks Found: ${deviceLists.length}`)
} else {
- deviceLists = [devices];
- await this.infoLog(`Total August Locks Found: ${deviceLists.length}`);
+ deviceLists = [devices]
+ await this.infoLog(`Total August Locks Found: ${deviceLists.length}`)
}
if (!this.config.options?.devices) {
- await this.debugWarnLog(`August Platform Config Not Set: ${JSON.stringify(this.config.options?.devices)}`);
- const devices = deviceLists.map((v: any) => v);
+ await this.debugWarnLog(`August Platform Config Not Set: ${JSON.stringify(this.config.options?.devices)}`)
+ const devices = deviceLists.map((v: any) => v)
for (const device of devices) {
if (device.configDeviceName) {
- device.deviceName = device.configDeviceName;
+ device.deviceName = device.configDeviceName
}
- await this.debugLog(`August Devices: ${JSON.stringify(device)}`);
- await this.Lock(device);
+ await this.debugLog(`August Devices: ${JSON.stringify(device)}`)
+ await this.Lock(device)
}
} else if (this.config.options.devices) {
- await this.debugWarnLog(`August Platform Config Set: ${JSON.stringify(this.config.options?.devices)}`);
- const deviceConfigs = this.config.options?.devices;
+ await this.debugWarnLog(`August Platform Config Set: ${JSON.stringify(this.config.options?.devices)}`)
+ const deviceConfigs = this.config.options?.devices
const mergeBylockId = (a1: { lockId: string }[], a2: any[]) =>
a1.map((itm: { lockId: string }) => ({
@@ -253,163 +252,170 @@ export class AugustPlatform implements DynamicPlatformPlugin {
item.lockId.toUpperCase().replace(/[^A-Z0-9]+/g, '') === itm.lockId.toUpperCase().replace(/[^A-Z0-9]+/g, '') && item,
),
...itm,
- }));
- const devices = mergeBylockId(deviceLists, deviceConfigs);
- await this.debugLog(`August Lock(s): ${JSON.stringify(devices)}`);
+ }))
+ const devices = mergeBylockId(deviceLists, deviceConfigs)
+ await this.debugLog(`August Lock(s): ${JSON.stringify(devices)}`)
for (const device of devices) {
if (device.configDeviceName) {
- device.deviceName = device.configDeviceName;
+ device.deviceName = device.configDeviceName
}
- await this.debugLog(`device: ${JSON.stringify(device)}`);
- await this.Lock(device);
+ await this.debugLog(`device: ${JSON.stringify(device)}`)
+ await this.Lock(device)
}
} else {
- await this.errorLog('August ID & Password Supplied, Issue with Auth.');
+ await this.errorLog('August ID & Password Supplied, Issue with Auth.')
}
}
private async Lock(device: device & devicesConfig) {
- const uuid = this.api.hap.uuid.generate(device.lockId);
+ const uuid = this.api.hap.uuid.generate(device.lockId)
// see if an accessory with the same uuid has already been registered and restored from
// the cached devices we stored in the `configureAccessory` method above
- const existingAccessory = this.accessories.find((accessory) => accessory.UUID === uuid);
+ const existingAccessory = this.accessories.find(accessory => accessory.UUID === uuid)
if (existingAccessory) {
-
// the accessory already exists
if (await this.registerDevice(device)) {
- await this.infoLog(`Restoring existing accessory from cache: ${device.LockName}, Lock ID: ${device.lockId}`);
+ await this.infoLog(`Restoring existing accessory from cache: ${device.LockName}, Lock ID: ${device.lockId}`)
// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
- existingAccessory.context.device = device;
+ existingAccessory.context.device = device
existingAccessory.displayName = device.configLockName
? await this.validateAndCleanDisplayName(device.configLockName, 'configLockName', device.configLockName)
- : await this.validateAndCleanDisplayName(device.LockName, 'LockName', device.LockName);
- existingAccessory.context.currentFirmwareVersion = device.currentFirmwareVersion;
- existingAccessory.context.model = device.skuNumber;
- existingAccessory.context.serialnumber = device.SerialNumber;
- existingAccessory.context.lockId = device.lockId;
- this.api.updatePlatformAccessories([existingAccessory]);
+ : await this.validateAndCleanDisplayName(device.LockName, 'LockName', device.LockName)
+ existingAccessory.context.currentFirmwareVersion = device.currentFirmwareVersion
+ existingAccessory.context.model = device.skuNumber
+ existingAccessory.context.serialnumber = device.SerialNumber
+ existingAccessory.context.lockId = device.lockId
+ this.api.updatePlatformAccessories([existingAccessory])
// create the accessory handler for the restored accessory
// this is imported from `platformAccessory.ts`
- new LockMechanism(this, existingAccessory, device);
- await this.debugLog(`Lock: ${device.LockName} (${device.lockId}) uuid: ${existingAccessory.UUID}`);
+ new LockMechanism(this, existingAccessory, device)
+ await this.debugLog(`Lock: ${device.LockName} (${device.lockId}) uuid: ${existingAccessory.UUID}`)
} else {
- await this.unregisterPlatformAccessories(existingAccessory, device);
+ await this.unregisterPlatformAccessories(existingAccessory, device)
}
} else if (await this.registerDevice(device)) {
// create a new accessory
- const accessory = new this.api.platformAccessory(device.configLockName ?? device.LockName, uuid);
+ const accessory = new this.api.platformAccessory(device.configLockName ?? device.LockName, uuid)
// store a copy of the device object in the `accessory.context`
// the `context` property can be used to store any data about the accessory you may need
- accessory.context.device = device;
+ accessory.context.device = device
accessory.displayName = device.configLockName
? await this.validateAndCleanDisplayName(device.configLockName, 'configLockName', device.configLockName)
- : await this.validateAndCleanDisplayName(device.LockName, 'LockName', device.LockName);
- accessory.context.currentFirmwareVersion = device.currentFirmwareVersion;
- accessory.context.model = device.skuNumber;
- accessory.context.serialnumber = device.SerialNumber;
- accessory.context.lockId = device.lockId;
+ : await this.validateAndCleanDisplayName(device.LockName, 'LockName', device.LockName)
+ accessory.context.currentFirmwareVersion = device.currentFirmwareVersion
+ accessory.context.model = device.skuNumber
+ accessory.context.serialnumber = device.SerialNumber
+ accessory.context.lockId = device.lockId
// the accessory does not yet exist, so we need to create it
if (!device.external) {
- await this.infoLog(`Adding new accessory: ${device.LockName}, Lock ID: ${device.lockId}`);
+ await this.infoLog(`Adding new accessory: ${device.LockName}, Lock ID: ${device.lockId}`)
}
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
- new LockMechanism(this, accessory, device);
- await this.debugLog(`Lock: ${device.LockName} (${device.lockId}) uuid: ${accessory.UUID}`);
+ new LockMechanism(this, accessory, device)
+ await this.debugLog(`Lock: ${device.LockName} (${device.lockId}) uuid: ${accessory.UUID}`)
// link the accessory to your platform
- await this.externalOrPlatform(device, accessory);
- this.accessories.push(accessory);
+ await this.externalOrPlatform(device, accessory)
+ this.accessories.push(accessory)
} else {
- await this.debugErrorLog(`Unable to Register: ${device.LockName}, Lock ID: ${device.lockId} Check Config to see if is being Hidden.`);
+ await this.debugErrorLog(`Unable to Register: ${device.LockName}, Lock ID: ${device.lockId} Check Config to see if is being Hidden.`)
}
}
async registerDevice(device: device & devicesConfig) {
if (!device.hide_device && !device.homeKitEnabled) {
- this.registeringDevice = true;
- await this.debugLog(`Device: ${device.LockName} Enabled`);
+ this.registeringDevice = true
+ await this.debugLog(`Device: ${device.LockName} Enabled`)
} else if (device.homeKitEnabled && device.overrideHomeKitEnabled) {
- this.registeringDevice = true;
+ this.registeringDevice = true
await this.debugWarnLog(`Device: ${device.LockName} HomeKit Enabled: ${device.homeKitEnabled}, `
- + `Override HomeKit Enabled: ${device.overrideHomeKitEnabled}`);
+ + `Override HomeKit Enabled: ${device.overrideHomeKitEnabled}`)
} else if (device.homeKitEnabled && !device.overrideHomeKitEnabled) {
- this.registeringDevice = false;
+ this.registeringDevice = false
await this.debugErrorLog(`Device: ${device.LockName} HomeKit Enabled: `
- + `${device.homeKitEnabled}, device will not be registered. To enable, set overrideHomeKitEnabled to true.`);
+ + `${device.homeKitEnabled}, device will not be registered. To enable, set overrideHomeKitEnabled to true.`)
} else {
- this.registeringDevice = false;
- await this.debugLog(`Device: ${device.LockName} is Hidden.`);
+ this.registeringDevice = false
+ await this.debugLog(`Device: ${device.LockName} is Hidden.`)
}
- return this.registeringDevice;
+ return this.registeringDevice
}
public async externalOrPlatform(device: device & devicesConfig, accessory: PlatformAccessory) {
if (device.external) {
- await this.infoLog(`${accessory.displayName} External Accessory Mode: ${device.external}`);
- await this.externalAccessory(accessory);
+ await this.infoLog(`${accessory.displayName} External Accessory Mode: ${device.external}`)
+ await this.externalAccessory(accessory)
} else {
- await this.debugLog(`${accessory.displayName} External Accessory Mode: ${device.external}`);
- this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
+ await this.debugLog(`${accessory.displayName} External Accessory Mode: ${device.external}`)
+ this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory])
}
}
public async externalAccessory(accessory: PlatformAccessory) {
- this.api.publishExternalAccessories(PLUGIN_NAME, [accessory]);
+ this.api.publishExternalAccessories(PLUGIN_NAME, [accessory])
}
public async unregisterPlatformAccessories(existingAccessory: PlatformAccessory, device: device & devicesConfig) {
// remove platform accessories when no longer present
- this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [existingAccessory]);
- await this.warnLog(`Removing existing accessory from cache: ${device.LockName}`);
- }
-
- async getVersion() {
- const json = JSON.parse(
- readFileSync(
- new URL('../package.json', import.meta.url),
- 'utf-8',
- ),
- );
- await this.debugLog(`Plugin Version: ${json.version}`);
- this.version = json.version;
+ this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [existingAccessory])
+ await this.warnLog(`Removing existing accessory from cache: ${device.LockName}`)
}
async getPlatformConfigSettings() {
if (this.config.options) {
- const platformConfig: AugustPlatformConfig['options'] = {};
- platformConfig.logging = this.config.options.logging ? this.config.options.logging : undefined;
- platformConfig.refreshRate = this.config.options.refreshRate ? this.config.options.refreshRate : undefined;
- platformConfig.updateRate = this.config.options.updateRate ? this.config.options.updateRate : undefined;
- platformConfig.pushRate = this.config.options.pushRate ? this.config.options.pushRate : undefined;
+ const platformConfig: AugustPlatformConfig = {
+ platform: 'August',
+ }
+ platformConfig.logging = this.config.options.logging ? this.config.options.logging : undefined
+ platformConfig.refreshRate = this.config.options.refreshRate ? this.config.options.refreshRate : undefined
+ platformConfig.updateRate = this.config.options.updateRate ? this.config.options.updateRate : undefined
+ platformConfig.pushRate = this.config.options.pushRate ? this.config.options.pushRate : undefined
if (Object.entries(platformConfig).length !== 0) {
- await this.debugLog(`Platform Config: ${JSON.stringify(platformConfig)}`);
+ await this.debugLog(`Platform Config: ${JSON.stringify(platformConfig)}`)
}
- this.platformConfig = platformConfig;
+ this.platformConfig = platformConfig
}
}
async getPlatformRateSettings() {
- this.platformRefreshRate = this.config.options?.refreshRate ? this.config.options.refreshRate : 0;
- const refreshRate = this.config.options?.refreshRate ? 'Using Platform Config refreshRate' : 'refreshRate Disabled by Default';
- await this.debugLog(`${refreshRate}: ${this.platformRefreshRate}`);
- this.platformUpdateRate = this.config.options?.updateRate ? this.config.options.updateRate : 1;
- const updateRate = this.config.options?.updateRate ? 'Using Platform Config updateRate' : 'Using Default updateRate';
- await this.debugLog(`${updateRate}: ${this.platformUpdateRate}`);
- this.platformPushRate = this.config.options?.pushRate ? this.config.options.pushRate : 1;
- const pushRate = this.config.options?.pushRate ? 'Using Platform Config pushRate' : 'Using Default pushRate';
- await this.debugLog(`${pushRate}: ${this.platformPushRate}`);
+ this.platformRefreshRate = this.config.options?.refreshRate ? this.config.options.refreshRate : 0
+ const refreshRate = this.config.options?.refreshRate ? 'Using Platform Config refreshRate' : 'refreshRate Disabled by Default'
+ await this.debugLog(`${refreshRate}: ${this.platformRefreshRate}`)
+ this.platformUpdateRate = this.config.options?.updateRate ? this.config.options.updateRate : 1
+ const updateRate = this.config.options?.updateRate ? 'Using Platform Config updateRate' : 'Using Default updateRate'
+ await this.debugLog(`${updateRate}: ${this.platformUpdateRate}`)
+ this.platformPushRate = this.config.options?.pushRate ? this.config.options.pushRate : 1
+ const pushRate = this.config.options?.pushRate ? 'Using Platform Config pushRate' : 'Using Default pushRate'
+ await this.debugLog(`${pushRate}: ${this.platformPushRate}`)
}
async getPlatformLogSettings() {
- this.debugMode = process.argv.includes('-D') ?? process.argv.includes('--debug');
+ this.debugMode = argv.includes('-D') ?? argv.includes('--debug')
this.platformLogging = (this.config.options?.logging === 'debug' || this.config.options?.logging === 'standard'
- || this.config.options?.logging === 'none') ? this.config.options.logging : this.debugMode ? 'debugMode' : 'standard';
- const logging = this.config.options?.logging ? 'Platform Config' : this.debugMode ? 'debugMode' : 'Default';
- await this.debugLog(`Using ${logging} Logging: ${this.platformLogging}`);
+ || this.config.options?.logging === 'none')
+ ? this.config.options.logging
+ : this.debugMode ? 'debugMode' : 'standard'
+ const logging = this.config.options?.logging ? 'Platform Config' : this.debugMode ? 'debugMode' : 'Default'
+ await this.debugLog(`Using ${logging} Logging: ${this.platformLogging}`)
+ }
+
+ /**
+ * Asynchronously retrieves the version of the plugin from the package.json file.
+ *
+ * This method reads the package.json file located in the parent directory,
+ * parses its content to extract the version, and logs the version using the debug logger.
+ * The extracted version is then assigned to the `version` property of the class.
+ *
+ * @returns {Promise} A promise that resolves when the version has been retrieved and logged.
+ */
+ async getVersion(): Promise {
+ const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'))
+ this.debugLog(`Plugin Version: ${version}`)
+ this.version = version
}
/**
@@ -418,40 +424,36 @@ export class AugustPlatform implements DynamicPlatformPlugin {
* @param name - The name of the characteristic.
* @param value - The value to be validated and cleaned.
* @returns The cleaned string value.
- */
+ */
async validateAndCleanDisplayName(displayName: string, name: string, value: string): Promise {
if (this.config.options?.allowInvalidCharacters) {
- return value;
+ return value
} else {
- const validPattern = new RegExp(/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u);
- const invalidCharsPattern = /[^\p{L}\p{N} ']/gu;
- const invalidStartEndPattern = /^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu;
+ const validPattern = /^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u
+ const invalidCharsPattern = /[^\p{L}\p{N} ']/gu
+ const invalidStartEndPattern = /^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu
if (typeof value === 'string' && !validPattern.test(value)) {
- this.warnLog(`WARNING: The accessory '${displayName}' has an invalid '${name}' characteristic ('${value}'). Please use only alphanumeric,`
- + ' space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may'
- + ' prevent the accessory from being added in the Home App or cause unresponsiveness.');
+ this.warnLog(`WARNING: The accessory '${displayName}' has an invalid '${name}' characteristic ('${value}'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness.`)
// Remove invalid characters
if (invalidCharsPattern.test(value)) {
- const before = value;
- this.warnLog(`Removing invalid characters from '${name}' characteristic, if you feel this is incorrect,`
- + ' please enable \'allowInvalidCharacter\' in the config to allow all characters');
- value = value.replace(invalidCharsPattern, '');
- this.warnLog(`${name} Before: '${before}' After: '${value}'`);
+ const before = value
+ this.warnLog(`Removing invalid characters from '${name}' characteristic, if you feel this is incorrect, please enable \'allowInvalidCharacter\' in the config to allow all characters`)
+ value = value.replace(invalidCharsPattern, '')
+ this.warnLog(`${name} Before: '${before}' After: '${value}'`)
}
// Ensure it starts and ends with an alphanumeric character
if (invalidStartEndPattern.test(value)) {
- const before = value;
- this.warnLog(`Removing invalid starting or ending characters from '${name}' characteristic, if you feel this is incorrect,`
- + ' please enable \'allowInvalidCharacter\' in the config to allow all characters');
- value = value.replace(invalidStartEndPattern, '');
- this.warnLog(`${name} Before: '${before}' After: '${value}'`);
+ const before = value
+ this.warnLog(`Removing invalid starting or ending characters from '${name}' characteristic, if you feel this is incorrect, please enable \'allowInvalidCharacter\' in the config to allow all characters`)
+ value = value.replace(invalidStartEndPattern, '')
+ this.warnLog(`${name} Before: '${before}' After: '${value}'`)
}
}
- return value;
+ return value
}
}
@@ -461,67 +463,67 @@ export class AugustPlatform implements DynamicPlatformPlugin {
*/
async infoLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
- this.log.info(String(...log));
+ this.log.info(String(...log))
}
}
async successLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
- this.log.success(String(...log));
+ this.log.success(String(...log))
}
}
async debugSuccessLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
if (await this.loggingIsDebug()) {
- this.log.success('[DEBUG]', String(...log));
+ this.log.success('[DEBUG]', String(...log))
}
}
}
async warnLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
- this.log.warn(String(...log));
+ this.log.warn(String(...log))
}
}
async debugWarnLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
if (await this.loggingIsDebug()) {
- this.log.warn('[DEBUG]', String(...log));
+ this.log.warn('[DEBUG]', String(...log))
}
}
}
async errorLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
- this.log.error(String(...log));
+ this.log.error(String(...log))
}
}
async debugErrorLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
if (await this.loggingIsDebug()) {
- this.log.error('[DEBUG]', String(...log));
+ this.log.error('[DEBUG]', String(...log))
}
}
}
async debugLog(...log: any[]): Promise {
if (await this.enablingPlatformLogging()) {
- if (this.platformLogging === 'debug') {
- this.log.info('[DEBUG]', String(...log));
- } else if (this.platformLogging === 'debugMode') {
- this.log.debug(String(...log));
+ if (this.platformLogging === 'debugMode') {
+ this.log.debug(String(...log))
+ } else if (this.platformLogging === 'debug') {
+ this.log.info('[DEBUG]', String(...log))
}
}
}
async loggingIsDebug(): Promise {
- return this.platformLogging === 'debugMode' || this.platformLogging === 'debug';
+ return this.platformLogging === 'debugMode' || this.platformLogging === 'debug'
}
async enablingPlatformLogging(): Promise {
- return this.platformLogging === 'debugMode' || this.platformLogging === 'debug' || this.platformLogging === 'standard';
+ return this.platformLogging === 'debugMode' || this.platformLogging === 'debug' || this.platformLogging === 'standard'
}
-}
\ No newline at end of file
+}
diff --git a/src/settings.ts b/src/settings.ts
index f7ec5b9..ed1d047 100644
--- a/src/settings.ts
+++ b/src/settings.ts
@@ -2,100 +2,100 @@
*
* setting.ts: homebridge-august.
*/
-import type { PlatformConfig } from 'homebridge';
+import type { PlatformConfig } from 'homebridge'
/**
* This is the name of the platform that users will use to register the plugin in the Homebridge config.json
*/
-export const PLATFORM_NAME = 'August';
+export const PLATFORM_NAME = 'August'
/**
* This must match the name of your plugin as defined the package.json
*/
-export const PLUGIN_NAME = 'homebridge-august';
+export const PLUGIN_NAME = 'homebridge-august'
-//Config
+// Config
export interface AugustPlatformConfig extends PlatformConfig {
- credentials?: credentials;
- options?: options;
-}
-
-export type credentials = {
- apiKey?: string;
- pnSubKey?: string;
- installId: string;
- augustId: string; // Phone must be formatted +[countrycode][number]
- password: string;
- countryCode: string;
- validateCode?: string;
- isValidated?: boolean;
-};
-
-export type options = {
- devices?: devicesConfig[];
- allowInvalidCharacters?: boolean;
- refreshRate?: number;
- updateRate?: number;
- pushRate?: number;
- logging?: string;
-};
-
-export type device = {
- LockName: string;
- Type: number;
- Created: string;
- Updated: string;
- LockId: string;
- HouseID: string;
- HouseName: string;
- Calibrated: boolean;
- timeZone: string;
- battery: number;
- batteryInfo: BatteryInfo;
- doorStateOpenTimeout: number;
- hostLockInfo: HostLockInfo;
- supportsEntryCodes: boolean;
- remoteOperateSecret: string;
- skuNumber: string;
- macAddress: string;
- SerialNumber: string;
- LockStatus: LockStatus;
- currentFirmwareVersion: string;
+ credentials?: credentials
+ options?: options
+}
+
+export interface credentials {
+ apiKey?: string
+ pnSubKey?: string
+ installId: string
+ augustId: string // Phone must be formatted +[countrycode][number]
+ password: string
+ countryCode: string
+ validateCode?: string
+ isValidated?: boolean
+}
+
+export interface options {
+ devices?: devicesConfig[]
+ allowInvalidCharacters?: boolean
+ refreshRate?: number
+ updateRate?: number
+ pushRate?: number
+ logging?: string
+}
+
+export interface device {
+ LockName: string
+ Type: number
+ Created: string
+ Updated: string
+ LockId: string
+ HouseID: string
+ HouseName: string
+ Calibrated: boolean
+ timeZone: string
+ battery: number
+ batteryInfo: BatteryInfo
+ doorStateOpenTimeout: number
+ hostLockInfo: HostLockInfo
+ supportsEntryCodes: boolean
+ remoteOperateSecret: string
+ skuNumber: string
+ macAddress: string
+ SerialNumber: string
+ LockStatus: LockStatus
+ currentFirmwareVersion: string
homeKitEnabled: boolean
- zWaveEnabled: boolean;
- isGalileo: boolean;
- Bridge: Bridge;
- parametersToSet: Record;
- users: Record;
- pubsubChannel: string;
- ruleHash: any;
- cameras: any[];
- lockId: string;
-};
-
-export type BatteryInfo = {
+ zWaveEnabled: boolean
+ isGalileo: boolean
+ Bridge: Bridge
+ parametersToSet: Record
+ users: Record
+ pubsubChannel: string
+ ruleHash: any
+ cameras: any[]
+ lockId: string
+}
+
+export interface BatteryInfo {
level: number
warningState: string
infoUpdatedDate: string
lastChangeDate: string
lastChangeVoltage: number
-};
+}
-export type HostLockInfo = {
+export interface HostLockInfo {
serialNumber: string
manufacturer: string
productID: number
productTypeID: number
-};
+}
-export type LockStatus = {
+export interface LockStatus {
status: string
dateTime: string
isLockStatusChanged: boolean
valid: boolean
doorState: string
-};
+}
-export type Bridge = {
+export interface Bridge {
_id: string
mfgBridgeID: string
deviceModel: string
@@ -104,97 +104,97 @@ export type Bridge = {
status: Status
locks: Lock[]
hyperBridge: boolean
-};
+}
-export type Status = {
+export interface Status {
current: string
lastOffline: string
updated: string
lastOnline: string
-};
+}
-export type Lock = {
+export interface Lock {
_id: string
LockID: string
macAddress: string
-};
+}
export interface devicesConfig extends device {
- configLockName?: string;
- lockId: string;
- lock?: lock;
+ configLockName?: string
+ lockId: string
+ lock?: lock
overrideHomeKitEnabled: boolean
- hide_device?: boolean;
- external?: boolean;
- logging?: string;
- refreshRate?: number;
- updateRate?: number;
- pushRate?: number;
- firmware?: string;
-}
-
-export type lock = {
- hide_lock?: boolean;
- hide_contactsensor?: boolean;
-};
-
-export type lockDetails = {
- lockName: string;
- battery: number;
- LockStatus: lockStatus;
- currentFirmwareVersion: string;
-};
-
-export type lockStatus = {
- lockId: string;
- status: string;
- doorState: string;
- state: state;
-};
-
-export type state = {
- unlocked: boolean;
- locked: boolean;
- locking: boolean;
- unlocking: boolean;
- open: boolean;
- closed: boolean;
-};
-
-export type lockEvent = {
- remoteEvent?: boolean;
- status: string;
- info?: info;
- callingUserID?: string;
- doorState: string;
- state: stateEvent;
- lockID: string;
- lockId: string;
-};
-
-export type stateEvent = {
- locked: boolean;
- unlocked: boolean;
- locking: boolean;
- unlocking: boolean;
- open?: boolean;
- closed?: boolean;
-};
-
-export type info = {
- action: string;
- startTime: Date;
+ hide_device?: boolean
+ external?: boolean
+ logging?: string
+ refreshRate?: number
+ updateRate?: number
+ pushRate?: number
+ firmware?: string
+}
+
+export interface lock {
+ hide_lock?: boolean
+ hide_contactsensor?: boolean
+}
+
+export interface lockDetails {
+ lockName: string
+ battery: number
+ LockStatus: lockStatus
+ currentFirmwareVersion: string
+}
+
+export interface lockStatus {
+ lockId: string
+ status: string
+ doorState: string
+ state: state
+}
+
+export interface state {
+ unlocked: boolean
+ locked: boolean
+ locking: boolean
+ unlocking: boolean
+ open: boolean
+ closed: boolean
+}
+
+export interface lockEvent {
+ remoteEvent?: boolean
+ status: string
+ info?: info
+ callingUserID?: string
+ doorState: string
+ state: stateEvent
+ lockID: string
+ lockId: string
+}
+
+export interface stateEvent {
+ locked: boolean
+ unlocked: boolean
+ locking: boolean
+ unlocking: boolean
+ open?: boolean
+ closed?: boolean
+}
+
+export interface info {
+ action: string
+ startTime: Date
context: {
- transactionID: string;
- startDate: Date;
- retryCount: number;
- };
- lockType: string;
- serialNumber: string;
- rssi: number;
- wlanRSSI: number;
- wlanSNR: number;
- duration: number;
- lockID: string;
- bridgeID: string;
-};
\ No newline at end of file
+ transactionID: string
+ startDate: Date
+ retryCount: number
+ }
+ lockType: string
+ serialNumber: string
+ rssi: number
+ wlanRSSI: number
+ wlanSNR: number
+ duration: number
+ lockID: string
+ bridgeID: string
+}
From a4429b1480178332d8d57186191ae1afdf76bc32 Mon Sep 17 00:00:00 2001
From: Donavan Becker
Date: Fri, 1 Nov 2024 16:09:24 -0500
Subject: [PATCH 3/7] platform config
---
.github/workflows/beta-release.yml | 25 ++++++++++++++-----------
.github/workflows/build.yml | 4 ++--
.github/workflows/changerelease.yml | 2 +-
.github/workflows/dependabot.yml | 13 -------------
.github/workflows/labeler.yml | 2 +-
.github/workflows/release-drafter.yml | 2 +-
.github/workflows/release.yml | 24 ++++++++++++------------
.github/workflows/stale.yml | 2 +-
src/devices/device.ts | 16 ++++++++--------
9 files changed, 40 insertions(+), 50 deletions(-)
delete mode 100644 .github/workflows/dependabot.yml
diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml
index 501ead4..d1b9ea7 100644
--- a/.github/workflows/beta-release.yml
+++ b/.github/workflows/beta-release.yml
@@ -7,21 +7,21 @@ on:
jobs:
build_and_test:
- uses: donavanbecker/.github/.github/workflows/nodejs-build-and-test.yml@latest
+ uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
enable_coverage: true
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
lint:
needs: build_and_test
- uses: donavanbecker/.github/.github/workflows/eslint.yml@latest
+ uses: homebridge/.github/.github/workflows/eslint.yml@latest
publish:
needs: lint
-
if: ${{ github.repository == 'homebridge-plugins/homebridge-august' }}
-
- uses: donavanbecker/.github/.github/workflows/npm-publish.yml@latest
+ permissions:
+ id-token: write
+ uses: homebridge/.github/.github/workflows/npm-publish-esm.yml@latest
with:
tag: 'beta'
dynamically_adjust_version: true
@@ -33,7 +33,7 @@ jobs:
pre-release:
needs: publish
if: ${{ github.repository == 'homebridge-plugins/homebridge-august' }}
- uses: donavanbecker/.github/.github/workflows/pre-release.yml@latest
+ uses: homebridge/.github/.github/workflows/pre-release.yml@latest
with:
npm_version: ${{ needs.publish.outputs.NPM_VERSION }}
body: |
@@ -42,11 +42,14 @@ jobs:
[How To Test Beta Releases](https://github.com/homebridge-plugins/homebridge-august/wiki/Beta-Version)
github-releases-to-discord:
- needs: [publish, pre-release]
+ name: Discord Webhooks
+ needs: [build_and_test,publish]
if: ${{ github.repository == 'homebridge-plugins/homebridge-august' }}
- uses: donavanbecker/.github/.github/workflows/discord-webhooks.yml@latest
+ uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
- message_title: "August Beta Release"
- message_url: "https://github.com/OpenWonderLabs/homebridge-august/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
+ title: "August Beta Release"
+ description: |
+ Version `v${{ needs.publish.outputs.NPM_VERSION }}`
+ url: "https://github.com/homebridge-plugins/homebridge-august/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
secrets:
- DISCORD_WEBHOOK_URL_BETA: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }}
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_BETA || secrets.DISCORD_WEBHOOK_URL_LATEST }}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 842fa20..8fbf227 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -8,11 +8,11 @@ on:
jobs:
build_and_test:
- uses: donavanbecker/.github/.github/workflows/nodejs-build-and-test.yml@latest
+ uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
enable_coverage: true
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
lint:
needs: build_and_test
- uses: donavanbecker/.github/.github/workflows/eslint.yml@latest
+ uses: homebridge/.github/.github/workflows/eslint.yml@latest
diff --git a/.github/workflows/changerelease.yml b/.github/workflows/changerelease.yml
index 111ba97..135b42d 100644
--- a/.github/workflows/changerelease.yml
+++ b/.github/workflows/changerelease.yml
@@ -6,6 +6,6 @@ on:
jobs:
changerelease:
- uses: donavanbecker/.github/.github/workflows/changerelease.yml@latest
+ uses: homebridge/.github/.github/workflows/change-release.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml
deleted file mode 100644
index 525d2b2..0000000
--- a/.github/workflows/dependabot.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: AutoDependabot
-
-on:
- pull_request:
- branches: [ beta, latest ]
- pull_request_target:
- branches: [ beta, latest ]
-
-jobs:
- dependabot:
- uses: donavanbecker/.github/.github/workflows/dependabot.yml@latest
- secrets:
- token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index 6eb3c01..d3af51c 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -4,6 +4,6 @@ on: [pull_request]
jobs:
labeler:
- uses: donavanbecker/.github/.github/workflows/labeler.yml@latest
+ uses: homebridge/.github/.github/workflows/labeler.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
index 48588fc..6037dec 100644
--- a/.github/workflows/release-drafter.yml
+++ b/.github/workflows/release-drafter.yml
@@ -9,6 +9,6 @@ on:
jobs:
release-drafter:
- uses: donavanbecker/.github/.github/workflows/release-drafter.yml@latest
+ uses: homebridge/.github/.github/workflows/release-drafter.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 32a9ecf..4f07d58 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -6,7 +6,7 @@ on:
jobs:
build_and_test:
- uses: donavanbecker/.github/.github/workflows/nodejs-build-and-test.yml@latest
+ uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
enable_coverage: true
secrets:
@@ -14,22 +14,22 @@ jobs:
publish:
needs: build_and_test
-
if: ${{ github.repository == 'homebridge-plugins/homebridge-august' }}
-
- uses: donavanbecker/.github/.github/workflows/npm-publish.yml@latest
+ permissions:
+ id-token: write
+ uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
secrets:
npm_auth_token: ${{ secrets.npm_token }}
github-releases-to-discord:
- needs: publish
-
+ name: Discord Webhooks
+ needs: [build_and_test,publish]
if: ${{ github.repository == 'homebridge-plugins/homebridge-august' }}
-
- uses: donavanbecker/.github/.github/workflows/discord-webhooks.yml@latest
+ uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
- message_title: "August"
- message_url: "https://github.com/homebridge-plugins/homebridge-august/releases/tag/v${{ github.event.release.tag_name }}"
+ title: "August Release"
+ description: |
+ Version `v${{ needs.publish.outputs.NPM_VERSION }}`
+ url: "https://github.com/homebridge-plugins/homebridge-august/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
secrets:
- DISCORD_WEBHOOK_URL_LATEST: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }}
- DISCORD_WEBHOOK_URL_BETA: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }}
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }}
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index f07b234..2683a78 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -7,6 +7,6 @@ on:
jobs:
stale:
- uses: donavanbecker/.github/.github/workflows/stale.yml@latest
+ uses: homebridge/.github/.github/workflows/stale.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/src/devices/device.ts b/src/devices/device.ts
index e01a13a..b0dfb4f 100644
--- a/src/devices/device.ts
+++ b/src/devices/device.ts
@@ -47,12 +47,12 @@ export abstract class deviceBase {
}
async getDeviceLogSettings(accessory: PlatformAccessory, device: device & devicesConfig): Promise {
- this.deviceLogging = this.platform.debugMode ? 'debugMode' : device.logging ?? this.config.options?.logging ?? 'standard'
+ this.deviceLogging = this.platform.debugMode ? 'debugMode' : device.logging ?? this.platform.platformLogging ?? 'standard'
const logging = this.platform.debugMode
? 'debugMode'
: device.logging
? 'Device Config'
- : this.config.options?.logging
+ : this.platform.platformLogging
? 'Platform Confg'
: 'Default'
accessory.context.logging = this.deviceLogging
@@ -61,24 +61,24 @@ export abstract class deviceBase {
async getDeviceRateSettings(accessory: PlatformAccessory, device: device & devicesConfig): Promise {
// refreshRate
- this.deviceRefreshRate = device.refreshRate === 0 ? 0 : device.refreshRate ?? this.config.options?.refreshRate ?? 30
+ this.deviceRefreshRate = device.refreshRate === 0 ? 0 : device.refreshRate ?? this.platform.platformRefreshRate ?? 30
const refreshRate = device.refreshRate === 0
? 'Disabled'
: device.refreshRate
? 'Device Config'
- : this.config.options?.refreshRate
+ : this.platform.platformRefreshRate
? 'Platform Config'
: 'Default'
accessory.context.deviceRefreshRate = this.deviceRefreshRate
await this.debugLog(`Using ${refreshRate} refreshRate`)
// updateRate
- this.deviceUpdateRate = device.updateRate ?? this.config.options?.updateRate ?? 5
- const updateRate = device.updateRate ? 'Device Config' : this.config.options?.updateRate ? 'Platform Config' : 'Default'
+ this.deviceUpdateRate = device.updateRate ?? this.platform.platformUpdateRate ?? 5
+ const updateRate = device.updateRate ? 'Device Config' : this.platform.platformUpdateRate ? 'Platform Config' : 'Default'
accessory.context.deviceUpdateRate = this.deviceUpdateRate
await this.debugLog(`Using ${updateRate} updateRate`)
// pushRate
- this.devicePushRate = device.pushRate ?? this.config.options?.pushRate ?? 1
- const pushRate = device.pushRate ? 'Device Config' : this.config.options?.pushRate ? 'Platform Config' : 'Default'
+ this.devicePushRate = device.pushRate ?? this.platform.platformPushRate ?? 1
+ const pushRate = device.pushRate ? 'Device Config' : this.platform.platformPushRate ? 'Platform Config' : 'Default'
accessory.context.devicePushRate = this.devicePushRate
await this.debugLog(`Using ${pushRate} pushRate`)
}
From 8714bfbb4dfc0ada7f8f1bfe1ffb51f174e22c92 Mon Sep 17 00:00:00 2001
From: Donavan Becker
Date: Fri, 1 Nov 2024 16:43:41 -0500
Subject: [PATCH 4/7] Update platform.ts
---
src/platform.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/platform.ts b/src/platform.ts
index 1eb0b5a..d490e0b 100644
--- a/src/platform.ts
+++ b/src/platform.ts
@@ -61,9 +61,9 @@ export class AugustPlatform implements DynamicPlatformPlugin {
}
// Plugin Configuration
- this.getPlatformConfigSettings()
- this.getPlatformRateSettings()
this.getPlatformLogSettings()
+ this.getPlatformRateSettings()
+ this.getPlatformConfigSettings()
this.getVersion()
// Finish initializing the platform
From bb5f0663f6e48b182c8cf9fda7f9f098207ff85f Mon Sep 17 00:00:00 2001
From: Donavan Becker
Date: Sat, 2 Nov 2024 08:20:37 -0500
Subject: [PATCH 5/7] disable coverage
---
.github/workflows/beta-release.yml | 4 ++--
.github/workflows/build.yml | 2 +-
.github/workflows/release.yml | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml
index d1b9ea7..8cfbd81 100644
--- a/.github/workflows/beta-release.yml
+++ b/.github/workflows/beta-release.yml
@@ -1,4 +1,4 @@
-name: Node-CI Beta
+name: Beta Release
on:
push:
@@ -9,7 +9,7 @@ jobs:
build_and_test:
uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
- enable_coverage: true
+ enable_coverage: false
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
lint:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8fbf227..7087a78 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -10,7 +10,7 @@ jobs:
build_and_test:
uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
- enable_coverage: true
+ enable_coverage: false
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
lint:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4f07d58..8df1555 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,4 +1,4 @@
-name: Node Release
+name: Release
on:
release:
@@ -8,7 +8,7 @@ jobs:
build_and_test:
uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
- enable_coverage: true
+ enable_coverage: false
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
From 539fdf64492e2fe0ed80884abdea30d99473bd98 Mon Sep 17 00:00:00 2001
From: Donavan Becker
Date: Sat, 2 Nov 2024 08:43:22 -0500
Subject: [PATCH 6/7] cleanup
---
docs/functions/default.html | 2 +-
package-lock.json | 70 ++++++++++++++++++++++---------------
package.json | 7 ++--
3 files changed, 46 insertions(+), 33 deletions(-)
diff --git a/docs/functions/default.html b/docs/functions/default.html
index fc246a6..34bad5e 100644
--- a/docs/functions/default.html
+++ b/docs/functions/default.html
@@ -1 +1 @@
-default | @homebridge-plugins/homebridge-august- default(api): void
Returns void
+default | @homebridge-plugins/homebridge-august- default(api): void
Returns void
diff --git a/package-lock.json b/package-lock.json
index bf3718e..61da525 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -34,7 +34,7 @@
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@vitest/coverage-v8": "^2.1.4",
- "eslint": "^9.13.0",
+ "eslint": "^9.14.0",
"eslint-plugin-format": "^0.1.2",
"homebridge": "^1.8.5",
"homebridge-config-ui-x": "4.62.0",
@@ -43,12 +43,12 @@
"npm-check-updates": "^17.1.9",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
- "typedoc": "^0.26.10",
+ "typedoc": "^0.26.11",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
},
"engines": {
- "homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.11 || ^2.0.0-alpha.10",
+ "homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.23 || ^2.0.0-alpha.37",
"node": "^20 || ^22"
}
},
@@ -3038,9 +3038,9 @@
}
},
"node_modules/@eslint/js": {
- "version": "9.13.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz",
- "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==",
+ "version": "9.14.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz",
+ "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3403,6 +3403,20 @@
"node": ">=18.18.0"
}
},
+ "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz",
+ "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
"node_modules/@humanwhocodes/module-importer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
@@ -3418,9 +3432,9 @@
}
},
"node_modules/@humanwhocodes/retry": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz",
- "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.0.tgz",
+ "integrity": "sha512-xnRgu9DxZbkWak/te3fcytNyp8MTbuiZIaueg2rgEvBuN55n04nwLYLU9TX/VVlusc9L2ZNXi99nUFNkHXtr5g==",
"dev": true,
"license": "Apache-2.0",
"engines": {
@@ -5118,9 +5132,9 @@
"license": "MIT"
},
"node_modules/@stylistic/eslint-plugin": {
- "version": "2.10.0",
- "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.10.0.tgz",
- "integrity": "sha512-neWEgjp0qKxutbrKac5g23V5LX2c2Clyiz3zFxxybY8VSMfr+MmvwM204zg8YFbe9n2zcTwkpppCL2luwYcMhg==",
+ "version": "2.10.1",
+ "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.10.1.tgz",
+ "integrity": "sha512-U+4yzNXElTf9q0kEfnloI9XbOyD4cnEQCxjUI94q0+W++0GAEQvJ/slwEj9lwjDHfGADRSr+Tco/z0XJvmDfCQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -8356,22 +8370,22 @@
}
},
"node_modules/eslint": {
- "version": "9.13.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz",
- "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==",
+ "version": "9.14.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz",
+ "integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.11.0",
+ "@eslint-community/regexpp": "^4.12.1",
"@eslint/config-array": "^0.18.0",
"@eslint/core": "^0.7.0",
"@eslint/eslintrc": "^3.1.0",
- "@eslint/js": "9.13.0",
+ "@eslint/js": "9.14.0",
"@eslint/plugin-kit": "^0.2.0",
- "@humanfs/node": "^0.16.5",
+ "@humanfs/node": "^0.16.6",
"@humanwhocodes/module-importer": "^1.0.1",
- "@humanwhocodes/retry": "^0.3.1",
+ "@humanwhocodes/retry": "^0.4.0",
"@types/estree": "^1.0.6",
"@types/json-schema": "^7.0.15",
"ajv": "^6.12.4",
@@ -8379,9 +8393,9 @@
"cross-spawn": "^7.0.2",
"debug": "^4.3.2",
"escape-string-regexp": "^4.0.0",
- "eslint-scope": "^8.1.0",
- "eslint-visitor-keys": "^4.1.0",
- "espree": "^10.2.0",
+ "eslint-scope": "^8.2.0",
+ "eslint-visitor-keys": "^4.2.0",
+ "espree": "^10.3.0",
"esquery": "^1.5.0",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
@@ -16143,9 +16157,9 @@
}
},
"node_modules/regex": {
- "version": "4.3.3",
- "resolved": "https://registry.npmjs.org/regex/-/regex-4.3.3.tgz",
- "integrity": "sha512-r/AadFO7owAq1QJVeZ/nq9jNS1vyZt+6t1p/E59B56Rn2GCya+gr1KSyOzNL/er+r+B7phv5jG2xU2Nz1YkmJg==",
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/regex/-/regex-4.4.0.tgz",
+ "integrity": "sha512-uCUSuobNVeqUupowbdZub6ggI5/JZkYyJdDogddJr60L764oxC2pMZov1fQ3wM9bdyzUILDG+Sqx6NAKAz9rKQ==",
"dev": true,
"license": "MIT"
},
@@ -18286,9 +18300,9 @@
}
},
"node_modules/typedoc": {
- "version": "0.26.10",
- "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.10.tgz",
- "integrity": "sha512-xLmVKJ8S21t+JeuQLNueebEuTVphx6IrP06CdV7+0WVflUSW3SPmR+h1fnWVdAR/FQePEgsSWCUHXqKKjzuUAw==",
+ "version": "0.26.11",
+ "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.11.tgz",
+ "integrity": "sha512-sFEgRRtrcDl2FxVP58Ze++ZK2UQAEvtvvH8rRlig1Ja3o7dDaMHmaBfvJmdGnNEFaLTpQsN8dpvZaTqJSu/Ugw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
diff --git a/package.json b/package.json
index 3808b61..5bc38c0 100644
--- a/package.json
+++ b/package.json
@@ -37,9 +37,8 @@
"lock"
],
"main": "dist/index.js",
- "icon": "https://raw.githubusercontent.com/homebridge-plugins/homebridge-august/beta-1.3.2/branding/icon.png",
"engines": {
- "homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.11 || ^2.0.0-alpha.10",
+ "homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.23 || ^2.0.0-alpha.37",
"node": "^20 || ^22"
},
"scripts": {
@@ -76,7 +75,7 @@
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@vitest/coverage-v8": "^2.1.4",
- "eslint": "^9.13.0",
+ "eslint": "^9.14.0",
"eslint-plugin-format": "^0.1.2",
"homebridge": "^1.8.5",
"homebridge-config-ui-x": "4.62.0",
@@ -85,7 +84,7 @@
"npm-check-updates": "^17.1.9",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
- "typedoc": "^0.26.10",
+ "typedoc": "^0.26.11",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
}
From 8abbb2a4f2c939ace89a5f10e784b0a152c558b8 Mon Sep 17 00:00:00 2001
From: Donavan Becker
Date: Sun, 3 Nov 2024 23:06:10 -0600
Subject: [PATCH 7/7] v2.2.8
## [2.2.8](https://github.com/homebridge-plugins/homebridge-august/releases/tag/v2.2.8) (2024-11-03)
### What's Changes
- Housekeeping and updated dependencies.
**Full Changelog**: https://github.com/homebridge-plugins/homebridge-august/compare/v2.2.7...v2.2.8
---
CHANGELOG.md | 7 +++++++
package-lock.json | 40 ++++++++++++++++++++--------------------
package.json | 11 +++++------
src/index.ts | 13 ++++++-------
tsconfig.json | 18 +++++++++---------
5 files changed, 47 insertions(+), 42 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index be0cc0a..e65d74c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/)
+## [2.2.8](https://github.com/homebridge-plugins/homebridge-august/releases/tag/v2.2.8) (2024-11-03)
+
+### What's Changes
+- Housekeeping and updated dependencies.
+
+**Full Changelog**: https://github.com/homebridge-plugins/homebridge-august/compare/v2.2.7...v2.2.8
+
## [2.2.7](https://github.com/homebridge-plugins/homebridge-august/releases/tag/v2.2.7) (2024-09-25)
### What's Changes
diff --git a/package-lock.json b/package-lock.json
index 61da525..c40a435 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
- "name": "@homebridge-plugins/homebridge-august",
- "version": "2.2.7",
+ "name": "homebridge-august",
+ "version": "2.2.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "@homebridge-plugins/homebridge-august",
- "version": "2.2.7",
+ "name": "homebridge-august",
+ "version": "2.2.8",
"funding": [
{
"type": "Paypal",
@@ -20,7 +20,7 @@
"license": "ISC",
"dependencies": {
"@homebridge/plugin-ui-utils": "^1.0.3",
- "august-yale": "^1.1.0",
+ "august-yale": "^1.1.1",
"rxjs": "^7.8.1"
},
"devDependencies": {
@@ -30,7 +30,7 @@
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.14",
"@types/mdast": "^4.0.4",
- "@types/node": "^22.8.6",
+ "@types/node": "^22.8.7",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@vitest/coverage-v8": "^2.1.4",
@@ -40,7 +40,7 @@
"homebridge-config-ui-x": "4.62.0",
"jest": "^29.7.0",
"nodemon": "^3.1.7",
- "npm-check-updates": "^17.1.9",
+ "npm-check-updates": "^17.1.10",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
"typedoc": "^0.26.11",
@@ -5377,9 +5377,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
- "version": "22.8.6",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.6.tgz",
- "integrity": "sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==",
+ "version": "22.8.7",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.7.tgz",
+ "integrity": "sha512-LidcG+2UeYIWcMuMUpBKOnryBWG/rnmOHQR5apjn8myTQcx3rinFRn7DcIFhMnS0PPFSC6OafdIKEad0lj6U0Q==",
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.8"
@@ -6238,9 +6238,9 @@
}
},
"node_modules/august-yale": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/august-yale/-/august-yale-1.1.0.tgz",
- "integrity": "sha512-koP3fHUa5bJcuDj+ajSJ/Z5zahqnEhofF9qPDbn0n1EJa5X+q110uS2X/UNzeffbfG+R5tZffJPBImEBOQkibQ==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/august-yale/-/august-yale-1.1.1.tgz",
+ "integrity": "sha512-Ln/QNmrjrq4gN7Fo+amYSJjeCqmZgW6QgdoyWn6dySlssYuCKFVtphBifCpjftZYmhJeuhuLQ+EvWznBbLxdBg==",
"funding": [
{
"type": "Paypal - donavanbecker",
@@ -6253,7 +6253,7 @@
],
"license": "ISC",
"dependencies": {
- "pubnub": "^8.2.6",
+ "pubnub": "^8.2.10",
"tiny-json-http": "^7.5.1"
},
"engines": {
@@ -6878,9 +6878,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001676",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001676.tgz",
- "integrity": "sha512-Qz6zwGCiPghQXGJvgQAem79esjitvJ+CxSbSQkW9H/UX5hg8XM88d4lp2W+MEQ81j+Hip58Il+jGVdazk1z9cw==",
+ "version": "1.0.30001677",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001677.tgz",
+ "integrity": "sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==",
"funding": [
{
"type": "opencollective",
@@ -14519,9 +14519,9 @@
}
},
"node_modules/npm-check-updates": {
- "version": "17.1.9",
- "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-17.1.9.tgz",
- "integrity": "sha512-Gfv5S8NNJKTilM1gesFNYka6bUaBs5LnVyPjApXPQphHijrlLFDMw1uSmwYMZbvJSkLZSOx03e8CHcG0Td5SMA==",
+ "version": "17.1.10",
+ "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-17.1.10.tgz",
+ "integrity": "sha512-GnN6KbUzC8BpwsRYJntuumgCiagZ0+xxorvUJM9m06d7AlyK9lm3iFsAsnXF3VAZZzpD5QjZvWBwNze61Vywkw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
diff --git a/package.json b/package.json
index 5bc38c0..cd57d6c 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
{
- "name": "@homebridge-plugins/homebridge-august",
+ "name": "homebridge-august",
"displayName": "August",
"type": "module",
- "version": "2.2.7",
+ "version": "2.2.8",
"description": "The August plugin allows you to access your August & Yale device(s) from HomeKit.",
"author": {
"name": "donavanbecker",
@@ -43,7 +43,6 @@
},
"scripts": {
"check": "npm install && npm outdated",
- "update": "ncu -u && npm update && npm install",
"lint": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix",
"watch": "npm run build && npm run plugin-ui && npm link && nodemon",
@@ -61,7 +60,7 @@
},
"dependencies": {
"@homebridge/plugin-ui-utils": "^1.0.3",
- "august-yale": "^1.1.0",
+ "august-yale": "^1.1.1",
"rxjs": "^7.8.1"
},
"devDependencies": {
@@ -71,7 +70,7 @@
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.14",
"@types/mdast": "^4.0.4",
- "@types/node": "^22.8.6",
+ "@types/node": "^22.8.7",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@vitest/coverage-v8": "^2.1.4",
@@ -81,7 +80,7 @@
"homebridge-config-ui-x": "4.62.0",
"jest": "^29.7.0",
"nodemon": "^3.1.7",
- "npm-check-updates": "^17.1.9",
+ "npm-check-updates": "^17.1.10",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
"typedoc": "^0.26.11",
diff --git a/src/index.ts b/src/index.ts
index a9b1ab3..c39f0b1 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,14 +1,13 @@
+import type { API } from 'homebridge'
+
/* Copyright(C) 2017-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* index.ts: homebridge-august.
*/
-import { AugustPlatform } from './platform.js';
-import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js';
-
-import type { API } from 'homebridge';
+import { AugustPlatform } from './platform.js'
+import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js'
// Register our platform with homebridge.
export default (api: API): void => {
-
- api.registerPlatform(PLUGIN_NAME, PLATFORM_NAME, AugustPlatform);
-};
+ api.registerPlatform(PLUGIN_NAME, PLATFORM_NAME, AugustPlatform)
+}
diff --git a/tsconfig.json b/tsconfig.json
index b5ad9a3..53abb89 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"target": "ES2022",
- "module": "ES2022",
"lib": [
"DOM",
"ES2022"
],
- "declaration": true,
- "declarationMap": true,
- "sourceMap": true,
- "outDir": "dist",
"rootDir": "src",
+ "module": "ES2022",
+ "moduleResolution": "node",
"strict": true,
- "esModuleInterop": true,
"noImplicitAny": false,
+ "declaration": true,
+ "declarationMap": true,
+ "outDir": "dist",
+ "sourceMap": true,
"allowSyntheticDefaultImports": true,
- "forceConsistentCasingInFileNames": true,
- "moduleResolution": "node",
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true
},
"include": [
"src"
@@ -24,4 +24,4 @@
"exclude": [
"**/*.spec.ts"
]
-}
\ No newline at end of file
+}