From 1a51e4d8c5a54fa655b7f012c91201c934e46909 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Tue, 28 Dec 2021 14:48:02 -0500 Subject: [PATCH] Successfully added tsyringe to project --- package-lock.json | 266 +++++++++++------------ package.json | 8 +- src/DataProviders/HarmonyDataProvider.ts | 67 +++--- src/platform.ts | 141 +++++++----- src/settings.ts | 2 +- tsconfig.json | 4 +- 6 files changed, 264 insertions(+), 224 deletions(-) diff --git a/package-lock.json b/package-lock.json index c3da723..8e099e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -866,20 +866,22 @@ } }, "@homebridge/ciao": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@homebridge/ciao/-/ciao-1.1.0.tgz", - "integrity": "sha512-fpFUy/1PQ5eMPiTdRewoA/gnFCLBkBlNsFJpHO8/Wk/p1fQM0YLMDdyvR956CF0QdArhz2SBB3VeGmgVkOrLFw==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@homebridge/ciao/-/ciao-1.1.3.tgz", + "integrity": "sha512-p9WgcSYUj3rtC1g3ywJpKxvIZXPkkv88JxbuW6idMHrUOqDMJlWIsWF0yXynQf8Z28gA0j6AJN9EnAr+hg5gNA==", + "dev": true, "requires": { - "debug": "^4.3.1", + "debug": "^4.3.2", "fast-deep-equal": "^3.1.3", - "source-map-support": "^0.5.19", - "tslib": "^2.0.3" + "source-map-support": "^0.5.20", + "tslib": "^2.3.1" }, "dependencies": { "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, "requires": { "ms": "2.1.2" } @@ -887,12 +889,14 @@ "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "tslib": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", - "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "dev": true } } }, @@ -995,20 +999,22 @@ } }, "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" } }, "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true }, "builtin-modules": { "version": "1.1.1", @@ -1017,9 +1023,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001048", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz", - "integrity": "sha512-g1iSHKVxornw0K8LG9LLdf+Fxnv7T1Z+mMsf0/YYLclQX4Cd522Ap0Lrw6NFqHgezit78dtyWxzlV2Xfc7vgRg==" + "version": "1.0.30001294", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001294.tgz", + "integrity": "sha512-LiMlrs1nSKZ8qkNhpUf5KD0Al1KCBE3zaT7OLOwEkagXMEDij98SiOovn9wxVGQpklk9vVC/pUSqgYmkmKOS8g==" }, "caseless": { "version": "0.12.0", @@ -1065,7 +1071,8 @@ "commander": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true }, "concat-map": { "version": "0.0.1", @@ -1128,9 +1135,10 @@ } }, "decimal.js": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz", - "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==" + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "dev": true }, "define-properties": { "version": "1.1.3", @@ -1161,9 +1169,9 @@ } }, "electron-to-chromium": { - "version": "1.3.427", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.427.tgz", - "integrity": "sha512-/rG5G7Opcw68/Yrb4qYkz07h3bESVRJjUl4X/FrKLXzoUJleKm6D7K7rTTz8V5LUWnd+BbTOyxJX2XprRqHD8A==" + "version": "1.4.29", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.29.tgz", + "integrity": "sha512-N2Jbwxo5Rum8G2YXeUxycs1sv4Qme/ry71HG73bv8BvZl+I/4JtRgK/En+ST/Wh/yF1fqvVCY4jZBgMxnhjtBA==" }, "es-abstract": { "version": "1.17.5", @@ -1222,6 +1230,11 @@ "ext": "^1.1.2" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1282,15 +1295,8 @@ "fast-srp-hap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fast-srp-hap/-/fast-srp-hap-2.0.2.tgz", - "integrity": "sha512-wABhZRrFhlovqJQ1HygOUB4R6WZW2hmlpvVYh2dVCy8BPLabDrB/Tu6XI3B4QfmhtHk8s1OeiFqJHY7FBsphug==" - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "requires": { - "locate-path": "^2.0.0" - } + "integrity": "sha512-wABhZRrFhlovqJQ1HygOUB4R6WZW2hmlpvVYh2dVCy8BPLabDrB/Tu6XI3B4QfmhtHk8s1OeiFqJHY7FBsphug==", + "dev": true }, "forever-agent": { "version": "0.6.1", @@ -1319,9 +1325,10 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "futoin-hkdf": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/futoin-hkdf/-/futoin-hkdf-1.3.2.tgz", - "integrity": "sha512-3EVi3ETTyJg5PSXlxLCaUVVn0pSbDf62L3Gwxne7Uq+d8adOSNWQAad4gg7WToHkcgnCJb3Wlb1P8r4Evj4GPw==" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/futoin-hkdf/-/futoin-hkdf-1.3.3.tgz", + "integrity": "sha512-oR75fYk3B3X9/B02Y6vusrBKucrpC6VjxhRL+C6B7FwUpuSRHbhBNG3AZbcE/xPyJmEQWsyqUFp3VeNNbA3S7A==", + "dev": true }, "gensync": { "version": "1.0.0-beta.1", @@ -1356,11 +1363,12 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "hap-nodejs": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/hap-nodejs/-/hap-nodejs-0.8.3.tgz", - "integrity": "sha512-1bX0UPmIfthYgF43M0rhNsyLayPVXAPvqgwUBfTUNSw4XuesepfbZFnhT8eYZqqClQorKaZr6FeHWw785FQ1Tg==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/hap-nodejs/-/hap-nodejs-0.8.5.tgz", + "integrity": "sha512-4OnIc3oYXHSmafsuBuY1sBbQaMy8n2uRnEPS9ZnD032cOvaVz2IZA3/rE5LEHsxgDvo+oiLxcdqXz0ho38Odxw==", + "dev": true, "requires": { - "@homebridge/ciao": "~1.1.0", + "@homebridge/ciao": "~1.1.2", "debug": "^4.1.1", "decimal.js": "^10.2.0", "fast-srp-hap": "2.0.2", @@ -1373,7 +1381,8 @@ "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true } } }, @@ -1421,13 +1430,14 @@ "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" }, "homebridge": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/homebridge/-/homebridge-1.2.4.tgz", - "integrity": "sha512-uyhLgJumhivAQrauoH5EfxKC2hcX2r8fC2ckAScBx3M7/+XuobHVNYF7yNND69mlg+Jd/KBfaF5zS3ckVl807g==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/homebridge/-/homebridge-1.2.5.tgz", + "integrity": "sha512-tiJi31Ereo75pPhXz9DVLM8lXW8bopXo5aEmBU8elwvfkyTXlGc2dToz9dnc+Vt8ls7jsQAIEl6MkGWrQ7XqtA==", + "dev": true, "requires": { "chalk": "^4.1.0", "commander": "5.1.0", - "hap-nodejs": "~0.8.3", + "hap-nodejs": "~0.8.5", "node-persist": "^0.0.11", "qrcode-terminal": "^0.12.0", "semver": "^7.3.2", @@ -1438,14 +1448,16 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "requires": { "color-convert": "^2.0.1" } }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1455,6 +1467,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "requires": { "color-name": "~1.1.4" } @@ -1462,17 +1475,20 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -1481,6 +1497,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -1524,7 +1541,8 @@ "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true }, "is-callable": { "version": "1.1.5", @@ -1588,9 +1606,9 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" }, "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "json-schema-traverse": { "version": "0.4.1", @@ -1611,13 +1629,13 @@ } }, "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" } }, @@ -1634,19 +1652,10 @@ "leven": "^3.1.0" } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "loose-envify": { "version": "1.4.0", @@ -1660,6 +1669,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -1695,6 +1705,7 @@ "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, "requires": { "minimist": "^1.2.5" } @@ -1718,15 +1729,16 @@ "version": "0.0.11", "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-0.0.11.tgz", "integrity": "sha1-1m66Pr72IPB5Uw+nsTB2qQZmWHQ=", + "dev": true, "requires": { "mkdirp": "~0.5.1", "q": "~1.1.1" } }, "node-releases": { - "version": "1.1.53", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.53.tgz", - "integrity": "sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==" }, "oauth-sign": { "version": "0.9.0", @@ -1763,32 +1775,6 @@ "wrappy": "1" } }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1796,22 +1782,19 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "requires": { - "find-up": "^2.1.0" - } + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "private": { "version": "0.1.8", @@ -1846,18 +1829,25 @@ "q": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/q/-/q-1.1.2.tgz", - "integrity": "sha1-Y1fikSBnAdmfGXq4TlforRlvKok=" + "integrity": "sha1-Y1fikSBnAdmfGXq4TlforRlvKok=", + "dev": true }, "qrcode-terminal": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", - "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==" + "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==", + "dev": true }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -2012,9 +2002,10 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -2023,7 +2014,8 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true } } }, @@ -2117,8 +2109,7 @@ "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", - "dev": true + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" }, "tslint": { "version": "5.20.1", @@ -2158,6 +2149,14 @@ "tslib": "^1.8.1" } }, + "tsyringe": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.6.0.tgz", + "integrity": "sha512-BMQAZamSfEmIQzH8WJeRu1yZGQbPSDuI9g+yEiKZFIcO46GPZuMOC2d0b52cVBdw1d++06JnDSIIZvEnogMdAw==", + "requires": { + "tslib": "^1.9.3" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -2185,9 +2184,9 @@ } }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true }, "unicode-canonical-property-names-ecmascript": { @@ -2288,7 +2287,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } } diff --git a/package.json b/package.json index ab99b8e..bde70d7 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,11 @@ "node": ">=7.6.0" }, "devDependencies": { + "homebridge": "^1.2.5", "rollup-plugin-typescript": "^1.0.1", "tslib": "^1.10.0", "tslint": "^5.17.0", - "typescript": "^3.5.1" + "typescript": "^3.9.10" }, "dependencies": { "@babel/core": "^7.4.5", @@ -39,7 +40,8 @@ "@babel/preset-typescript": "^7.3.3", "@types/node": "^12.0.7", "harmony-websocket": "^1.1.0", - "homebridge": "^1.1.16", - "request": "^2.88.0" + "reflect-metadata": "^0.1.13", + "request": "^2.88.0", + "tsyringe": "^4.6.0" } } diff --git a/src/DataProviders/HarmonyDataProvider.ts b/src/DataProviders/HarmonyDataProvider.ts index 150b39a..1273fdb 100644 --- a/src/DataProviders/HarmonyDataProvider.ts +++ b/src/DataProviders/HarmonyDataProvider.ts @@ -7,6 +7,9 @@ import { IHub } from "../Models/Config/IHub"; import { IDeviceConfig } from "../Models/Config/IDeviceConfig"; import { HarmonyDevice } from "../Models/HarmonyDevice"; import { HarmonyHub } from "../Models/HarmonyHub"; +import { IConfig } from "../Models/Config"; +import { inject, injectable } from "tsyringe"; +import { Logger, Logging } from "homebridge"; const Harmony = require("harmony-websocket"); @@ -21,8 +24,8 @@ interface IHarmonyDataProviderProps { matrix: IMatrix; } +@injectable() class HarmonyDataProvider extends EventEmitter { - private _log: any; private _hubsByDevice: { [deviceName: string]: string } = {}; private _hubs: { [hubName: string]: HarmonyHub } = {}; // private _devicesByHub: { [hubName: string]: { [deviceName: string]: HarmonyDevice } } = {}; @@ -32,16 +35,18 @@ class HarmonyDataProvider extends EventEmitter { private _matrix: IMatrix; - constructor(props: IHarmonyDataProviderProps) { + constructor( + @inject("IConfig") private _config: IConfig, + @inject("log") private _log: Logging + ) { super(); - this._log = props.log; - this._matrix = props.matrix; - props.deviceConfigs.forEach((deviceConfig: IDeviceConfig) => { + this._matrix = _config.Matrix; + _config.Devices.forEach((deviceConfig: IDeviceConfig) => { this._hubsByDevice[deviceConfig.Name] = deviceConfig.Hub; }); // this._deviceConfigs = props.deviceConfigs; - this.connect(props.hubs); + this.connect(_config.Hubs); } // public get devicesByHub(): { [hubName: string]: { [deviceName: string]: HarmonyDevice } } { @@ -104,7 +109,7 @@ class HarmonyDataProvider extends EventEmitter { controlUnitName: string, activity: IActivity ) => { - this._log( + this._log.info( `Starting activity ${activity.DisplayName} for controlUnit: ${controlUnitName}` ); let lastActivity: IActivity | undefined = undefined; @@ -127,7 +132,7 @@ class HarmonyDataProvider extends EventEmitter { devicesToTurnOn.map(async (device: HarmonyDevice) => { if (device && device.name) { if (!device.on) { - this._log(`Turning on device ${device.name}`); + this._log.info(`Turning on device ${device.name}`); await device.powerOn(); } } @@ -175,11 +180,12 @@ class HarmonyDataProvider extends EventEmitter { //Build potential list of devices to turn off if (lastActivity) { - let devicesToTurnOff: Array = lastActivity.DeviceSetupList.map( - (value: IDeviceSetupItem): HarmonyDevice => { - return this.getDeviceFromName(value.DeviceName); - } - ); + let devicesToTurnOff: Array = + lastActivity.DeviceSetupList.map( + (value: IDeviceSetupItem): HarmonyDevice => { + return this.getDeviceFromName(value.DeviceName); + } + ); //remove devices that will be used for next activity from list //delete array[index] is stupid because it just nulls out the index. But now i have to deal with nulls @@ -201,7 +207,7 @@ class HarmonyDataProvider extends EventEmitter { controlUnitName ); - this._log( + this._log.info( `Sanatized devices to turn off: ${JSON.stringify( devicesToTurnOff.map((e) => (e ? e.name : "")) )}` @@ -212,7 +218,7 @@ class HarmonyDataProvider extends EventEmitter { devicesToTurnOff.map(async (device: HarmonyDevice) => { if (device) { if (device.on) { - this._log(`Turning off device ${device.name}`); + this._log.info(`Turning off device ${device.name}`); await device.powerOff(); } } @@ -323,11 +329,10 @@ class HarmonyDataProvider extends EventEmitter { public getDeviceFromName(deviceName: string): HarmonyDevice { let device: HarmonyDevice | undefined; try { - device = this._hubs[this._hubsByDevice[deviceName]].getDeviceByName( - deviceName - ); + device = + this._hubs[this._hubsByDevice[deviceName]].getDeviceByName(deviceName); } catch (err) { - this._log(`Error retrieving device from hub: ${err}`); + this._log.info(`Error retrieving device from hub: ${err}`); } return device!; @@ -350,19 +355,17 @@ class HarmonyDataProvider extends EventEmitter { private connect = async (hubs: Array) => { let readyCount = 0; await Promise.all( - hubs.map( - async (hub: IHub): Promise => { - const newHarmonyHub = new HarmonyHub(hub.Name, hub.Ip, this._log); - this._hubs[hub.Name] = newHarmonyHub; - newHarmonyHub.on("Ready", () => { - readyCount++; - if (readyCount === Object.keys(this._hubs).length) { - this.emit("Ready"); - } - }); - await newHarmonyHub.initialize(); - } - ) + hubs.map(async (hub: IHub): Promise => { + const newHarmonyHub = new HarmonyHub(hub.Name, hub.Ip, this._log.info); + this._hubs[hub.Name] = newHarmonyHub; + newHarmonyHub.on("Ready", () => { + readyCount++; + if (readyCount === Object.keys(this._hubs).length) { + this.emit("Ready"); + } + }); + await newHarmonyHub.initialize(); + }) ); }; diff --git a/src/platform.ts b/src/platform.ts index 27c9144..552dc7c 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -1,3 +1,4 @@ +import "reflect-metadata"; import { API, Characteristic, @@ -12,9 +13,8 @@ import { Sequence } from "./Accessories/Sequence"; import HarmonyDataProvider from "./DataProviders/HarmonyDataProvider"; import { IConfig, IControlUnit, IDeviceButton } from "./Models/Config"; import { ISequence } from "./Models/Config/ISequence"; -import { HarmonyDevice } from "./Models/HarmonyDevice"; -import { HarmonyHub } from "./Models/HarmonyHub"; import { PLATFORM_NAME, PLUGIN_NAME } from "./settings"; +import { container } from "tsyringe"; export class Platform implements DynamicPlatformPlugin { constructor( @@ -23,57 +23,58 @@ export class Platform implements DynamicPlatformPlugin { public readonly api: API ) { this.log.debug("Finished initializing platform:", config.name); - this.config = config as unknown as IConfig; + this.register(); + //construct data provider - const dataProvider = new HarmonyDataProvider({ - hubs: this.config.Hubs, - deviceConfigs: this.config.Devices, - matrix: this.config.Matrix, - log: this.log, - }); + // const dataProvider = new HarmonyDataProvider({ + // hubs: this.config.Hubs, + // deviceConfigs: this.config.Devices, + // matrix: this.config.Matrix, + // log: this.log, + // }); let didFinishLaunching = false; this.api.on("didFinishLaunching", async () => { log.debug("Executed didFinishLaunching callback"); + this.discoverControlUnitAccessories(); + this.discoverDeviceButtonAccessories(); + this.discoverSequenceAccessories(); + this.pruneAccessories(); didFinishLaunching = true; }); - this.dataProvider = null; + // this.dataProvider = null; if (this.config) { //construct data provider - this.dataProvider = new HarmonyDataProvider({ - hubs: this.config.Hubs, - deviceConfigs: this.config.Devices, - matrix: this.config.Matrix, - log: this.log, - }); - + // this.dataProvider = new HarmonyDataProvider({ + // hubs: this.config.Hubs, + // deviceConfigs: this.config.Devices, + // matrix: this.config.Matrix, + // log: this.log, + // }); //Emit devices if requested - - this.dataProvider.on("Ready", () => { - this.log.info("All hubs connected"); - this.discoverControlUnitAccessories(dataProvider); - this.discoverDeviceButtonAccessories(dataProvider); - this.discoverSequenceAccessories(dataProvider); - this.pruneAccessories(); - - if (this.config.EmitDevicesOnStartup) { - const hubs = this.dataProvider!.hubs; - Object.values(hubs).forEach((hub: HarmonyHub) => { - const deviceDictionary = hub.devices; - this.log.info(`${hub.hubName}`); - - Object.values(deviceDictionary).forEach((device: HarmonyDevice) => { - this.log.info(` ${device.name} : ${device.id}`); - Object.keys(device.commands).forEach((command: string) => { - this.log.info(` ${command}`); - }); - }); - }); - } - }); + // this.dataProvider.on("Ready", () => { + // this.log.info("All hubs connected"); + // this.discoverControlUnitAccessories(dataProvider); + // this.discoverDeviceButtonAccessories(dataProvider); + // this.discoverSequenceAccessories(dataProvider); + // this.pruneAccessories(); + // if (this.config.EmitDevicesOnStartup) { + // const hubs = this.dataProvider!.hubs; + // Object.values(hubs).forEach((hub: HarmonyHub) => { + // const deviceDictionary = hub.devices; + // this.log.info(`${hub.hubName}`); + // Object.values(deviceDictionary).forEach((device: HarmonyDevice) => { + // this.log.info(` ${device.name} : ${device.id}`); + // Object.keys(device.commands).forEach((command: string) => { + // this.log.info(` ${command}`); + // }); + // }); + // }); + // } + // }); } } @@ -84,15 +85,12 @@ export class Platform implements DynamicPlatformPlugin { // this is used to track restored cached accessories public readonly accessories: PlatformAccessory[] = []; public config: IConfig; - public dataProvider: HarmonyDataProvider | null; /** * Discover new control unit accessories * @param dataProvider */ - private discoverControlUnitAccessories( - dataProvider: HarmonyDataProvider - ): void { + private discoverControlUnitAccessories(): void { this.config.ControlUnits.forEach((unit: IControlUnit) => { const uuid = this.api.hap.uuid.generate(unit.DisplayName); const existingAccessory = this.accessories.find((e) => e.UUID === uuid); @@ -103,7 +101,12 @@ export class Platform implements DynamicPlatformPlugin { existingAccessory.displayName ); - new ControlUnit(this, existingAccessory, dataProvider, unit.Activities); + new ControlUnit( + this, + existingAccessory, + container.resolve(HarmonyDataProvider), + unit.Activities + ); this.api.publishExternalAccessories(PLUGIN_NAME, [existingAccessory]); console.log("Publishing external accessory: " + uuid); @@ -116,7 +119,12 @@ export class Platform implements DynamicPlatformPlugin { accessory.context["DeviceName"] = unit.DisplayName; accessory.context["Type"] = typeof ControlUnit.name; - new ControlUnit(this, accessory, dataProvider, unit.Activities); + new ControlUnit( + this, + accessory, + container.resolve(HarmonyDataProvider), + unit.Activities + ); this.api.publishExternalAccessories(PLUGIN_NAME, [accessory]); console.log("Publishing external accessory: " + uuid); @@ -128,9 +136,7 @@ export class Platform implements DynamicPlatformPlugin { * Discover new device button accessories * @param dataProvider */ - private discoverDeviceButtonAccessories( - dataProvider: HarmonyDataProvider - ): void { + private discoverDeviceButtonAccessories(): void { this.config.DeviceButtons.forEach((button: IDeviceButton) => { const uuid = this.api.hap.uuid.generate(button.DisplayName); const existingAccessory = this.accessories.find((e) => e.UUID === uuid); @@ -140,7 +146,12 @@ export class Platform implements DynamicPlatformPlugin { existingAccessory.displayName ); - new DeviceButton(this, existingAccessory, dataProvider, button); + new DeviceButton( + this, + existingAccessory, + container.resolve(HarmonyDataProvider), + button + ); this.api.updatePlatformAccessories([existingAccessory]); } else { this.log.info("Adding new accessory: " + button.DisplayName); @@ -151,7 +162,12 @@ export class Platform implements DynamicPlatformPlugin { accessory.context["DeviceName"] = button.DisplayName; accessory.context["Type"] = typeof DeviceButton; - new DeviceButton(this, accessory, dataProvider, button); + new DeviceButton( + this, + accessory, + container.resolve(HarmonyDataProvider), + button + ); this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [ accessory, @@ -165,7 +181,7 @@ export class Platform implements DynamicPlatformPlugin { * Discover new sequence accessories * @param dataProvider */ - private discoverSequenceAccessories(dataProvider: HarmonyDataProvider): void { + private discoverSequenceAccessories(): void { this.config.Sequences.forEach((sequence: ISequence) => { const uuid = this.api.hap.uuid.generate(sequence.DisplayName); const existingAccessory = this.accessories.find((e) => e.UUID === uuid); @@ -175,7 +191,12 @@ export class Platform implements DynamicPlatformPlugin { existingAccessory.displayName ); - new Sequence(this, existingAccessory, dataProvider, sequence); + new Sequence( + this, + existingAccessory, + container.resolve(HarmonyDataProvider), + sequence + ); this.api.updatePlatformAccessories([existingAccessory]); } else { this.log.info("Adding new accessory: " + sequence.DisplayName); @@ -186,7 +207,12 @@ export class Platform implements DynamicPlatformPlugin { accessory.context["DeviceName"] = sequence.DisplayName; accessory.context["Type"] = typeof "Sequence"; - new Sequence(this, accessory, dataProvider, sequence); + new Sequence( + this, + accessory, + container.resolve(HarmonyDataProvider), + sequence + ); this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [ accessory, @@ -222,4 +248,11 @@ export class Platform implements DynamicPlatformPlugin { // add the restored accessory to the accessories cache so we can track if it has already been registered this.accessories.push(accessory); } + + private register(): void { + container.register(Platform, { useValue: this }); + container.register("IConfig", { useValue: this.config }); + container.register("log", { useValue: this.log }); + container.registerSingleton(HarmonyDataProvider); + } } diff --git a/src/settings.ts b/src/settings.ts index 5daca0d..1841070 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -6,4 +6,4 @@ export const PLATFORM_NAME = "HarmonyHubMatrix"; /** * This must match the name of your plugin as defined the package.json */ -export const PLUGIN_NAME = "homebridge-harmony-control"; +export const PLUGIN_NAME = "@watsonb8/homebridge-harmony-control"; diff --git a/tsconfig.json b/tsconfig.json index 4e9341a..b86bfdd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,9 @@ "outDir": "./bin", "strict": true, "sourceMap": true, - "skipLibCheck": true + "skipLibCheck": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true }, "include": ["src"], "exclude": ["**/node_modules", "**/__tests__/*"]