homekit-code
Advanced tools
Comparing version 1.0.4 to 1.1.0
import { CreateQrCode } from '../../types'; | ||
export declare const createQrCode: ({ category, name, output, pairingCode, setupId, ...rest }: CreateQrCode) => Promise<void>; | ||
export declare const createQrCode: ({ category, flag, name, output, pairingCode, setupId, ...rest }: CreateQrCode) => Promise<void>; |
@@ -63,12 +63,17 @@ "use strict"; | ||
var categories_1 = require("../../config/categories"); | ||
var flags_1 = require("../../config/flags"); | ||
var file_1 = require("../../utils/file"); | ||
var qrcode_utils_1 = require("./qrcode.utils"); | ||
var createQrCode = function (_a) { return __awaiter(void 0, void 0, void 0, function () { | ||
var categoryId, setupUri, svg, error_1; | ||
var category = _a.category, name = _a.name, output = _a.output, pairingCode = _a.pairingCode, setupId = _a.setupId, rest = __rest(_a, ["category", "name", "output", "pairingCode", "setupId"]); | ||
var setupUri, svg, error_1; | ||
var category = _a.category, flag = _a.flag, name = _a.name, output = _a.output, pairingCode = _a.pairingCode, setupId = _a.setupId, rest = __rest(_a, ["category", "flag", "name", "output", "pairingCode", "setupId"]); | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
categoryId = categories_1.CATEGORIES[category]; | ||
setupUri = (0, qrcode_utils_1.composeSetupUri)(categoryId, pairingCode, setupId); | ||
setupUri = (0, qrcode_utils_1.composeSetupUri)({ | ||
categoryId: categories_1.CATEGORIES[category], | ||
flag: flags_1.FLAGS[flag], | ||
password: pairingCode, | ||
setupId: setupId, | ||
}); | ||
return [4 /*yield*/, (0, qrcode_utils_1.composeQrCode)({ pairingCode: pairingCode, setupUri: setupUri })]; | ||
@@ -75,0 +80,0 @@ case 1: |
@@ -1,3 +0,3 @@ | ||
import { ComposeQrCode } from '../../types'; | ||
import { ComposeQrCode, ComposeSetupUri } from '../../types'; | ||
export declare const composeQrCode: ({ pairingCode, setupUri }: ComposeQrCode) => Promise<string>; | ||
export declare const composeSetupUri: (category: number, password: string, setupId: string, version?: number, reserved?: number, flags?: number) => string; | ||
export declare const composeSetupUri: ({ categoryId, flag, password, reserved, setupId, version }: ComposeSetupUri) => string; |
@@ -63,6 +63,4 @@ "use strict"; | ||
// KUDOS: https://github.com/maximkulkin/esp-homekit/blob/0f3ef2ac2872ffe64dfe4e5d929420af327d48a5/tools/gen_qrcode#L18 | ||
var composeSetupUri = function (category, password, setupId, version, reserved, flags) { | ||
if (version === void 0) { version = 0; } | ||
if (reserved === void 0) { reserved = 0; } | ||
if (flags === void 0) { flags = 2; } | ||
var composeSetupUri = function (_a) { | ||
var categoryId = _a.categoryId, _b = _a.flag, flag = _b === void 0 ? 2 : _b, password = _a.password, _c = _a.reserved, reserved = _c === void 0 ? 0 : _c, setupId = _a.setupId, _d = _a.version, version = _d === void 0 ? 0 : _d; | ||
var payload = 0; | ||
@@ -73,5 +71,5 @@ payload = payload | (version & 0x7); | ||
payload = payload << 8; | ||
payload = payload | (category & 0xff); | ||
payload = payload | (categoryId & 0xff); | ||
payload = payload << 4; | ||
payload = payload | (flags & 0xf); | ||
payload = payload | (flag & 0xf); | ||
payload = BigInt(payload) << BigInt(27); | ||
@@ -78,0 +76,0 @@ payload = BigInt(payload) | BigInt(Number(password) & 0x7fffffff); |
@@ -40,2 +40,3 @@ "use strict"; | ||
var categories_1 = require("../../config/categories"); | ||
var flags_1 = require("../../config/flags"); | ||
var qrcode_utils_1 = require("./qrcode.utils"); | ||
@@ -45,11 +46,15 @@ describe('composeSetupUri', function () { | ||
expect.assertions(1); | ||
expect((0, qrcode_utils_1.composeSetupUri)(categories_1.CATEGORIES.switch, '84131633', '')).toBe('X-HM://0081YCYEP'); | ||
expect((0, qrcode_utils_1.composeSetupUri)({ categoryId: categories_1.CATEGORIES.switch, password: '84131633', setupId: '' })).toBe('X-HM://0081YCYEP'); | ||
}); | ||
test('get Setup Uri for category, password and setupId', function () { | ||
expect.assertions(1); | ||
expect((0, qrcode_utils_1.composeSetupUri)(categories_1.CATEGORIES.switch, '84131633', '3QYT')).toBe('X-HM://0081YCYEP3QYT'); | ||
expect((0, qrcode_utils_1.composeSetupUri)({ categoryId: categories_1.CATEGORIES.switch, password: '84131633', setupId: '3QYT' })).toBe('X-HM://0081YCYEP3QYT'); | ||
}); | ||
test('get Setup Uri for category, flag, password and setupId', function () { | ||
expect.assertions(1); | ||
expect((0, qrcode_utils_1.composeSetupUri)({ categoryId: categories_1.CATEGORIES.switch, flag: flags_1.FLAGS.ble, password: '84131633', setupId: '3QYT' })).toBe('X-HM://0086E6GJ53QYT'); | ||
}); | ||
}); | ||
describe('composeQrCode', function () { | ||
test('get Setup Uri for switch', function () { return __awaiter(void 0, void 0, void 0, function () { | ||
test('get QR code for switch', function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var setupUri, qrCode; | ||
@@ -60,3 +65,3 @@ return __generator(this, function (_a) { | ||
expect.assertions(1); | ||
setupUri = (0, qrcode_utils_1.composeSetupUri)(categories_1.CATEGORIES.switch, '84131633', '3QYT'); | ||
setupUri = (0, qrcode_utils_1.composeSetupUri)({ categoryId: categories_1.CATEGORIES.switch, password: '84131633', setupId: '3QYT' }); | ||
return [4 /*yield*/, (0, qrcode_utils_1.composeQrCode)({ pairingCode: '84131633', setupUri: setupUri })]; | ||
@@ -70,2 +75,17 @@ case 1: | ||
}); }); | ||
test('get QR code for ble switch', function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var setupUri, qrCode; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(1); | ||
setupUri = (0, qrcode_utils_1.composeSetupUri)({ categoryId: categories_1.CATEGORIES.switch, flag: flags_1.FLAGS.ble, password: '84131633', setupId: '3QYT' }); | ||
return [4 /*yield*/, (0, qrcode_utils_1.composeQrCode)({ pairingCode: '84131633', setupUri: setupUri })]; | ||
case 1: | ||
qrCode = _a.sent(); | ||
expect(qrCode).toBe("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg viewBox=\"0 0 400 540\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>HomeKit QR Code</title>\n <defs>\n <symbol id=\"homekit\" viewBox=\"0 0 130 120\"><path d=\"m128.28 49.26-14.16-11.3v-20c0-1.46-.57-1.9-1.6-1.9h-8.94c-1.2 0-1.93.24-1.93 1.9v10L67.81 1.3a4.22 4.22 0 0 0-6.09 0L1.31 49.26c-2.13 1.67-1.53 4.1.83 4.1h11.14v61.1c0 2.77.83 4.34 2.6 5.04a7 7 0 0 0 2.72.5h92.43a7.1 7.1 0 0 0 2.72-.5c1.77-.7 2.6-2.27 2.6-5.03V53.33h11.2c2.26 0 2.86-2.4.73-4.07ZM20.66 48.1a8.45 8.45 0 0 1 3.32-6.97c1.7-1.37 37.24-29.03 38.24-29.83a4.42 4.42 0 0 1 2.66-1.14c1 .07 1.95.47 2.7 1.14l38.2 30a8.43 8.43 0 0 1 3.32 6.96v58.9a4.25 4.25 0 0 1-4.72 4.77H25.05a4.2 4.2 0 0 1-4.39-4.77V48.1Z\" fill=\"#000\"/><path d=\"M37.12 99.03H92.4a3.12 3.12 0 0 0 3.32-3.56v-42.4a5.48 5.48 0 0 0-2.2-5L66.95 26.82c-.58-.5-1.3-.78-2.06-.8-.75.03-1.46.31-2.03.8l-26.6 21.23a5.46 5.46 0 0 0-2.2 5v42.4a3.14 3.14 0 0 0 3.07 3.57Zm4.29-43.17A4.08 4.08 0 0 1 42.97 52l19.95-15.94a2.72 2.72 0 0 1 1.7-.66c.63.02 1.24.25 1.72.66.53.47 19.05 15.1 19.95 15.94a4.07 4.07 0 0 1 1.56 3.86V88.2a2.47 2.47 0 0 1-2.69 2.83H44.1a2.45 2.45 0 0 1-2.7-2.83V55.86Z\" fill=\"#000\"/><path d=\"M53.54 80.67h22.44c1 0 1.73-.34 1.73-1.8V60.73a3.34 3.34 0 0 0-1.23-2.67L65.91 50a1.73 1.73 0 0 0-2.3 0l-10.57 8.13a3.33 3.33 0 0 0-1.23 2.67v18.13c0 1.4.73 1.74 1.73 1.74Zm5.92-17.1a1.3 1.3 0 0 1 .53-1.1l4.3-3.34a.8.8 0 0 1 .96 0s4.12 3.33 4.28 3.33a1.3 1.3 0 0 1 .54 1.1v8.57c0 .6-.3.73-.74.73H60.2c-.4 0-.73 0-.73-.73v-8.57Z\"/></symbol>\n <symbol id=\"0\" viewBox=\"0 0 34 48\"><path d=\"M17 48c11 0 17-9 17-24S28 0 17 0 0 9 0 24s6 24 17 24ZM7 24C7 12 10 6 17 6c4 0 7 3 9 8L7 28v-4Zm10 18c-4 0-7-2-9-8l19-14v4c0 12-3 18-10 18Z\"/></symbol>\n <symbol id=\"1\" viewBox=\"0 0 34 48\"><path d=\"M34 48v-6H21V0h-7L0 9v7l13-9h1v35H0v6h34Z\"/></symbol>\n <symbol id=\"2\" viewBox=\"0 0 34 48\"><path d=\"M0 14.4684V14.664H7.02096V14.4684C7.02096 9.222 10.7987 5.73523 16.501 5.73523C22.1677 5.73523 25.8742 8.86354 25.8742 13.6864C25.8742 17.2383 24.2348 19.7149 17.5702 26.3299L0.356394 43.3401V48H34V42.0692H10.7631V41.5153L22.239 30.3381C30.6143 22.3218 33.1803 18.2811 33.1803 13.3279C33.1803 5.40937 26.5157 0 16.7149 0C6.91405 0 0 5.99593 0 14.4684Z\"/></symbol>\n <symbol id=\"3\" viewBox=\"0 0 34 48\"><path d=\"M11 26h6c6 0 10 3 10 8s-4 8-10 8-10-3-10-7H0c0 8 7 13 17 13s17-6 17-14c0-6-4-10-10-11 5-1 8-5 8-11 0-7-6-12-15-12C7 0 1 5 1 13h6c1-5 4-7 10-7 5 0 8 2 8 7s-3 8-9 8h-5v5Z\"/></symbol>\n <symbol id=\"4\" viewBox=\"0 0 34 48\"><path d=\"M21 48h6V38h7v-6h-7V19h-6v13H7L22 0h-7L0 33v5h21v10Z\"/></symbol>\n <symbol id=\"5\" viewBox=\"0 0 34 48\"><path d=\"M17 48c10 0 17-7 17-16s-6-16-16-16c-4 0-8 2-10 4L9 6h22V0H3L1 27h7c1-3 5-5 9-5 6 0 10 4 10 10s-4 10-10 10c-5 0-10-3-10-8H0c0 8 7 14 17 14Z\"/></symbol>\n <symbol id=\"6\" viewBox=\"0 0 34 48\"><path d=\"M34 32c0-9-6-15-15-15-3 0-6 1-8 3l1-3L25 0h-8L7 14c-5 7-7 12-7 18 0 9 7 16 17 16s17-7 17-16ZM17 42c-6 0-10-4-10-10s4-10 10-10 10 4 10 10-4 10-10 10Z\"/></symbol>\n <symbol id=\"7\" viewBox=\"0 0 34 48\"><path d=\"M4 48h8L34 6V0H0v6h27L4 48Z\"/></symbol>\n <symbol id=\"8\" viewBox=\"0 0 34 48\"><path d=\"M17 48c10 0 17-5 17-13 0-6-4-11-10-12v-1c5-1 8-5 8-10 0-7-6-12-15-12S2 5 2 12c0 5 3 9 8 10v1C4 24 0 29 0 35c0 8 7 13 17 13Zm0-28c-5 0-9-3-9-7 0-5 4-8 9-8s9 3 9 8c0 4-4 7-9 7Zm0 23c-6 0-10-4-10-9s4-8 10-8 10 3 10 8-4 9-10 9Z\"/></symbol>\n <symbol id=\"9\" viewBox=\"0 0 34 48\"><path d=\"M0 16c0 9 6 15 15 15 3 0 6-1 8-3l-1 3L9 48h8l10-14c5-7 7-12 7-18 0-9-7-16-17-16S0 7 0 16ZM17 6c6 0 10 4 10 10s-4 10-10 10S7 22 7 16 11 6 17 6Z\"/></symbol>\n <symbol id=\"qrCode\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" shape-rendering=\"crispEdges\"><path fill=\"#ffffff\" d=\"M0 0h25v25H0z\"/><path stroke=\"#000000\" d=\"M0 0.5h7m1 0h4m2 0h1m3 0h7M0 1.5h1m5 0h1m1 0h3m1 0h2m4 0h1m5 0h1M0 2.5h1m1 0h3m1 0h1m1 0h1m1 0h2m3 0h1m2 0h1m1 0h3m1 0h1M0 3.5h1m1 0h3m1 0h1m1 0h1m2 0h1m1 0h1m2 0h1m1 0h1m1 0h3m1 0h1M0 4.5h1m1 0h3m1 0h1m1 0h3m1 0h2m2 0h1m1 0h1m1 0h3m1 0h1M0 5.5h1m5 0h1m3 0h2m2 0h3m1 0h1m5 0h1M0 6.5h7m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h7M8 7.5h1m1 0h3m2 0h1M1 8.5h2m1 0h1m1 0h2m2 0h3m3 0h1m1 0h1m1 0h5M3 9.5h1m5 0h1m3 0h1m1 0h2m1 0h1m4 0h2M0 10.5h1m2 0h1m1 0h6m1 0h1m1 0h3m3 0h2m2 0h1M0 11.5h1m3 0h1m5 0h1m2 0h2m1 0h1m5 0h3M2 12.5h1m3 0h1m2 0h1m4 0h3m3 0h2m1 0h2M2 13.5h2m1 0h1m1 0h5m1 0h3m1 0h8M0 14.5h1m1 0h2m2 0h1m3 0h4m2 0h2m1 0h1m1 0h4M1 15.5h4m7 0h1m1 0h1m1 0h4m2 0h1m1 0h1M0 16.5h1m2 0h4m1 0h2m1 0h1m1 0h9m1 0h1M8 17.5h1m1 0h1m1 0h2m1 0h2m3 0h1m1 0h1M0 18.5h7m1 0h3m2 0h4m1 0h1m1 0h1m1 0h3M0 19.5h1m5 0h1m3 0h2m1 0h1m1 0h2m3 0h1m2 0h2M0 20.5h1m1 0h3m1 0h1m1 0h2m3 0h1m2 0h6M0 21.5h1m1 0h3m1 0h1m2 0h5m1 0h1m1 0h1m1 0h5M0 22.5h1m1 0h3m1 0h1m1 0h2m1 0h1m1 0h1m1 0h1m2 0h1m1 0h1m1 0h1m1 0h1M0 23.5h1m5 0h1m1 0h1m1 0h1m1 0h1m4 0h3m1 0h1m1 0h2M0 24.5h7m2 0h1m2 0h2m2 0h1m5 0h1m1 0h1\"/></symbol>\n </defs>\n <rect fill=\"#000000\" height=\"540\" rx=\"20\" width=\"400\"/>\n <rect fill=\"#ffffff\" height=\"530\" rx=\"15\" width=\"390\" x=\"5\" y=\"5\"/>\n <use href=\"#homekit\" height=\"120\" width=\"130\" x=\"24\" y=\"30\"/>\n <use href=\"#8\" height=\"48\" width=\"34\" x=\"174\" y=\"30\"/>\n <use href=\"#4\" height=\"48\" width=\"34\" x=\"228\" y=\"30\"/>\n <use href=\"#1\" height=\"48\" width=\"34\" x=\"282\" y=\"30\"/>\n <use href=\"#3\" height=\"48\" width=\"34\" x=\"336\" y=\"30\"/>\n <use href=\"#1\" height=\"48\" width=\"34\" x=\"174\" y=\"102\"/>\n <use href=\"#6\" height=\"48\" width=\"34\" x=\"228\" y=\"102\"/>\n <use href=\"#3\" height=\"48\" width=\"34\" x=\"282\" y=\"102\"/>\n <use href=\"#3\" height=\"48\" width=\"34\" x=\"336\" y=\"102\"/>\n <use href=\"#qrCode\" height=\"340\" width=\"340\" x=\"30\" y=\"175\"/>\n</svg>"); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
}); |
@@ -45,3 +45,3 @@ #!/usr/bin/env node | ||
var main = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var commands, name, output, pairingCode, zoom, category, _a, setupId; | ||
var commands, name, output, pairingCode, zoom, category, flag, _a, setupId; | ||
return __generator(this, function (_b) { | ||
@@ -52,4 +52,4 @@ switch (_b.label) { | ||
if (!(commands[0] === 'qrcode')) return [3 /*break*/, 2]; | ||
category = yargs_1.argv.category, _a = yargs_1.argv.setupId, setupId = _a === void 0 ? '' : _a; | ||
return [4 /*yield*/, (0, qrcode_1.createQrCode)({ category: category, name: name, output: output, pairingCode: pairingCode, setupId: setupId, zoom: zoom })]; | ||
category = yargs_1.argv.category, flag = yargs_1.argv.flag, _a = yargs_1.argv.setupId, setupId = _a === void 0 ? '' : _a; | ||
return [4 /*yield*/, (0, qrcode_1.createQrCode)({ category: category, flag: flag, name: name, output: output, pairingCode: pairingCode, setupId: setupId, zoom: zoom })]; | ||
case 1: | ||
@@ -56,0 +56,0 @@ _b.sent(); |
import { CATEGORIES } from '../config/categories'; | ||
import { FLAGS } from '../config/flags'; | ||
import { OUTPUT_FORMATS } from '../config/output'; | ||
export declare type Category = keyof typeof CATEGORIES; | ||
export declare type Flag = keyof typeof FLAGS; | ||
export declare type OutputFormat = typeof OUTPUT_FORMATS[number]; | ||
@@ -20,5 +22,14 @@ export declare type CreateFileBuffer = CreateImage & { | ||
category: Category; | ||
flag: Flag; | ||
pairingCode: string; | ||
setupId: string; | ||
}; | ||
export declare type ComposeSetupUri = { | ||
categoryId: number; | ||
flag?: number; | ||
password: string; | ||
reserved?: number; | ||
setupId: string; | ||
version?: number; | ||
}; | ||
export declare type ComposeQrCode = { | ||
@@ -25,0 +36,0 @@ pairingCode: string; |
export declare const argv: { | ||
[x: string]: unknown; | ||
flag: "ble" | "ip" | "wac"; | ||
setupId: string; | ||
category: "window" | "switch" | "other" | "airConditioner" | "airport" | "airPurifier" | "appleTv" | "bridge" | "dehumidifier" | "door" | "doorLock" | "fan" | "faucet" | "garage" | "heater" | "humidifier" | "ipCamera" | "lightbulb" | "outlet" | "programmableSwitch" | "rangeExtender" | "securitySystem" | "sensor" | "showerHead" | "speaker" | "sprinkler" | "targetController" | "television" | "thermostat" | "videoDoorBell" | "windowCovering"; | ||
setupId: string; | ||
name: string; | ||
@@ -6,0 +7,0 @@ output: "svg" | "png"; |
@@ -9,2 +9,3 @@ "use strict"; | ||
var categories_1 = require("./config/categories"); | ||
var flags_1 = require("./config/flags"); | ||
var output_1 = require("./config/output"); | ||
@@ -26,2 +27,9 @@ var number_1 = require("./utils/number"); | ||
}, | ||
flag: { | ||
alias: 'f', | ||
choices: Object.keys(flags_1.FLAGS), | ||
default: 'ip', | ||
demandOption: true, | ||
describe: 'Flag how to connect to the HomeKit accessory.', | ||
}, | ||
name: { | ||
@@ -60,3 +68,4 @@ alias: 'n', | ||
.example('npx homekit-code qrcode --category=switch --pairingCode=84131633 --setupId=3QYT', 'Generate a QR code for a HomeKit switch') | ||
.example('npx homekit-code qrcode --category=switch --pairingCode=84131633 --setupId=3QYT --name=switch --output=png --zoom=10', 'Generate a QR code for a HomeKit switch as switch.png with an image zoom factor of 10'); | ||
.example('npx homekit-code qrcode --category=switch --pairingCode=84131633 --setupId=3QYT --name=switch --output=png --zoom=10', 'Generate a QR code for a HomeKit switch as switch.png with an image zoom factor of 10') | ||
.example('npx homekit-code qrcode -c=switch -f=ble -p=84131633 -s=3QYT', 'Generate a QR code for a Bluetooth Low Energy (BLE) HomeKit switch'); | ||
}) | ||
@@ -63,0 +72,0 @@ .command('tag', 'Generate a scannable HomeKit tag label', function (yargsCmd) { |
{ | ||
"name": "homekit-code", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Generate a pairing HomeKit QR code label or scannable tag to setup your HomeKit accessory.", | ||
@@ -57,4 +57,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@commitlint/cli": "16.1.0", | ||
"@commitlint/config-conventional": "16.0.0", | ||
"@commitlint/cli": "16.2.1", | ||
"@commitlint/config-conventional": "16.2.1", | ||
"@semantic-release/changelog": "6.0.1", | ||
@@ -64,21 +64,21 @@ "@semantic-release/git": "10.0.1", | ||
"@types/jest": "^27.4.0", | ||
"@types/node": "17.0.13", | ||
"@types/node": "17.0.18", | ||
"@types/qrcode": "1.4.2", | ||
"@types/yargs": "17.0.8", | ||
"@typescript-eslint/eslint-plugin": "5.10.1", | ||
"@typescript-eslint/parser": "5.10.1", | ||
"dotenv": "15.0.0", | ||
"eslint": "8.8.0", | ||
"eslint-config-prettier": "8.3.0", | ||
"@typescript-eslint/eslint-plugin": "5.12.0", | ||
"@typescript-eslint/parser": "5.12.0", | ||
"dotenv": "16.0.0", | ||
"eslint": "8.9.0", | ||
"eslint-config-prettier": "8.4.0", | ||
"eslint-import-resolver-typescript": "2.5.0", | ||
"eslint-plugin-import": "2.25.4", | ||
"eslint-plugin-jest": "26.0.0", | ||
"eslint-plugin-jest": "26.1.1", | ||
"eslint-plugin-no-type-assertion": "1.1.1", | ||
"eslint-plugin-prettier": "4.0.0", | ||
"eslint-plugin-sonarjs": "0.11.0", | ||
"eslint-plugin-sonarjs": "0.12.0", | ||
"eslint-plugin-sort-keys-fix": "1.1.2", | ||
"eslint-plugin-typescript-sort-keys": "2.1.0", | ||
"husky": "7.0.4", | ||
"jest": "27.4.7", | ||
"lint-staged": "12.3.2", | ||
"jest": "27.5.1", | ||
"lint-staged": "12.3.4", | ||
"nodemon": "2.0.15", | ||
@@ -88,5 +88,5 @@ "prettier": "2.5.1", | ||
"ts-jest": "27.1.3", | ||
"ts-node": "10.4.0", | ||
"ts-node": "10.5.0", | ||
"typescript": "4.5.5" | ||
} | ||
} |
@@ -32,2 +32,3 @@ # HomeKit Code | ||
-c, --category Category of the HomeKit accessory, required for generating a QR Code [choices: "airConditioner", "airport", "airPurifier", "appleTv", "bridge", "dehumidifier", "door", "doorLock", "fan", "faucet", "garage", "heater", "humidifier", "ipCamera", "lightbulb", "other", "outlet", "programmableSwitch", "rangeExtender", "securitySystem", "sensor", "showerHead", "speaker", "sprinkler", "switch", "targetController", "television", "thermostat", "videoDoorBell", "window", "windowCovering"] [default: "airConditioner"] | ||
-f, --flag Flag how to connect to the HomeKit accessory. [required] [choices: "ble", "ip", "wac"] [default: "ip"] | ||
-n, --name Name of the generated file [string] [default: "homekit-qrcode"] | ||
@@ -40,4 +41,10 @@ -o, --output Format of the generated file [required] [choices: "svg", "png"] [default: "svg"] | ||
Examples: | ||
npx homekit-code qrcode --category=switch --pairingCode=84131633 --setupId=3QYT Generate a QR code for a HomeKit switch | ||
npx homekit-code qrcode --category=switch --pairingCode=84131633 --setupId=3QYT --name=switch --output=png --zoom=10 Generate a QR code for a HomeKit switch as switch.png with an image zoom factor of 10 | ||
# Generate a QR code for a HomeKit switch | ||
npx homekit-code qrcode --category=switch --pairingCode=84131633 --setupId=3QYT | ||
# Generate a QR code for a HomeKit switch as switch.png with an image zoom factor of 10 | ||
npx homekit-code qrcode --category=switch --pairingCode=84131633 --setupId=3QYT --name=switch --output=png --zoom=10 | ||
# Generate a QR code for a Bluetooth Low Energy (BLE) HomeKit switch | ||
npx homekit-code qrcode -c switch -f ble -p 84131633 -s 3QYT | ||
``` | ||
@@ -71,4 +78,7 @@ | ||
Examples: | ||
npx homekit-code tag --pairingCode=84131633 Generate a scannable tag for a HomeKit accessory | ||
npx homekit-code tag --pairingCode=84131633 --name=switch --output=png --zoom=10 Generate a scannable tag for a HomeKit accessory as switch.png with an image zoom factor of 10 | ||
# Generate a scannable tag for a HomeKit accessory | ||
npx homekit-code tag --pairingCode=84131633 | ||
# Generate a scannable tag for a HomeKit accessory as switch.png with an image zoom factor of 10 | ||
npx homekit-code tag --pairingCode=84131633 --name=switch --output=png --zoom=10 | ||
``` | ||
@@ -75,0 +85,0 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
97181
35
1068
205
5