Compare commits

...

12 Commits

Author SHA1 Message Date
fa0f248011 Removing drone.yml
All checks were successful
Build homebridge-hue-chase / Version (push) Successful in 8s
Build homebridge-hue-chase / Build (push) Successful in 14s
Build homebridge-hue-chase / Publish Latest (push) Successful in 8s
Build homebridge-hue-chase / Deploy (push) Successful in 12s
2024-06-05 20:09:20 -05:00
0bf85afc20 Adding gitea action first pass
All checks were successful
Build homebridge-hue-chase / Version (push) Successful in 7s
Build homebridge-hue-chase / Build (push) Successful in 13s
Build homebridge-hue-chase / Publish Latest (push) Successful in 9s
Build homebridge-hue-chase / Deploy (push) Successful in 11s
Publishing node lib

Adding deploy steps

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP
2024-06-05 20:07:52 -05:00
Brandon Watson
32715c5092 Updating to use gitea npm registry
All checks were successful
continuous-integration/drone Build is passing
2023-01-27 16:20:31 -06:00
Brandon Watson
0541680671 updated drone
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-06 09:06:45 -05:00
Brandon Watson
53506757bf Adding deploy steps
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is failing
2022-01-07 18:57:14 -05:00
Brandon Watson
2fcf0c89bf Fixing unresponsiveness issue
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-03 13:19:16 -05:00
Brandon Watson
8bf06215af Updating drone and package.json
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-29 18:02:35 -05:00
Brandon Watson
22daeb8875 Adding typescript package to dev deps
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-23 16:00:53 -05:00
Brandon Watson
3564a34502 Updating drone config
Some checks failed
continuous-integration/drone/push Build is failing
2021-12-23 15:58:25 -05:00
Brandon Watson
1c56844be2 Adding drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-02 22:12:50 -04:00
Brandon Watson
b65306e3d5 Update 'README.md' 2020-12-20 15:02:49 -05:00
watsonb8
fb63f3cf52 Fixed issue where not all lights are used for chase 2020-04-17 23:32:15 -04:00
6 changed files with 1254 additions and 666 deletions

81
.gitea/workflows/ci.yaml Normal file
View File

