From d3c37b18b9576b9d485d80c7923e92dfcb2fe808 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Wed, 2 Jun 2021 21:22:35 -0400 Subject: [PATCH 01/14] Updating registry path --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e6df741..ddc4003 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Homebridge platform to control smart home equipment by room.", "main": "bin/index.js", "publishConfig": { - "registry": "http://10.22.1.31:4873/" + "registry": "http://linuxhost.me:4873/" }, "scripts": { "build": "tsc --build", -- 2.45.2 From ed06d7ecd0ccf8fb9651c8ba2a879c2abe1d2828 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Wed, 2 Jun 2021 21:23:46 -0400 Subject: [PATCH 02/14] WIP --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index cacb59d..6f77b97 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,7 +25,7 @@ steps: password: from_secret: npm_password email: brandon@watsonlabs.net - registry: "http://linuxhost.me:4873" + registry: "http://linuxhost.me:4873/" when: event: - tag -- 2.45.2 From 027d1711ada5485bf7091f217bb5ce6e967c89b4 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Wed, 2 Jun 2021 21:36:07 -0400 Subject: [PATCH 03/14] Removing bash_profile --- .bash_profile | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .bash_profile diff --git a/.bash_profile b/.bash_profile deleted file mode 100644 index ac94b8c..0000000 --- a/.bash_profile +++ /dev/null @@ -1 +0,0 @@ -source /nvm.sh -- 2.45.2 From d1a3b802938ee213c8d03867730ec260688b20e0 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Wed, 2 Jun 2021 21:57:22 -0400 Subject: [PATCH 04/14] Using email alias --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 6f77b97..773b956 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: username: admin password: from_secret: npm_password - email: brandon@watsonlabs.net + email: b.watson@watsonlabs.net registry: "http://linuxhost.me:4873/" when: event: -- 2.45.2 From b6d9317a1e4ff2056fb5efd48a8f02a7b1d35a64 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Wed, 2 Jun 2021 21:58:35 -0400 Subject: [PATCH 05/14] Revert "Using email alias" This reverts commit d1a3b802938ee213c8d03867730ec260688b20e0. --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 773b956..6f77b97 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: username: admin password: from_secret: npm_password - email: b.watson@watsonlabs.net + email: brandon@watsonlabs.net registry: "http://linuxhost.me:4873/" when: event: -- 2.45.2 From 6c8ce2116477214ba1e09a9a97a190b0b4633dc8 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:03:41 -0400 Subject: [PATCH 06/14] Updating drone config --- .drone.yml | 23 +++++++++++++++++++++++ deploy.sh | 22 ---------------------- harmony.code-workspace | 5 ++++- 3 files changed, 27 insertions(+), 23 deletions(-) delete mode 100755 deploy.sh diff --git a/.drone.yml b/.drone.yml index 6f77b97..d465ae5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,6 +18,29 @@ steps: - npm install - npm run build + - name: version + image: node + commands: + - export version=`node -p "require('./package.json').version"` + - npm version $version --preid=pre --commit-hooks=false --git-tag-version=false --allow-same-version=true + when: + event: + exclude: + - tag + + - name: publish pre + image: plugins/npm + settings: + username: admin + password: + from_secret: npm_password + email: brandon@watsonlabs.net + registry: "http://linuxhost.me:4873/" + when: + event: + exclude: + - tag + - name: publish image: plugins/npm settings: diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 4c0f7d3..0000000 --- a/deploy.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -remote_user="bmw" -remote_server="linuxhost.me" -deploy_location="/home/bmw/homebridge-harmony-control" -homebridge_location="/var/lib/homebridge/" - -#build -tsc --build -#copy files to remote machine -scp -r bin $remote_user@$remote_server:$deploy_location -scp package.json $remote_user@$remote_server:$deploy_location - -#install package -ssh -t $remote_user@$remote_server "sudo npm install -g --unsafe-perm $deploy_location" - -#restart service -ssh -t -ssh -t $remote_user@$remote_server "sudo systemctl restart homebridge.service" -ssh -t $remote_user@$remote_server "sudo systemctl status homebridge.service" - -echo done -exit diff --git a/harmony.code-workspace b/harmony.code-workspace index 362d7c2..50a3257 100644 --- a/harmony.code-workspace +++ b/harmony.code-workspace @@ -3,5 +3,8 @@ { "path": "." } - ] + ], + "settings": { + "editor.tabSize": 2 + } } \ No newline at end of file -- 2.45.2 From 34fcc1df1aa2aa954e647e62e3ccfebbc0b9dc9e Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:14:33 -0400 Subject: [PATCH 07/14] Updating pre-release command --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index d465ae5..e4e867c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ steps: image: node commands: - export version=`node -p "require('./package.json').version"` - - npm version $version --preid=pre --commit-hooks=false --git-tag-version=false --allow-same-version=true + - npm version prerelease --preid=pre --git-tag-version=false --allow-same-version=true when: event: exclude: -- 2.45.2 From d8a5e7541d437d8208c75a4ba80f34bfc572194a Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:16:11 -0400 Subject: [PATCH 08/14] Prettier --- src/Models/Config/IConfig.ts | 24 +++++++++++++----------- src/platform.ts | 6 +++--- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/Models/Config/IConfig.ts b/src/Models/Config/IConfig.ts index 2c1e9b0..95832e8 100644 --- a/src/Models/Config/IConfig.ts +++ b/src/Models/Config/IConfig.ts @@ -2,19 +2,21 @@ import { IMatrix } from "./IMatrix"; import { IActivity } from "./IActivity"; import { IDeviceButton } from "./IDeviceButton"; import { IDeviceConfig } from "./IDeviceConfig"; -import { IHub } from './IHub'; +import { IHub } from "./IHub"; +import { ISequence } from "./ISequence"; export interface IControlUnit { - DisplayName: string; - Activities: Array; + DisplayName: string; + Activities: Array; } export interface IConfig { - hubIp: string; - EmitDevicesOnStartup: boolean; - Matrix: IMatrix; - ControlUnits: Array; - DeviceButtons: Array; - Devices: Array; - Hubs: Array; -} \ No newline at end of file + hubIp: string; + EmitDevicesOnStartup: boolean; + Matrix: IMatrix; + ControlUnits: Array; + DeviceButtons: Array; + Sequences: Array; + Devices: Array; + Hubs: Array; +} diff --git a/src/platform.ts b/src/platform.ts index ef24806..3614aaf 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -22,7 +22,7 @@ export class Platform implements DynamicPlatformPlugin { ) { this.log.debug("Finished initializing platform:", config.name); - this.config = (config as unknown) as IConfig; + this.config = config as unknown as IConfig; //construct data provider const dataProvider = new HarmonyDataProvider({ hubs: this.config.Hubs, @@ -70,8 +70,8 @@ export class Platform implements DynamicPlatformPlugin { } public readonly Service: typeof Service = this.api.hap.Service; - public readonly Characteristic: typeof Characteristic = this.api.hap - .Characteristic; + public readonly Characteristic: typeof Characteristic = + this.api.hap.Characteristic; // this is used to track restored cached accessories public readonly accessories: PlatformAccessory[] = []; -- 2.45.2 From c60387a98746f1fb5dbd4244fedfed95e065a1ef Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:16:46 -0400 Subject: [PATCH 09/14] Adding sequence file --- src/Models/Config/ISequence.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/Models/Config/ISequence.ts diff --git a/src/Models/Config/ISequence.ts b/src/Models/Config/ISequence.ts new file mode 100644 index 0000000..9ea26c3 --- /dev/null +++ b/src/Models/Config/ISequence.ts @@ -0,0 +1,10 @@ +export interface ISequence { + name: string; + steps: Array; +} + +export interface IStep { + deviceName: string; + deviceCommand: string; + delay: number; +} -- 2.45.2 From 6d3cd651be3a5aeae97a3aa94901c8eb97c05591 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:30:18 -0400 Subject: [PATCH 10/14] Attempting to use drone commit in preid --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index e4e867c..4bfea09 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ steps: image: node commands: - export version=`node -p "require('./package.json').version"` - - npm version prerelease --preid=pre --git-tag-version=false --allow-same-version=true + - npm version prerelease --preid=`$DRONE_COMMIT | cut -c1-5` --git-tag-version=false --allow-same-version=true when: event: exclude: -- 2.45.2 From ecc54ad3c30a0f6e781561787f74bdd2b556fc17 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:35:29 -0400 Subject: [PATCH 11/14] WIP --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 4bfea09..627769b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,8 @@ steps: image: node commands: - export version=`node -p "require('./package.json').version"` - - npm version prerelease --preid=`$DRONE_COMMIT | cut -c1-5` --git-tag-version=false --allow-same-version=true + - export commit=`echo $DRONE_COMMIT | cut -c1-5` + - npm version prerelease --preid=commit --git-tag-version=false --allow-same-version=true when: event: exclude: -- 2.45.2 From 57e82789fbe3de9a0da2d87a30dd01b3736d1478 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:36:16 -0400 Subject: [PATCH 12/14] WIP --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 627769b..5fc525e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,7 +23,7 @@ steps: commands: - export version=`node -p "require('./package.json').version"` - export commit=`echo $DRONE_COMMIT | cut -c1-5` - - npm version prerelease --preid=commit --git-tag-version=false --allow-same-version=true + - npm version prerelease --preid=$commit --git-tag-version=false --allow-same-version=true when: event: exclude: -- 2.45.2 From 496dd42cfda82308185eb7cd52a300a7484d9053 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:38:37 -0400 Subject: [PATCH 13/14] Only publishing master branch --- .drone.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5fc525e..342735f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,6 +28,8 @@ steps: event: exclude: - tag + include: + - master - name: publish pre image: plugins/npm @@ -41,8 +43,10 @@ steps: event: exclude: - tag + include: + - master - - name: publish + - name: publish tagged version image: plugins/npm settings: username: admin -- 2.45.2 From 93132ab8684436e48ae05165193d88ee22f40ced Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 7 Jun 2021 20:40:00 -0400 Subject: [PATCH 14/14] excluding publishing on PRs --- .drone.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.drone.yml b/.drone.yml index 342735f..cbb0a0f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,6 +28,7 @@ steps: event: exclude: - tag + - pull_request include: - master @@ -43,6 +44,7 @@ steps: event: exclude: - tag + - pull_request include: - master @@ -57,6 +59,8 @@ steps: when: event: - tag + exclude: + - pull_request notify: image: drillster/drone-email -- 2.45.2