diff --git a/.drone.yml b/.drone.yml index 6f77b97..cbb0a0f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,7 +18,37 @@ steps: - npm install - npm run build - - name: publish + - name: version + image: node + 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 + when: + event: + exclude: + - tag + - pull_request + include: + - master + + - 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 + - pull_request + include: + - master + + - name: publish tagged version image: plugins/npm settings: username: admin @@ -29,6 +59,8 @@ steps: when: event: - tag + exclude: + - pull_request notify: image: drillster/drone-email 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 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/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; +} 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[] = [];