@ -0,0 +1,81 @@
name: Build homebridge-hue-chase
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
name: Build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: |
npm ci
npm run build
version:
name: Version
outputs:
version: ${{ steps.get_version.outputs.version }}
commit: ${{ steps.get_version.outputs.commit }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- id: get_version
name: Set Version
run: |
export version=`node -p "require('./package.json').version"`
export commit=`echo $GITHUB_SHA | cut -c1-5`
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "commit=$commit" >> "$GITHUB_OUTPUT"
publish_tagged:
name: Publish Latest
needs:
- build
- version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm config set @watsonb8:registry https://gitea.watsonlabs.net/api/packages/watsonb8/npm/
- name: Publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
COMMIT: ${{ needs.version.outputs.commit }}
run: |
npm config set -- '//gitea.watsonlabs.net/api/packages/watsonb8/npm/:_authToken' "$NPM_TOKEN"
npm version prerelease --preid="$COMMIT" --git-tag-version=false --allow-same-version=true
npm publish
deploy:
runs-on:
- ubuntu-latest
- internal
name: Deploy
needs: publish_tagged
steps:
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.ELEVATED_HOMEBRIDGE_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -p 22 homebridge.me >> ~/.ssh/known_hosts
sudo apt update
sudo apt install sshpass
- name: Remove old Package
run: |
sshpass -p '${{ secrets.ELEVATED_HOMEBRIDGE_PASSWORD }}' ssh -v -o StrictHostKeyChecking=no ${{ secrets.ELEVATED_HOMEBRIDGE_USER }}@${{ secrets.HOMEBRIDGE_HOST }} <<'ENDSSH'
rm -r /home/${{ secrets.HOMEBRIDGE_USER }}/.npm-global/lib/node_modules/@watsonb8/homebridge-hue-chase
ENDSSH
- name: Deploy
run: |
sshpass -p '${{ secrets.ELEVATED_HOMEBRIDGE_PASSWORD }}' ssh -v -o StrictHostKeyChecking=no ${{ secrets.ELEVATED_HOMEBRIDGE_USER }}@${{ secrets.HOMEBRIDGE_HOST }} <<'ENDSSH'
npm install -g @watsonb8/homebridge-hue-chase
ENDSSH

View File

@ -0,0 +1,56 @@
# homebridge-hue-chase
Homebridge-hue-chase is a good way to add a little spice to your home lighting set up. This simple plugin will cycle the colors of any given hue lights.
## Installation
1. Clone the repository by running `git clone ssh://git@thebword.ddns.net:3122/watsonb8/homebridge-hue-chase.git`
2. Run `npm install` to install required modules
3. Run `npm run build` to build the module
4. Run `npm link` or install globally to link this instance to your global homebridge instance
> NOTE: Upon starting this plugin for the first time, you will be asked to press the sync button on your hue bridge
## Configuration
```
{
"platform": "HueChase",
"ipAddress": "example.com",
"userName": "",
"clientKey": "",
"sequences": [
{
"name": "Play Sequence",
"transitionTime": 60000,
"matchAllLights": false,
"colors": ["#00e456", "#21adea", "#f14cfc", "#8c4cfc", "#e40098"],
"lights": ["Play left", "Play right"]
},
]
}
```
#### Platform
- `ipAddress`: The ipaddres or host name of the hue hub
- `userName`: The userName to use when authenticating with the hue hub
> NOTE: This will be visible in the console upon first run of the platform
- `clientKey`: This clientKey to use when authenticating with the hue hub
> NOTE: This will be visible in the console upon first run of the platform
- `sequences`: A list of sequence objects
#### sequences
- `name`: The name of the sequence. This will be the label of the enable switch
- `transitionTime`: The amount of time in milliseconds it will take to transition from one color to the next
- `colors`: A list hex colors
- `lights`: The list of lights to use in the sequence

596
package-lock.json generated
View File

@ -1,9 +1,15 @@
{ {
"name": "homebridge-hue-chase", "name": "@watsonb8/homebridge-hue-chase",
"version": "1.0.0", "version": "1.1.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@leichtgewicht/ip-codec": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.3.tgz",
"integrity": "sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg==",
"dev": true
},
"@types/node": { "@types/node": {
"version": "13.1.2", "version": "13.1.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.2.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.2.tgz",
@ -20,17 +26,26 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
}, },
"ansi-styles": { "ansi-styles": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
"dev": true
}, },
"array-flatten": { "array-flatten": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz",
"integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==" "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==",
"dev": true
},
"available-typed-arrays": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
"integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
"dev": true
}, },
"axios": { "axios": {
"version": "0.19.0", "version": "0.19.0",
@ -42,15 +57,15 @@
} }
}, },
"bonjour-hap": { "bonjour-hap": {
"version": "3.5.4", "version": "3.6.3",
"resolved": "https://registry.npmjs.org/bonjour-hap/-/bonjour-hap-3.5.4.tgz", "resolved": "https://registry.npmjs.org/bonjour-hap/-/bonjour-hap-3.6.3.tgz",
"integrity": "sha512-MgU27SEZYQ09Skm71Xa7SZoAg259V4IlAJNWaloFVMlYDn1OjJy3nkwSixRHnDzrcLWocVI84f9exI1ObZChBw==", "integrity": "sha512-qyLU96ICCYbpOFiMCjA3aNYH5Jc83XH1YX6+EXWukyyiNXzXH2LZv8AVmGW33FceF3gfUM4jYoKX2xChtNDUnA==",
"dev": true,
"requires": { "requires": {
"array-flatten": "^2.1.0", "array-flatten": "^2.1.2",
"deep-equal": "^1.0.1", "deep-equal": "^2.0.5",
"dns-equal": "^1.0.0", "ip": "^1.1.5",
"dns-txt": "^2.0.2", "multicast-dns": "^7.2.3",
"multicast-dns": "^7.2.0",
"multicast-dns-service-types": "^1.1.0" "multicast-dns-service-types": "^1.1.0"
} }
}, },
@ -59,20 +74,27 @@
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
}, },
"buffer-indexof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz",
"integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g=="
},
"buffer-shims": { "buffer-shims": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz",
"integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=",
"dev": true
},
"call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
}
}, },
"chalk": { "chalk": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": { "requires": {
"ansi-styles": "^2.2.1", "ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2", "escape-string-regexp": "^1.0.2",
@ -85,6 +107,7 @@
"version": "2.8.1", "version": "2.8.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
"integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=",
"dev": true,
"requires": { "requires": {
"graceful-readlink": ">= 1.0.0" "graceful-readlink": ">= 1.0.0"
} }
@ -93,6 +116,7 @@
"version": "2.6.9", "version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": { "requires": {
"ms": "2.0.0" "ms": "2.0.0"
} }
@ -100,60 +124,116 @@
"decimal.js": { "decimal.js": {
"version": "7.5.1", "version": "7.5.1",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-7.5.1.tgz", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-7.5.1.tgz",
"integrity": "sha512-1K5Y6MykxQYfHBcFfAj2uBaLmwreq4MsjsvrlgcEOvg+X82IeeXlIVIVkBMiypksu+yo9vcYP6lfU3qTedofSQ==" "integrity": "sha512-1K5Y6MykxQYfHBcFfAj2uBaLmwreq4MsjsvrlgcEOvg+X82IeeXlIVIVkBMiypksu+yo9vcYP6lfU3qTedofSQ==",
"dev": true
}, },
"deep-equal": { "deep-equal": {
"version": "1.1.0", "version": "2.0.5",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0.tgz", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz",
"integrity": "sha512-ZbfWJq/wN1Z273o7mUSjILYqehAktR2NVoSrOukDkU9kg2v/Uv89yU4Cvz8seJeAmtN5oqiefKq8FPuXOboqLw==", "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==",
"dev": true,
"requires": { "requires": {
"call-bind": "^1.0.0",
"es-get-iterator": "^1.1.1",
"get-intrinsic": "^1.0.1",
"is-arguments": "^1.0.4", "is-arguments": "^1.0.4",
"is-date-object": "^1.0.1", "is-date-object": "^1.0.2",
"is-regex": "^1.0.4", "is-regex": "^1.1.1",
"object-is": "^1.0.1", "isarray": "^2.0.5",
"object-is": "^1.1.4",
"object-keys": "^1.1.1", "object-keys": "^1.1.1",
"regexp.prototype.flags": "^1.2.0" "object.assign": "^4.1.2",
"regexp.prototype.flags": "^1.3.0",
"side-channel": "^1.0.3",
"which-boxed-primitive": "^1.0.1",
"which-collection": "^1.0.1",
"which-typed-array": "^1.1.2"
} }
}, },
"define-properties": { "define-properties": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
"integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
"dev": true,
"requires": { "requires": {
"object-keys": "^1.0.12" "object-keys": "^1.0.12"
} }
}, },
"dns-equal": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz",
"integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0="
},
"dns-packet": { "dns-packet": {
"version": "4.2.0", "version": "5.3.1",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-4.2.0.tgz", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.3.1.tgz",
"integrity": "sha512-bn1AKpfkFbm0MIioOMHZ5qJzl2uypdBwI4nYNsqvhjsegBhcKJUlCrMPWLx6JEezRjxZmxhtIz/FkBEur2l8Cw==", "integrity": "sha512-spBwIj0TK0Ey3666GwIdWVfUpLyubpU53BTCu8iPn4r4oXd9O14Hjg3EHw3ts2oed77/SeckunUYCyRlSngqHw==",
"dev": true,
"requires": { "requires": {
"ip": "^1.1.5", "@leichtgewicht/ip-codec": "^2.0.1"
"safe-buffer": "^5.1.1"
} }
}, },
"dns-txt": { "es-abstract": {
"version": "2.0.2", "version": "1.19.1",
"resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz",
"integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==",
"dev": true,
"requires": { "requires": {
"buffer-indexof": "^1.0.0" "call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"get-intrinsic": "^1.1.1",
"get-symbol-description": "^1.0.0",
"has": "^1.0.3",
"has-symbols": "^1.0.2",
"internal-slot": "^1.0.3",
"is-callable": "^1.2.4",
"is-negative-zero": "^2.0.1",
"is-regex": "^1.1.4",
"is-shared-array-buffer": "^1.0.1",
"is-string": "^1.0.7",
"is-weakref": "^1.0.1",
"object-inspect": "^1.11.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
"string.prototype.trimend": "^1.0.4",
"string.prototype.trimstart": "^1.0.4",
"unbox-primitive": "^1.0.1"
}
},
"es-get-iterator": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz",
"integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"get-intrinsic": "^1.1.0",
"has-symbols": "^1.0.1",
"is-arguments": "^1.1.0",
"is-map": "^2.0.2",
"is-set": "^2.0.2",
"is-string": "^1.0.5",
"isarray": "^2.0.5"
}
},
"es-to-primitive": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
"integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
"dev": true,
"requires": {
"is-callable": "^1.1.4",
"is-date-object": "^1.0.1",
"is-symbol": "^1.0.2"
} }
}, },
"escape-string-regexp": { "escape-string-regexp": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
}, },
"fast-srp-hap": { "fast-srp-hap": {
"version": "1.0.1", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/fast-srp-hap/-/fast-srp-hap-1.0.1.tgz", "resolved": "https://registry.npmjs.org/fast-srp-hap/-/fast-srp-hap-1.2.0.tgz",
"integrity": "sha1-N3Ek0Za8alFXquWze/X6NbtK0tk=" "integrity": "sha512-WgC3eJEaQo94pq6Ua+l4zdceMLkDXvhZ4OpyQsFdlTFDH7GwJ6fikr+C/mkKzaIxbnODkqee8cOd0KjuW2ebKQ==",
"dev": true
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.5.10", "version": "1.5.10",
@ -173,25 +253,55 @@
} }
} }
}, },
"foreach": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
"integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=",
"dev": true
},
"function-bind": { "function-bind": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
"get-intrinsic": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1"
}
}, },
"get-ssl-certificate": { "get-ssl-certificate": {
"version": "2.3.3", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/get-ssl-certificate/-/get-ssl-certificate-2.3.3.tgz", "resolved": "https://registry.npmjs.org/get-ssl-certificate/-/get-ssl-certificate-2.3.3.tgz",
"integrity": "sha512-aKYXS1S5+2IYw4W5+lKC/M+lvaNYPe0PhnQ144NWARcBg35H3ZvyVZ6y0LNGtiAxggFBHeO7LaVGO4bgHK4g1Q==" "integrity": "sha512-aKYXS1S5+2IYw4W5+lKC/M+lvaNYPe0PhnQ144NWARcBg35H3ZvyVZ6y0LNGtiAxggFBHeO7LaVGO4bgHK4g1Q=="
}, },
"get-symbol-description": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
"integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"get-intrinsic": "^1.1.1"
}
},
"graceful-readlink": { "graceful-readlink": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
"dev": true
}, },
"hap-nodejs": { "hap-nodejs": {
"version": "0.4.51", "version": "0.4.51",
"resolved": "https://registry.npmjs.org/hap-nodejs/-/hap-nodejs-0.4.51.tgz", "resolved": "https://registry.npmjs.org/hap-nodejs/-/hap-nodejs-0.4.51.tgz",
"integrity": "sha512-d+b0KsakGRC5IgYBBCuqkAFzj8iKAHVw0bKreT8vmhK4b43FTVWiSwi5MWXApoYQUkbPux+xnVYqwMo+Zviieg==", "integrity": "sha512-d+b0KsakGRC5IgYBBCuqkAFzj8iKAHVw0bKreT8vmhK4b43FTVWiSwi5MWXApoYQUkbPux+xnVYqwMo+Zviieg==",
"dev": true,
"requires": { "requires": {
"bonjour-hap": "^3.5.1", "bonjour-hap": "^3.5.1",
"buffer-shims": "^1.0.0", "buffer-shims": "^1.0.0",
@ -207,6 +317,7 @@
"version": "0.0.11", "version": "0.0.11",
"resolved": "https://registry.npmjs.org/node-persist/-/node-persist-0.0.11.tgz", "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-0.0.11.tgz",
"integrity": "sha1-1m66Pr72IPB5Uw+nsTB2qQZmWHQ=", "integrity": "sha1-1m66Pr72IPB5Uw+nsTB2qQZmWHQ=",
"dev": true,
"requires": { "requires": {
"mkdirp": "~0.5.1", "mkdirp": "~0.5.1",
"q": "~1.1.1" "q": "~1.1.1"
@ -218,6 +329,7 @@
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": { "requires": {
"function-bind": "^1.1.1" "function-bind": "^1.1.1"
} }
@ -226,14 +338,37 @@
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
"dev": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
}, },
"has-bigints": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz",
"integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==",
"dev": true
},
"has-symbols": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
"dev": true
},
"has-tostringtag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
"integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
"dev": true,
"requires": {
"has-symbols": "^1.0.2"
}
},
"homebridge": { "homebridge": {
"version": "0.4.50", "version": "0.4.53",
"resolved": "https://registry.npmjs.org/homebridge/-/homebridge-0.4.50.tgz", "resolved": "https://registry.npmjs.org/homebridge/-/homebridge-0.4.53.tgz",
"integrity": "sha512-V88ME6RLtSGcofXl77KAjlWlmC5O5bRY4BcyBbMjUkGYRdSUcPQUkEsFlGdchpxKoVqyoibHu/mQgN5dQADx7A==", "integrity": "sha512-yi8GEKVEkQWeOE9CPmZiu+7dZzeiqzVX/P8suTd2h1hjXHiuots3UdZunEY4MOwNNPc8w62m47T9pbK6RZM4WA==",
"dev": true,
"requires": { "requires": {
"chalk": "^1.1.1", "chalk": "^1.1.1",
"commander": "2.8.1", "commander": "2.8.1",
@ -243,45 +378,190 @@
"semver": "5.0.3" "semver": "5.0.3"
} }
}, },
"internal-slot": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz",
"integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==",
"dev": true,
"requires": {
"get-intrinsic": "^1.1.0",
"has": "^1.0.3",
"side-channel": "^1.0.4"
}
},
"ip": { "ip": {
"version": "1.1.5", "version": "1.1.5",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=",
"dev": true
}, },
"is-arguments": { "is-arguments": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
"integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"has-tostringtag": "^1.0.0"
}
},
"is-bigint": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
"integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
"dev": true,
"requires": {
"has-bigints": "^1.0.1"
}
},
"is-boolean-object": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
"integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"has-tostringtag": "^1.0.0"
}
}, },
"is-buffer": { "is-buffer": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
"integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A=="
}, },
"is-date-object": { "is-callable": {
"version": "1.0.1", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==",
"dev": true
}, },
"is-regex": { "is-date-object": {
"version": "1.0.4", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
"integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
"dev": true,
"requires": { "requires": {
"has": "^1.0.1" "has-tostringtag": "^1.0.0"
} }
}, },
"is-map": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz",
"integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==",
"dev": true
},
"is-negative-zero": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz",
"integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==",
"dev": true
},
"is-number-object": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz",
"integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==",
"dev": true,
"requires": {
"has-tostringtag": "^1.0.0"
}
},
"is-regex": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
"integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"has-tostringtag": "^1.0.0"
}
},
"is-set": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz",
"integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==",
"dev": true
},
"is-shared-array-buffer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz",
"integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==",
"dev": true
},
"is-string": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
"integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
"dev": true,
"requires": {
"has-tostringtag": "^1.0.0"
}
},
"is-symbol": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
"integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
"dev": true,
"requires": {
"has-symbols": "^1.0.2"
}
},
"is-typed-array": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz",
"integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==",
"dev": true,
"requires": {
"available-typed-arrays": "^1.0.5",
"call-bind": "^1.0.2",
"es-abstract": "^1.18.5",
"foreach": "^2.0.5",
"has-tostringtag": "^1.0.0"
}
},
"is-weakmap": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz",
"integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==",
"dev": true
},
"is-weakref": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
"integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==",
"dev": true,
"requires": {
"call-bind": "^1.0.2"
}
},
"is-weakset": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz",
"integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"get-intrinsic": "^1.1.1"
}
},
"isarray": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
"dev": true
},
"minimist": { "minimist": {
"version": "0.0.8", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "^1.2.5"
} }
}, },
"ms": { "ms": {
@ -290,18 +570,20 @@
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}, },
"multicast-dns": { "multicast-dns": {
"version": "7.2.0", "version": "7.2.4",
"resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.0.tgz", "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.4.tgz",
"integrity": "sha512-Tu2QORGOFANB124NWQ/JTRhMf/ODouVLEuvu5Dz8YWEU55zQgRgFGnBHfIh5PbfNDAuaRl7yLB+pgWhSqVxi2Q==", "integrity": "sha512-XkCYOU+rr2Ft3LI6w4ye51M3VK31qJXFIxu0XLw169PtKG0Zx47OrXeVW/GCYOfpC9s1yyyf1S+L8/4LY0J9Zw==",
"dev": true,
"requires": { "requires": {
"dns-packet": "^4.0.0", "dns-packet": "^5.2.2",
"thunky": "^1.0.2" "thunky": "^1.0.2"
} }
}, },
"multicast-dns-service-types": { "multicast-dns-service-types": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz",
"integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=",
"dev": true
}, },
"node-hue-api": { "node-hue-api": {
"version": "4.0.0", "version": "4.0.0",
@ -317,6 +599,7 @@
"version": "0.0.8", "version": "0.0.8",
"resolved": "https://registry.npmjs.org/node-persist/-/node-persist-0.0.8.tgz", "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-0.0.8.tgz",
"integrity": "sha1-pWxzm8b/2c7vGcDo2JWXkX8Ikkk=", "integrity": "sha1-pWxzm8b/2c7vGcDo2JWXkX8Ikkk=",
"dev": true,
"requires": { "requires": {
"mkdirp": "~0.3.5", "mkdirp": "~0.3.5",
"q": "~1.1.1" "q": "~1.1.1"
@ -325,52 +608,109 @@
"mkdirp": { "mkdirp": {
"version": "0.3.5", "version": "0.3.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz",
"integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=" "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=",
"dev": true
} }
} }
}, },
"object-inspect": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz",
"integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==",
"dev": true
},
"object-is": { "object-is": {
"version": "1.0.1", "version": "1.1.5",
"resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz",
"integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=" "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3"
}
}, },
"object-keys": { "object-keys": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
"dev": true
},
"object.assign": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
"integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
"dev": true,
"requires": {
"call-bind": "^1.0.0",
"define-properties": "^1.1.3",
"has-symbols": "^1.0.1",
"object-keys": "^1.1.1"
}
}, },
"q": { "q": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/q/-/q-1.1.2.tgz", "resolved": "https://registry.npmjs.org/q/-/q-1.1.2.tgz",
"integrity": "sha1-Y1fikSBnAdmfGXq4TlforRlvKok=" "integrity": "sha1-Y1fikSBnAdmfGXq4TlforRlvKok=",
"dev": true
}, },
"qrcode-terminal": { "qrcode-terminal": {
"version": "0.11.0", "version": "0.11.0",
"resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.11.0.tgz", "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.11.0.tgz",
"integrity": "sha1-/8bCii/Av7RwUrR+I/T0RqX7254=" "integrity": "sha1-/8bCii/Av7RwUrR+I/T0RqX7254=",
"dev": true
}, },
"regexp.prototype.flags": { "regexp.prototype.flags": {
"version": "1.2.0", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz",
"integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", "integrity": "sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==",
"dev": true,
"requires": { "requires": {
"define-properties": "^1.1.2" "call-bind": "^1.0.2",
"define-properties": "^1.1.3"
} }
}, },
"safe-buffer": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
},
"semver": { "semver": {
"version": "5.0.3", "version": "5.0.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz",
"integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=" "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=",
"dev": true
},
"side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dev": true,
"requires": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
}
},
"string.prototype.trimend": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
"integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3"
}
},
"string.prototype.trimstart": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
"integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3"
}
}, },
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -378,17 +718,77 @@
"supports-color": { "supports-color": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
}, },
"thunky": { "thunky": {
"version": "1.0.3", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/thunky/-/thunky-1.0.3.tgz", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz",
"integrity": "sha512-YwT8pjmNcAXBZqrubu22P4FYsh2D4dxRmnWBOL8Jk8bUcRUtc5326kx32tuTmFDAZtLOGEVNl8POAR8j896Iow==" "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
"dev": true
}, },
"tweetnacl": { "tweetnacl": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==",
"dev": true
},
"typescript": {
"version": "4.5.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz",
"integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==",
"dev": true
},
"unbox-primitive": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.1.tgz", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
"integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A==" "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"has-bigints": "^1.0.1",
"has-symbols": "^1.0.2",
"which-boxed-primitive": "^1.0.2"
}
},
"which-boxed-primitive": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
"integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
"dev": true,
"requires": {
"is-bigint": "^1.0.1",
"is-boolean-object": "^1.1.0",
"is-number-object": "^1.0.4",
"is-string": "^1.0.5",
"is-symbol": "^1.0.3"
}
},
"which-collection": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz",
"integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==",
"dev": true,
"requires": {
"is-map": "^2.0.1",
"is-set": "^2.0.1",
"is-weakmap": "^2.0.1",
"is-weakset": "^2.0.1"
}
},
"which-typed-array": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz",
"integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==",
"dev": true,
"requires": {
"available-typed-arrays": "^1.0.5",
"call-bind": "^1.0.2",
"es-abstract": "^1.18.5",
"foreach": "^2.0.5",
"has-tostringtag": "^1.0.0",
"is-typed-array": "^1.1.7"
}
} }
} }
} }

