homebridge 2.0.0-alpha.3 → 2.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -17
- package/bin/homebridge +8 -6
- package/config-sample.json +3 -3
- package/dist/childBridgeFork.js +2 -0
- package/dist/childBridgeFork.js.map +7 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +7 -0
- package/dist/index.d.ts +1099 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +7 -0
- package/package.json +49 -46
- package/lib/api.d.ts +0 -210
- package/lib/api.d.ts.map +0 -1
- package/lib/api.js +0 -155
- package/lib/api.js.map +0 -1
- package/lib/bridgeService.d.ts +0 -105
- package/lib/bridgeService.d.ts.map +0 -1
- package/lib/bridgeService.js +0 -432
- package/lib/bridgeService.js.map +0 -1
- package/lib/childBridgeFork.d.ts +0 -37
- package/lib/childBridgeFork.d.ts.map +0 -1
- package/lib/childBridgeFork.js +0 -244
- package/lib/childBridgeFork.js.map +0 -1
- package/lib/childBridgeService.d.ts +0 -199
- package/lib/childBridgeService.d.ts.map +0 -1
- package/lib/childBridgeService.js +0 -428
- package/lib/childBridgeService.js.map +0 -1
- package/lib/cli.d.ts +0 -4
- package/lib/cli.d.ts.map +0 -1
- package/lib/cli.js +0 -115
- package/lib/cli.js.map +0 -1
- package/lib/externalPortService.d.ts +0 -33
- package/lib/externalPortService.d.ts.map +0 -1
- package/lib/externalPortService.js +0 -64
- package/lib/externalPortService.js.map +0 -1
- package/lib/index.d.ts +0 -76
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -72
- package/lib/index.js.map +0 -1
- package/lib/ipcService.d.ts +0 -33
- package/lib/ipcService.d.ts.map +0 -1
- package/lib/ipcService.js +0 -49
- package/lib/ipcService.js.map +0 -1
- package/lib/logger.d.ts +0 -78
- package/lib/logger.d.ts.map +0 -1
- package/lib/logger.js +0 -147
- package/lib/logger.js.map +0 -1
- package/lib/platformAccessory.d.ts +0 -54
- package/lib/platformAccessory.d.ts.map +0 -1
- package/lib/platformAccessory.js +0 -102
- package/lib/platformAccessory.js.map +0 -1
- package/lib/plugin.d.ts +0 -31
- package/lib/plugin.d.ts.map +0 -1
- package/lib/plugin.js +0 -194
- package/lib/plugin.js.map +0 -1
- package/lib/pluginManager.d.ts +0 -77
- package/lib/pluginManager.d.ts.map +0 -1
- package/lib/pluginManager.js +0 -380
- package/lib/pluginManager.js.map +0 -1
- package/lib/server.d.ts +0 -58
- package/lib/server.d.ts.map +0 -1
- package/lib/server.js +0 -457
- package/lib/server.js.map +0 -1
- package/lib/storageService.d.ts +0 -13
- package/lib/storageService.d.ts.map +0 -1
- package/lib/storageService.js +0 -70
- package/lib/storageService.js.map +0 -1
- package/lib/user.d.ts +0 -13
- package/lib/user.d.ts.map +0 -1
- package/lib/user.js +0 -36
- package/lib/user.js.map +0 -1
- package/lib/util/mac.d.ts +0 -4
- package/lib/util/mac.d.ts.map +0 -1
- package/lib/util/mac.js +0 -20
- package/lib/util/mac.js.map +0 -1
- package/lib/version.d.ts +0 -3
- package/lib/version.d.ts.map +0 -1
- package/lib/version.js +0 -21
- package/lib/version.js.map +0 -1
package/lib/api.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.HomebridgeAPI = exports.InternalAPIEvent = exports.APIEvent = exports.PluginType = void 0;
|
|
30
|
-
const events_1 = require("events");
|
|
31
|
-
const hapNodeJs = __importStar(require("hap-nodejs"));
|
|
32
|
-
const semver_1 = __importDefault(require("semver"));
|
|
33
|
-
const logger_1 = require("./logger");
|
|
34
|
-
const platformAccessory_1 = require("./platformAccessory");
|
|
35
|
-
const pluginManager_1 = require("./pluginManager");
|
|
36
|
-
const user_1 = require("./user");
|
|
37
|
-
const version_1 = __importDefault(require("./version"));
|
|
38
|
-
const log = logger_1.Logger.internal;
|
|
39
|
-
var PluginType;
|
|
40
|
-
(function (PluginType) {
|
|
41
|
-
PluginType["ACCESSORY"] = "accessory";
|
|
42
|
-
PluginType["PLATFORM"] = "platform";
|
|
43
|
-
})(PluginType || (exports.PluginType = PluginType = {}));
|
|
44
|
-
var APIEvent;
|
|
45
|
-
(function (APIEvent) {
|
|
46
|
-
/**
|
|
47
|
-
* Event is fired once homebridge has finished with booting up and initializing all components and plugins.
|
|
48
|
-
* When this event is fired it is possible that the Bridge accessory isn't published yet, if homebridge still needs
|
|
49
|
-
* to wait for some {@see StaticPlatformPlugin | StaticPlatformPlugins} to finish accessory creation.
|
|
50
|
-
*/
|
|
51
|
-
APIEvent["DID_FINISH_LAUNCHING"] = "didFinishLaunching";
|
|
52
|
-
/**
|
|
53
|
-
* This event is fired when homebridge gets shutdown. This could be a regular shutdown or an unexpected crash.
|
|
54
|
-
* At this stage all Accessories are already unpublished and all PlatformAccessories are already saved to disk!
|
|
55
|
-
*/
|
|
56
|
-
APIEvent["SHUTDOWN"] = "shutdown";
|
|
57
|
-
})(APIEvent || (exports.APIEvent = APIEvent = {}));
|
|
58
|
-
var InternalAPIEvent;
|
|
59
|
-
(function (InternalAPIEvent) {
|
|
60
|
-
InternalAPIEvent["REGISTER_ACCESSORY"] = "registerAccessory";
|
|
61
|
-
InternalAPIEvent["REGISTER_PLATFORM"] = "registerPlatform";
|
|
62
|
-
InternalAPIEvent["PUBLISH_EXTERNAL_ACCESSORIES"] = "publishExternalAccessories";
|
|
63
|
-
InternalAPIEvent["REGISTER_PLATFORM_ACCESSORIES"] = "registerPlatformAccessories";
|
|
64
|
-
InternalAPIEvent["UPDATE_PLATFORM_ACCESSORIES"] = "updatePlatformAccessories";
|
|
65
|
-
InternalAPIEvent["UNREGISTER_PLATFORM_ACCESSORIES"] = "unregisterPlatformAccessories";
|
|
66
|
-
})(InternalAPIEvent || (exports.InternalAPIEvent = InternalAPIEvent = {}));
|
|
67
|
-
class HomebridgeAPI extends events_1.EventEmitter {
|
|
68
|
-
version = 2.7; // homebridge API version
|
|
69
|
-
serverVersion = (0, version_1.default)(); // homebridge node module version
|
|
70
|
-
// ------------------ LEGACY EXPORTS FOR PRE TYPESCRIPT ------------------
|
|
71
|
-
user = user_1.User;
|
|
72
|
-
hap = hapNodeJs;
|
|
73
|
-
hapLegacyTypes = hapNodeJs.LegacyTypes; // used for older accessories/platforms
|
|
74
|
-
platformAccessory = platformAccessory_1.PlatformAccessory;
|
|
75
|
-
// ------------------------------------------------------------------------
|
|
76
|
-
constructor() {
|
|
77
|
-
super();
|
|
78
|
-
}
|
|
79
|
-
versionGreaterOrEqual(version) {
|
|
80
|
-
return semver_1.default.gte(this.serverVersion, version);
|
|
81
|
-
}
|
|
82
|
-
static isDynamicPlatformPlugin(platformPlugin) {
|
|
83
|
-
return "configureAccessory" in platformPlugin;
|
|
84
|
-
}
|
|
85
|
-
static isStaticPlatformPlugin(platformPlugin) {
|
|
86
|
-
return "accessories" in platformPlugin;
|
|
87
|
-
}
|
|
88
|
-
signalFinished() {
|
|
89
|
-
this.emit("didFinishLaunching" /* APIEvent.DID_FINISH_LAUNCHING */);
|
|
90
|
-
}
|
|
91
|
-
signalShutdown() {
|
|
92
|
-
this.emit("shutdown" /* APIEvent.SHUTDOWN */);
|
|
93
|
-
}
|
|
94
|
-
registerAccessory(pluginIdentifier, accessoryName, constructor) {
|
|
95
|
-
if (typeof accessoryName === "function") {
|
|
96
|
-
constructor = accessoryName;
|
|
97
|
-
accessoryName = pluginIdentifier;
|
|
98
|
-
this.emit("registerAccessory" /* InternalAPIEvent.REGISTER_ACCESSORY */, accessoryName, constructor);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
this.emit("registerAccessory" /* InternalAPIEvent.REGISTER_ACCESSORY */, accessoryName, constructor, pluginIdentifier);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
registerPlatform(pluginIdentifier, platformName, constructor) {
|
|
105
|
-
if (typeof platformName === "function") {
|
|
106
|
-
constructor = platformName;
|
|
107
|
-
platformName = pluginIdentifier;
|
|
108
|
-
this.emit("registerPlatform" /* InternalAPIEvent.REGISTER_PLATFORM */, platformName, constructor);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
this.emit("registerPlatform" /* InternalAPIEvent.REGISTER_PLATFORM */, platformName, constructor, pluginIdentifier);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
publishCameraAccessories(pluginIdentifier, accessories) {
|
|
115
|
-
this.publishExternalAccessories(pluginIdentifier, accessories);
|
|
116
|
-
}
|
|
117
|
-
publishExternalAccessories(pluginIdentifier, accessories) {
|
|
118
|
-
if (!pluginManager_1.PluginManager.isQualifiedPluginIdentifier(pluginIdentifier)) {
|
|
119
|
-
log.info(`One of your plugins incorrectly registered an external accessory using the platform name (${pluginIdentifier}) and not the plugin identifier. Please report this to the developer!`);
|
|
120
|
-
}
|
|
121
|
-
accessories.forEach(accessory => {
|
|
122
|
-
// noinspection SuspiciousTypeOfGuard
|
|
123
|
-
if (!(accessory instanceof platformAccessory_1.PlatformAccessory)) {
|
|
124
|
-
throw new Error(`${pluginIdentifier} attempt to register an accessory that isn't PlatformAccessory!`);
|
|
125
|
-
}
|
|
126
|
-
accessory._associatedPlugin = pluginIdentifier;
|
|
127
|
-
});
|
|
128
|
-
this.emit("publishExternalAccessories" /* InternalAPIEvent.PUBLISH_EXTERNAL_ACCESSORIES */, accessories);
|
|
129
|
-
}
|
|
130
|
-
registerPlatformAccessories(pluginIdentifier, platformName, accessories) {
|
|
131
|
-
accessories.forEach(accessory => {
|
|
132
|
-
// noinspection SuspiciousTypeOfGuard
|
|
133
|
-
if (!(accessory instanceof platformAccessory_1.PlatformAccessory)) {
|
|
134
|
-
throw new Error(`${pluginIdentifier} - ${platformName} attempt to register an accessory that isn't PlatformAccessory!`);
|
|
135
|
-
}
|
|
136
|
-
accessory._associatedPlugin = pluginIdentifier;
|
|
137
|
-
accessory._associatedPlatform = platformName;
|
|
138
|
-
});
|
|
139
|
-
this.emit("registerPlatformAccessories" /* InternalAPIEvent.REGISTER_PLATFORM_ACCESSORIES */, accessories);
|
|
140
|
-
}
|
|
141
|
-
updatePlatformAccessories(accessories) {
|
|
142
|
-
this.emit("updatePlatformAccessories" /* InternalAPIEvent.UPDATE_PLATFORM_ACCESSORIES */, accessories);
|
|
143
|
-
}
|
|
144
|
-
unregisterPlatformAccessories(pluginIdentifier, platformName, accessories) {
|
|
145
|
-
accessories.forEach(accessory => {
|
|
146
|
-
// noinspection SuspiciousTypeOfGuard
|
|
147
|
-
if (!(accessory instanceof platformAccessory_1.PlatformAccessory)) {
|
|
148
|
-
throw new Error(`${pluginIdentifier} - ${platformName} attempt to unregister an accessory that isn't PlatformAccessory!`);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
this.emit("unregisterPlatformAccessories" /* InternalAPIEvent.UNREGISTER_PLATFORM_ACCESSORIES */, accessories);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
exports.HomebridgeAPI = HomebridgeAPI;
|
|
155
|
-
//# sourceMappingURL=api.js.map
|
package/lib/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsC;AACtC,sDAAwC;AAExC,oDAA4B;AAE5B,qCAA2C;AAC3C,2DAAwD;AACxD,mDAAgD;AAChD,iCAA8B;AAC9B,wDAAmC;AAEnC,MAAM,GAAG,GAAG,eAAM,CAAC,QAAQ,CAAC;AAc5B,IAAkB,UAGjB;AAHD,WAAkB,UAAU;IAC1B,qCAAuB,CAAA;IACvB,mCAAqB,CAAA;AACvB,CAAC,EAHiB,UAAU,0BAAV,UAAU,QAG3B;AA6GD,IAAkB,QAYjB;AAZD,WAAkB,QAAQ;IACxB;;;;OAIG;IACH,uDAA2C,CAAA;IAC3C;;;OAGG;IACH,iCAAqB,CAAA;AACvB,CAAC,EAZiB,QAAQ,wBAAR,QAAQ,QAYzB;AAED,IAAkB,gBAQjB;AARD,WAAkB,gBAAgB;IAChC,4DAAwC,CAAA;IACxC,0DAAsC,CAAA;IAEtC,+EAA2D,CAAA;IAC3D,iFAA6D,CAAA;IAC7D,6EAAyD,CAAA;IACzD,qFAAiE,CAAA;AACnE,CAAC,EARiB,gBAAgB,gCAAhB,gBAAgB,QAQjC;AAkFD,MAAa,aAAc,SAAQ,qBAAY;IAE7B,OAAO,GAAG,GAAG,CAAC,CAAC,yBAAyB;IACxC,aAAa,GAA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FAAiD,WAAW,CAAC,CAAC;IACzE,CAAC;IAED,yBAAyB,CAAC,WAAgC;QACxD,IAAI,CAAC,IAAI,iFAA+C,WAAW,CAAC,CAAC;IACvE,CAAC;IAED,6BAA6B,CAAC,gBAAkC,EAAE,YAA0B,EAAE,WAAgC;QAC5H,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YAC9B,qCAAqC;YACrC,IAAI,CAAC,CAAC,SAAS,YAAY,qCAAiB,CAAC,EAAE,CAAC;gBAC9C,MAAM,IAAI,KAAK,CAAC,GAAG,gBAAgB,MAAM,YAAY,mEAAmE,CAAC,CAAC;YAC5H,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,yFAAmD,WAAW,CAAC,CAAC;IAC3E,CAAC;CAGF;AAjHD,sCAiHC"}
|
package/lib/bridgeService.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Accessory, Bridge, CharacteristicWarning, InterfaceName, IPAddress, MacAddress, MDNSAdvertiser } from "hap-nodejs";
|
|
2
|
-
import { AccessoryIdentifier, AccessoryName, AccessoryPlugin, HomebridgeAPI, PlatformIdentifier, PlatformName, PluginIdentifier, StaticPlatformPlugin } from "./api";
|
|
3
|
-
import { ExternalPortService, ExternalPortsConfiguration } from "./externalPortService";
|
|
4
|
-
import { Logging } from "./logger";
|
|
5
|
-
import { PlatformAccessory } from "./platformAccessory";
|
|
6
|
-
import { Plugin } from "./plugin";
|
|
7
|
-
import { PluginManager } from "./pluginManager";
|
|
8
|
-
import { HomebridgeOptions } from "./server";
|
|
9
|
-
export interface BridgeConfiguration {
|
|
10
|
-
name: string;
|
|
11
|
-
username: MacAddress;
|
|
12
|
-
pin: string;
|
|
13
|
-
advertiser?: MDNSAdvertiser;
|
|
14
|
-
port?: number;
|
|
15
|
-
bind?: (InterfaceName | IPAddress) | (InterfaceName | IPAddress)[];
|
|
16
|
-
setupID?: string[4];
|
|
17
|
-
manufacturer?: string;
|
|
18
|
-
model?: string;
|
|
19
|
-
disableIpc?: boolean;
|
|
20
|
-
firmwareRevision?: string;
|
|
21
|
-
env?: {
|
|
22
|
-
DEBUG?: string;
|
|
23
|
-
NODE_OPTIONS?: string;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export interface AccessoryConfig extends Record<string, any> {
|
|
27
|
-
accessory: AccessoryName | AccessoryIdentifier;
|
|
28
|
-
name: string;
|
|
29
|
-
uuid_base?: string;
|
|
30
|
-
_bridge?: BridgeConfiguration;
|
|
31
|
-
}
|
|
32
|
-
export interface PlatformConfig extends Record<string, any> {
|
|
33
|
-
platform: PlatformName | PlatformIdentifier;
|
|
34
|
-
name?: string;
|
|
35
|
-
_bridge?: BridgeConfiguration;
|
|
36
|
-
}
|
|
37
|
-
export interface HomebridgeConfig {
|
|
38
|
-
bridge: BridgeConfiguration;
|
|
39
|
-
accessories: AccessoryConfig[];
|
|
40
|
-
platforms: PlatformConfig[];
|
|
41
|
-
plugins?: PluginIdentifier[];
|
|
42
|
-
/**
|
|
43
|
-
* Array of disabled plugins.
|
|
44
|
-
* Unlike the plugins[] config which prevents plugins from being initialised at all, disabled plugins still have their alias loaded, so
|
|
45
|
-
* we can match config blocks of disabled plugins and show an appropriate message in the logs.
|
|
46
|
-
*/
|
|
47
|
-
disabledPlugins?: PluginIdentifier[];
|
|
48
|
-
ports?: ExternalPortsConfiguration;
|
|
49
|
-
}
|
|
50
|
-
export interface BridgeOptions extends HomebridgeOptions {
|
|
51
|
-
cachedAccessoriesDir: string;
|
|
52
|
-
cachedAccessoriesItemName: string;
|
|
53
|
-
}
|
|
54
|
-
export interface CharacteristicWarningOpts {
|
|
55
|
-
ignoreSlow?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export declare class BridgeService {
|
|
58
|
-
private api;
|
|
59
|
-
private pluginManager;
|
|
60
|
-
private externalPortService;
|
|
61
|
-
private bridgeOptions;
|
|
62
|
-
private bridgeConfig;
|
|
63
|
-
private config;
|
|
64
|
-
bridge: Bridge;
|
|
65
|
-
private storageService;
|
|
66
|
-
private readonly allowInsecureAccess;
|
|
67
|
-
private cachedPlatformAccessories;
|
|
68
|
-
private cachedAccessoriesFileLoaded;
|
|
69
|
-
private readonly publishedExternalAccessories;
|
|
70
|
-
constructor(api: HomebridgeAPI, pluginManager: PluginManager, externalPortService: ExternalPortService, bridgeOptions: BridgeOptions, bridgeConfig: BridgeConfiguration, config: HomebridgeConfig);
|
|
71
|
-
static printCharacteristicWriteWarning(plugin: Plugin, accessory: Accessory, opts: CharacteristicWarningOpts, warning: CharacteristicWarning): void;
|
|
72
|
-
publishBridge(): void;
|
|
73
|
-
/**
|
|
74
|
-
* Attempt to load the cached accessories from disk.
|
|
75
|
-
*/
|
|
76
|
-
loadCachedPlatformAccessoriesFromDisk(): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Return the name of the backup cache file
|
|
79
|
-
*/
|
|
80
|
-
private get backupCacheFileName();
|
|
81
|
-
/**
|
|
82
|
-
* Create a backup of the cached file
|
|
83
|
-
* This is used if we ever have trouble reading the main cache file
|
|
84
|
-
*/
|
|
85
|
-
private createCachedAccessoriesBackup;
|
|
86
|
-
/**
|
|
87
|
-
* Restore a cached accessories backup
|
|
88
|
-
* This is used if the main cache file has a JSON syntax error / is corrupted
|
|
89
|
-
*/
|
|
90
|
-
private restoreCachedAccessoriesBackup;
|
|
91
|
-
restoreCachedPlatformAccessories(): void;
|
|
92
|
-
/**
|
|
93
|
-
* Save the cached accessories back to disk.
|
|
94
|
-
*/
|
|
95
|
-
saveCachedPlatformAccessoriesOnDisk(): void;
|
|
96
|
-
handleRegisterPlatformAccessories(accessories: PlatformAccessory[]): void;
|
|
97
|
-
handleUpdatePlatformAccessories(accessories: PlatformAccessory[]): void;
|
|
98
|
-
handleUnregisterPlatformAccessories(accessories: PlatformAccessory[]): void;
|
|
99
|
-
handlePublishExternalAccessories(accessories: PlatformAccessory[]): Promise<void>;
|
|
100
|
-
createHAPAccessory(plugin: Plugin, accessoryInstance: AccessoryPlugin, displayName: string, accessoryType: AccessoryName | AccessoryIdentifier, uuidBase?: string): Accessory | undefined;
|
|
101
|
-
loadPlatformAccessories(plugin: Plugin, platformInstance: StaticPlatformPlugin, platformType: PlatformName | PlatformIdentifier, logger: Logging): Promise<void>;
|
|
102
|
-
teardown(): void;
|
|
103
|
-
private static strippingPinCode;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=bridgeService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridgeService.d.ts","sourceRoot":"","sources":["../src/bridgeService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,MAAM,EAIN,qBAAqB,EAErB,aAAa,EACb,SAAS,EACT,UAAU,EAMV,cAAc,EAEf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,aAAa,EAEb,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAU,OAAO,EAAgB,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAA+B,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAO7C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,aAAa,GAAG,SAA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