View File

@ -1,10 +1,13 @@
{ {
"name": "homebridge-hue-chase", "name": "@watsonb8/homebridge-hue-chase",
"version": "1.0.0", "version": "1.1.4",
"description": "A Phillips Hue add on for creating chase sequences.", "description": "A Phillips Hue add on for creating chase sequences.",
"main": "bin/index.js", "main": "bin/index.js",
"publishConfig": {
"registry": "https://gitea.watsonlabs.net"
},
"scripts": { "scripts": {
"build": "tsc", "build": "tsc --build",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"repository": { "repository": {
@ -28,7 +31,10 @@
"dependencies": { "dependencies": {
"@types/node": "^13.1.2", "@types/node": "^13.1.2",
"@types/node-hue-api": "^2.3.0", "@types/node-hue-api": "^2.3.0",
"homebridge": "^0.4.50",
"node-hue-api": "^4.0.0" "node-hue-api": "^4.0.0"
},
"devDependencies": {
"homebridge": "^0.4.53",
"typescript": "^4.5.4"
} }
} }

View File

@ -14,7 +14,7 @@ export interface IChaseProps {
log: any; log: any;
homebridge: any; homebridge: any;
sequence: ISequence; sequence: ISequence;
hue: Api hue: Api;
} }
export class Chase implements IAccessory { export class Chase implements IAccessory {
@ -49,30 +49,42 @@ export class Chase implements IAccessory {
this._isActive = false; this._isActive = false;
this._hue = props.hue; this._hue = props.hue;
this.platformAccessory = new this._homebridge.platformAccessory(this.name, this.generateUUID(), this._homebridge.hap.Accessory.Categories.SWITCH); this.platformAccessory = new this._homebridge.platformAccessory(
this.name,
this.generateUUID(),
this._homebridge.hap.Accessory.Categories.SWITCH
);
//@ts-ignore //@ts-ignore
this._infoService = new Service.AccessoryInformation(); this._infoService = new Service.AccessoryInformation();
this._infoService.setCharacteristic(Characteristic.Manufacturer, "Brandon Watson") this._infoService.setCharacteristic(
this._infoService.setCharacteristic(Characteristic.Model, "Hue Chase") Characteristic.Manufacturer,
this._infoService.setCharacteristic(Characteristic.SerialNumber, "123-456-789"); "Brandon Watson"
);
this._infoService.setCharacteristic(Characteristic.Model, "Hue Chase");
this._infoService.setCharacteristic(
Characteristic.SerialNumber,
"123-456-789"
);
this._lightbulbService = new Service.Lightbulb( this._lightbulbService = new Service.Lightbulb(
this.name, this.name,
'lightbulbService' "lightbulbService"
) );
this.getLights(); this._lightbulbService
this._lightbulbService.getCharacteristic(Characteristic.On) .getCharacteristic(Characteristic.On)
//@ts-ignore //@ts-ignore
.on("set", this.onPowerSet) .on("set", this.onPowerSet)
//@ts-ignore
.on("get", this.onPowerGet); .on("get", this.onPowerGet);
this._lightbulbService.getCharacteristic(Characteristic.Brightness) this._lightbulbService
.getCharacteristic(Characteristic.Brightness)
//@ts-ignore //@ts-ignore
.on("set", this.onBrightnessSet) .on("set", this.onBrightnessSet)
//@ts-ignore
.on("get", this.onBrightnessGet); .on("get", this.onBrightnessGet);
} }
/** /**
@ -87,55 +99,65 @@ export class Chase implements IAccessory {
*/ */
public getServices = (): Array<HAPNodeJS.Service> => { public getServices = (): Array<HAPNodeJS.Service> => {
return [this._infoService, this._lightbulbService!]; return [this._infoService, this._lightbulbService!];
} };
/** /**
* Handler for switch set event * Handler for switch set event
* @param callback The callback function to call when complete * @param callback The callback function to call when complete
*/ */
private onPowerSet = async (activeState: boolean, callback: (error?: Error | null | undefined) => void) => { private onPowerSet = async (
activeState: boolean,
callback: (error?: Error | null | undefined) => void
) => {
if (this._isActive != activeState) { if (this._isActive != activeState) {
activeState ? this.chase() : this.stopAndSetOff(); activeState ? this.chase() : this.stop();
} }
return callback(); return callback();
} };
/** /**
* Handler for switch get event * Handler for switch get event
* @param callback The callback function to call when complete * @param callback The callback function to call when complete
*/ */
private onPowerGet = (callback: (error: Error | null, value: boolean) => void) => { private onPowerGet = (
callback: (error: Error | null, value: boolean) => void
) => {
return callback(null, this._isActive); return callback(null, this._isActive);
} };
private onBrightnessSet = async (newValue: number, callback: (error?: Error | null | undefined) => void) => { private onBrightnessSet = async (
newValue: number,
callback: (error?: Error | null | undefined) => void
) => {
this._brightness = newValue; this._brightness = newValue;
const lightState = new LightState(); const lightState = new LightState();
lightState lightState.on(true).brightness(this._brightness);
.on(true)
.brightness(this._brightness)
await this.setLights(lightState); await this.setLights(lightState);
return callback(); return callback();
} };
private onBrightnessGet = (callback: (eror: Error | null, value: number) => void) => { private onBrightnessGet = (
callback: (error: Error | null, value: number) => void
) => {
return callback(null, this._brightness); return callback(null, this._brightness);
} };
/** /**
* Popuplates internal lights array using the configuration values * Popuplates internal lights array using the configuration values
*/ */
private getLights = async () => { private getLights = async () => {
//Get lights //Get lights
const lightPromises: Array<Promise<void>> = this._sequence.lights.map(async (value: string) => { const lightPromises: Array<Promise<void>> = this._sequence.lights.map(
async (value: string) => {
//@ts-ignore //@ts-ignore
const light: Light = await this._hue.lights.getLightByName(value) const light: Light = await this._hue.lights.getLightByName(value);
this._lights.push(light); this._lights.push(light);
});
await Promise.all(lightPromises);
} }
);
await Promise.all(lightPromises);
};
/** /**
* Execute chase sequence * Execute chase sequence
@ -148,7 +170,7 @@ export class Chase implements IAccessory {
let idx = 0; let idx = 0;
this._isActive = true; this._isActive = true;
while (this._isActive) { while (this._isActive) {
const rgb = this.hexToRgb(this._sequence.colors[idx]) const rgb = this.hexToRgb(this._sequence.colors[idx]);
lightState lightState
.on(true) .on(true)
.brightness(this._brightness) .brightness(this._brightness)
@ -157,7 +179,6 @@ export class Chase implements IAccessory {
await this.setLights(lightState); await this.setLights(lightState);
await Sleep(this._sequence.transitionTime); await Sleep(this._sequence.transitionTime);
if (idx == this._sequence.colors.length) { if (idx == this._sequence.colors.length) {
idx = 0; idx = 0;
@ -165,22 +186,21 @@ export class Chase implements IAccessory {
idx++; idx++;
} }
} }
} };
/** /**
* Stop chase sequence * Stop chase sequence
*/ */
private stopAndSetOff = async () => { private stopAndSetOff = async () => {
this._isActive = false; this._isActive = false;
const lightState: LightState = new LightState() const lightState: LightState = new LightState().off();
.off();
await this.setLights(lightState); await this.setLights(lightState);
} };
private stop = () => { private stop = () => {
this._isActive = false; this._isActive = false;
} };
private setLights = async (state: LightState) => { private setLights = async (state: LightState) => {
try { try {
@ -190,35 +210,46 @@ export class Chase implements IAccessory {
}) })
); );
} catch (err) { } catch (err) {
this._log(`Error while setting brightness: ${err}`) this._log(`Error while setting brightness: ${err}`);
}
} }
};
/** /**
* Helper function to convert a hex string to rgb * Helper function to convert a hex string to rgb
* @param hex hex string starting with "#" * @param hex hex string starting with "#"
*/ */
private hexToRgb = (hex: string): { red: number, green: number, blue: number } | null => { private hexToRgb = (
hex: string
): { red: number; green: number; blue: number } | null => {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? { return result
? {
red: parseInt(result[1], 16), red: parseInt(result[1], 16),
green: parseInt(result[2], 16), green: parseInt(result[2], 16),
blue: parseInt(result[3], 16) blue: parseInt(result[3], 16),
} : null;
} }
: null;
};
/** /**
* Helper function to generate a UUID * Helper function to generate a UUID
*/ */
private generateUUID(): string { // Public Domain/MIT private generateUUID(): string {
// Public Domain/MIT
var d = new Date().getTime(); var d = new Date().getTime();
if (typeof performance !== 'undefined' && typeof performance.now === 'function') { if (
typeof performance !== "undefined" &&
typeof performance.now === "function"
) {
d += performance.now(); //use high-precision timer if available d += performance.now(); //use high-precision timer if available
} }
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
var r = (d + Math.random() * 16) % 16 | 0; var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16); d = Math.floor(d / 16);
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16); return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
}); }
);
} }
} }

View File

@ -1,6 +1,6 @@
import { Chase } from "./chase"; import { Chase } from "./chase";
import { IConfig, ISequence } from "./models/iConfig"; import { IConfig, ISequence } from "./models/iConfig";
import { v3 } from 'node-hue-api'; import { v3 } from "node-hue-api";
import LocalBootstrap = require("node-hue-api/lib/api/http/LocalBootstrap"); import LocalBootstrap = require("node-hue-api/lib/api/http/LocalBootstrap");
import Api = require("node-hue-api/lib/api/Api"); import Api = require("node-hue-api/lib/api/Api");
import { Sleep } from "./sleep"; import { Sleep } from "./sleep";
@ -16,12 +16,12 @@ export default function (homebridge: any) {
Homebridge = homebridge; Homebridge = homebridge;
Accessory = homebridge.platformAccessory; Accessory = homebridge.platformAccessory;
homebridge.registerPlatform( homebridge.registerPlatform(
'homebridge-hue-chase', "homebridge-hue-chase",
'HueChase', "HueChase",
HueChasePlatform, HueChasePlatform,
true true
); );
}; }
class HueChasePlatform { class HueChasePlatform {
log: any = {}; log: any = {};
@ -30,13 +30,12 @@ class HueChasePlatform {
config: IConfig; config: IConfig;
hue: Api | undefined; hue: Api | undefined;
constructor(log: any, config: any, api: any) { constructor(log: any, config: any, api: any) {
this.log = log; this.log = log;
this.api = api; this.api = api;
this.config = config; this.config = config;
this.log('INFO - Registering Hue Chase platform'); this.log("INFO - Registering Hue Chase platform");
this.api.on('didFinishLaunching', this.didFinishLaunching.bind(this)); this.api.on("didFinishLaunching", this.didFinishLaunching.bind(this));
} }
private connectHue = async () => { private connectHue = async () => {
@ -45,35 +44,46 @@ class HueChasePlatform {
} }
if (this.config.userName && this.config.clientKey) { if (this.config.userName && this.config.clientKey) {
this.hue = await v3.api.createLocal(this.config.ipAddress).connect(this.config.userName, this.config.clientKey, null); this.hue = await v3.api
.createLocal(this.config.ipAddress)
.connect(this.config.userName, this.config.clientKey, null);
this.log("Using existing connection info"); this.log("Using existing connection info");
} else { } else {
const unauthenticatedApi = await v3.api.createLocal(this.config.ipAddress).connect(null, null, null); const unauthenticatedApi = await v3.api
.createLocal(this.config.ipAddress)
.connect(null, null, null);
let createdUser; let createdUser;
let connected = false let connected = false;
while (!connected) { while (!connected) {
try { try {
this.log("Creating hue user. Push link button") this.log("Creating hue user. Push link button");
createdUser = await unauthenticatedApi.users.createUser("homebridge", "HueChase"); createdUser = await unauthenticatedApi.users.createUser(
"homebridge",
"HueChase"
);
this.hue = await v3.api.createLocal(this.config.ipAddress).connect(createdUser.username, createdUser.clientKey, null); this.hue = await v3.api
.createLocal(this.config.ipAddress)
.connect(createdUser.username, createdUser.clientKey, null);
this.log("Connected to Hue Bridge"); this.log("Connected to Hue Bridge");
this.log(`UserName: ${createdUser.username}, ClientKey: ${createdUser.clientkey}`) this.log(
`UserName: ${createdUser.username}, ClientKey: ${createdUser.clientkey}`
);
connected = true; connected = true;
} catch (err: any) {
} catch (err) {
if (err.getHueErrorType() === 101) { if (err.getHueErrorType() === 101) {
this.log('The Link button on the bridge was not pressed. Please press the Link button and try again.'); this.log(
"The Link button on the bridge was not pressed. Please press the Link button and try again."
);
Sleep(5000); Sleep(5000);
} else { } else {
this.log(`Unexpected Error: ${err.message}`); this.log(`Unexpected Error: ${err.message}`);
break; break;
} }
}
} }
} }
} }
};
/** /**
* Handler for didFinishLaunching * Handler for didFinishLaunching
@ -87,20 +97,24 @@ class HueChasePlatform {
* Called by homebridge to gather accessories. * Called by homebridge to gather accessories.
* @param callback * @param callback
*/ */
public accessories = async (callback: (accessories: Array<Chase>) => void) => { public accessories = async (
callback: (accessories: Array<Chase>) => void
) => {
//Connect to hue bridge //Connect to hue bridge
await this.connectHue(); await this.connectHue();
this.config.sequences.forEach((sequence: ISequence) => { this.config.sequences.forEach((sequence: ISequence) => {
this.chaseList.push(new Chase({ this.chaseList.push(
new Chase({
name: sequence.name, name: sequence.name,
api: this.api, api: this.api,
log: this.log, log: this.log,
homebridge: Homebridge, homebridge: Homebridge,
sequence: sequence, sequence: sequence,
hue: this.hue!, hue: this.hue!,
}))
}) })
);
});
callback(this.chaseList); callback(this.chaseList);
} };
} }