node-red-contrib-homekit-bridged 1.7.0-dev.0 → 1.7.0-dev.10
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/LICENSE +1 -1
- package/build/lib/HAPHostNode.js +21 -10
- package/build/lib/HAPServiceNode.js +4 -2
- package/build/lib/HAPServiceNode2.js +4 -2
- package/build/lib/api.js +12 -11
- package/build/lib/hap/HAPCharacteristic.d.ts +9 -0
- package/build/lib/hap/HAPCharacteristic.js +6 -0
- package/build/lib/hap/HAPService.d.ts +6 -0
- package/build/lib/hap/HAPService.js +6 -0
- package/build/lib/hap/eve-app/EveCharacteristics.d.ts +20 -0
- package/build/lib/hap/eve-app/EveCharacteristics.js +89 -0
- package/build/lib/hap/eve-app/EveServices.d.ts +5 -0
- package/build/lib/hap/eve-app/EveServices.js +20 -0
- package/build/lib/types/HAPHostConfigType.d.ts +3 -1
- package/build/lib/types/HAPHostNodeType.d.ts +2 -3
- package/build/lib/types/HAPService2ConfigType.d.ts +3 -20
- package/build/lib/types/HAPService2NodeType.d.ts +1 -30
- package/build/lib/types/HAPServiceConfigType.d.ts +4 -0
- package/build/lib/types/HAPServiceNodeType.d.ts +2 -1
- package/build/lib/types/PublishTimersType.d.ts +0 -1
- package/build/lib/types/hap-nodejs/BonjourMulticastOptions.d.ts +10 -0
- package/build/lib/types/hap-nodejs/BonjourMulticastOptions.js +2 -0
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +5 -0
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +8 -0
- package/build/lib/utils/NodeStatusUtils.d.ts +0 -1
- package/build/lib/utils/ServiceUtils.js +101 -12
- package/build/lib/utils/ServiceUtils2.js +17 -7
- package/build/nodes/bridge.html +87 -18
- package/build/nodes/nrchkb.html +148 -117
- package/build/nodes/service.html +41 -1
- package/build/nodes/service2.html +41 -1
- package/build/nodes/standalone.html +93 -24
- package/package.json +12 -12
- /package/build/lib/types/{HapCategories.d.ts → hap-nodejs/HapCategories.d.ts} +0 -0
- /package/build/lib/types/{HapCategories.js → hap-nodejs/HapCategories.js} +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024 Node-RED Contribution - HomeKit Bridged
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/build/lib/HAPHostNode.js
CHANGED
|
@@ -17,12 +17,12 @@ const hap_nodejs_1 = require("hap-nodejs");
|
|
|
17
17
|
const semver_1 = require("semver");
|
|
18
18
|
const preload_1 = __importDefault(require("semver/preload"));
|
|
19
19
|
const NRCHKBError_1 = __importDefault(require("./NRCHKBError"));
|
|
20
|
-
const HapCategories_1 = __importDefault(require("./types/HapCategories"));
|
|
20
|
+
const HapCategories_1 = __importDefault(require("./types/hap-nodejs/HapCategories"));
|
|
21
21
|
const HostType_1 = __importDefault(require("./types/HostType"));
|
|
22
22
|
module.exports = (RED, hostType) => {
|
|
23
23
|
const MdnsUtils = require('./utils/MdnsUtils')();
|
|
24
24
|
const init = function (config) {
|
|
25
|
-
var _a, _b, _c, _d, _e;
|
|
25
|
+
var _a, _b, _c, _d, _e, _f;
|
|
26
26
|
const self = this;
|
|
27
27
|
const log = (0, logger_1.logger)('NRCHKB', 'HAPHostNode', config.bridgeName, self);
|
|
28
28
|
self.hostType = hostType;
|
|
@@ -36,7 +36,8 @@ module.exports = (RED, hostType) => {
|
|
|
36
36
|
if (preload_1.default.parse(config.firmwareRev) == null) {
|
|
37
37
|
config.firmwareRev = new semver_1.SemVer('0.0.0');
|
|
38
38
|
}
|
|
39
|
-
if (config.customMdnsConfig) {
|
|
39
|
+
if (!((_a = config.bind) === null || _a === void 0 ? void 0 : _a.length) && config.customMdnsConfig) {
|
|
40
|
+
log.error('Custom mdns config is deprecated, use bind instead!');
|
|
40
41
|
self.mdnsConfig = {};
|
|
41
42
|
if (MdnsUtils.checkMulticast(config.mdnsMulticast)) {
|
|
42
43
|
self.mdnsConfig.multicast = config.mdnsMulticast;
|
|
@@ -45,13 +46,13 @@ module.exports = (RED, hostType) => {
|
|
|
45
46
|
self.mdnsConfig.interface = config.mdnsInterface;
|
|
46
47
|
}
|
|
47
48
|
if (MdnsUtils.checkPort(config.mdnsPort)) {
|
|
48
|
-
self.mdnsConfig.port = parseInt((
|
|
49
|
+
self.mdnsConfig.port = parseInt((_b = config.mdnsPort) === null || _b === void 0 ? void 0 : _b.toString());
|
|
49
50
|
}
|
|
50
51
|
if (MdnsUtils.checkIp(config.mdnsIp)) {
|
|
51
52
|
self.mdnsConfig.ip = config.mdnsIp;
|
|
52
53
|
}
|
|
53
54
|
if (MdnsUtils.checkTtl(config.mdnsTtl)) {
|
|
54
|
-
self.mdnsConfig.ttl = parseInt((
|
|
55
|
+
self.mdnsConfig.ttl = parseInt((_c = config.mdnsTtl) === null || _c === void 0 ? void 0 : _c.toString());
|
|
55
56
|
}
|
|
56
57
|
if (MdnsUtils.checkLoopback(config.mdnsLoopback)) {
|
|
57
58
|
self.mdnsConfig.loopback = config.mdnsLoopback;
|
|
@@ -81,7 +82,7 @@ module.exports = (RED, hostType) => {
|
|
|
81
82
|
self.host = new hap_nodejs_1.Accessory(self.name, hostUUID);
|
|
82
83
|
}
|
|
83
84
|
self.publish = function () {
|
|
84
|
-
var _a, _b, _c;
|
|
85
|
+
var _a, _b, _c, _d;
|
|
85
86
|
if (self.hostType == HostType_1.default.BRIDGE) {
|
|
86
87
|
log.debug(`Publishing ${hostTypeName} with pin code ${self.config.pinCode} and ${self.host.bridgedAccessories.length} accessories`);
|
|
87
88
|
}
|
|
@@ -99,6 +100,15 @@ module.exports = (RED, hostType) => {
|
|
|
99
100
|
oldPinCode = oldPinCode.replace(/-/g, '');
|
|
100
101
|
oldPinCode = `${oldPinCode.slice(0, 3)}-${oldPinCode.slice(3, 5)}-${oldPinCode.slice(5, 8)}`;
|
|
101
102
|
}
|
|
103
|
+
let bind;
|
|
104
|
+
if (((_c = self.config.bind) === null || _c === void 0 ? void 0 : _c.length) && self.config.bindType) {
|
|
105
|
+
if (self.config.bindType == 'str') {
|
|
106
|
+
bind = self.config.bind;
|
|
107
|
+
}
|
|
108
|
+
else if (self.config.bindType == 'json') {
|
|
109
|
+
bind = JSON.parse(self.config.bind);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
102
112
|
self.host.publish({
|
|
103
113
|
username: self.bridgeUsername,
|
|
104
114
|
port: self.config.port && !isNaN(self.config.port)
|
|
@@ -107,7 +117,8 @@ module.exports = (RED, hostType) => {
|
|
|
107
117
|
pincode: oldPinCode,
|
|
108
118
|
category: self.accessoryCategory,
|
|
109
119
|
mdns: self.mdnsConfig,
|
|
110
|
-
|
|
120
|
+
bind: bind,
|
|
121
|
+
advertiser: (_d = self.config.advertiser) !== null && _d !== void 0 ? _d : "bonjour-hap",
|
|
111
122
|
}, self.config.allowInsecureRequest);
|
|
112
123
|
self.published = true;
|
|
113
124
|
return true;
|
|
@@ -141,9 +152,9 @@ module.exports = (RED, hostType) => {
|
|
|
141
152
|
.setCharacteristic(hap_nodejs_1.Characteristic.Manufacturer, self.config.manufacturer)
|
|
142
153
|
.setCharacteristic(hap_nodejs_1.Characteristic.SerialNumber, self.config.serialNo)
|
|
143
154
|
.setCharacteristic(hap_nodejs_1.Characteristic.Model, self.config.model)
|
|
144
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.FirmwareRevision, (
|
|
145
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.HardwareRevision, (
|
|
146
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.SoftwareRevision, (
|
|
155
|
+
.setCharacteristic(hap_nodejs_1.Characteristic.FirmwareRevision, (_d = self.config.firmwareRev) === null || _d === void 0 ? void 0 : _d.toString())
|
|
156
|
+
.setCharacteristic(hap_nodejs_1.Characteristic.HardwareRevision, (_e = self.config.hardwareRev) === null || _e === void 0 ? void 0 : _e.toString())
|
|
157
|
+
.setCharacteristic(hap_nodejs_1.Characteristic.SoftwareRevision, (_f = self.config.softwareRev) === null || _f === void 0 ? void 0 : _f.toString());
|
|
147
158
|
};
|
|
148
159
|
const macify = (nodeId) => {
|
|
149
160
|
if (nodeId) {
|
|
@@ -95,8 +95,9 @@ module.exports = (RED) => {
|
|
|
95
95
|
: self.config.accessoryId;
|
|
96
96
|
self.hostNode = RED.nodes.getNode(hostId);
|
|
97
97
|
if (!self.hostNode) {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
const message = `Host node ${self.config.hostType == HostType_1.default.BRIDGE ? 'Bridge' : 'Standalone Accessory'} ${hostId} not found`;
|
|
99
|
+
log.error(message, false);
|
|
100
|
+
throw new NRCHKBError_1.default(message);
|
|
100
101
|
}
|
|
101
102
|
self.childNodes = [];
|
|
102
103
|
self.childNodes.push(self);
|
|
@@ -161,6 +162,7 @@ module.exports = (RED) => {
|
|
|
161
162
|
config: self.config,
|
|
162
163
|
}, self.parentService);
|
|
163
164
|
self.characteristicProperties = CharacteristicUtils.load(self.service, self.config);
|
|
165
|
+
ServiceUtils.configureAdaptiveLightning();
|
|
164
166
|
if (self.config.isParent) {
|
|
165
167
|
BridgeUtils.delayedPublish(self);
|
|
166
168
|
}
|
|
@@ -95,8 +95,9 @@ module.exports = (RED) => {
|
|
|
95
95
|
: self.config.accessoryId;
|
|
96
96
|
self.hostNode = RED.nodes.getNode(hostId);
|
|
97
97
|
if (!self.hostNode) {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
const message = `Host node ${self.config.hostType == HostType_1.default.BRIDGE ? 'Bridge' : 'Standalone Accessory'} ${hostId} not found`;
|
|
99
|
+
log.error(message, false);
|
|
100
|
+
throw new NRCHKBError_1.default(message);
|
|
100
101
|
}
|
|
101
102
|
self.childNodes = [];
|
|
102
103
|
self.childNodes.push(self);
|
|
@@ -161,6 +162,7 @@ module.exports = (RED) => {
|
|
|
161
162
|
config: self.config,
|
|
162
163
|
}, self.parentService);
|
|
163
164
|
self.characteristicProperties = CharacteristicUtils.load(self.service, self.config);
|
|
165
|
+
ServiceUtils.configureAdaptiveLightning();
|
|
164
166
|
if (self.config.isParent) {
|
|
165
167
|
BridgeUtils.delayedPublish(self);
|
|
166
168
|
}
|
package/build/lib/api.js
CHANGED
|
@@ -25,8 +25,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const logger_1 = require("@nrchkb/logger");
|
|
27
27
|
const hap_nodejs_1 = require("hap-nodejs");
|
|
28
|
+
const EveCharacteristics_1 = __importDefault(require("./hap/eve-app/EveCharacteristics"));
|
|
28
29
|
const Storage_1 = require("./Storage");
|
|
29
|
-
const HapCategories_1 = __importDefault(require("./types/HapCategories"));
|
|
30
|
+
const HapCategories_1 = __importDefault(require("./types/hap-nodejs/HapCategories"));
|
|
30
31
|
const version = require('../../package.json').version.trim();
|
|
31
32
|
module.exports = function (RED) {
|
|
32
33
|
const log = (0, logger_1.logger)('NRCHKB', 'API');
|
|
@@ -127,9 +128,9 @@ module.exports = function (RED) {
|
|
|
127
128
|
});
|
|
128
129
|
};
|
|
129
130
|
const _initNRCHKBCustomCharacteristicsAPI = () => __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
const getCustomCharacteristics = () => {
|
|
131
|
-
|
|
132
|
-
.
|
|
131
|
+
const getCustomCharacteristics = () => __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
try {
|
|
133
|
+
const value = yield Storage_1.Storage.loadCustomCharacteristics();
|
|
133
134
|
log.trace('loadCustomCharacteristics()');
|
|
134
135
|
log.trace(value);
|
|
135
136
|
if (Array.isArray(value)) {
|
|
@@ -137,14 +138,14 @@ module.exports = function (RED) {
|
|
|
137
138
|
}
|
|
138
139
|
else {
|
|
139
140
|
log.debug('customCharacteristics is not Array, returning empty value');
|
|
140
|
-
return
|
|
141
|
+
return EveCharacteristics_1.default;
|
|
141
142
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
144
145
|
log.error(`Failed to get customCharacteristics in nrchkbStorage due to ${error}`);
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
};
|
|
146
|
+
return EveCharacteristics_1.default;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
148
149
|
const characteristicNameToKey = (name) => {
|
|
149
150
|
return name.replace(' ', '');
|
|
150
151
|
};
|
|
@@ -260,7 +261,7 @@ module.exports = function (RED) {
|
|
|
260
261
|
});
|
|
261
262
|
}));
|
|
262
263
|
RED.httpAdmin.post('/nrchkb/config', RED.auth.needsPermission('nrchkb.write'), (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
263
|
-
const customCharacteristics = req.body.customCharacteristics ||
|
|
264
|
+
const customCharacteristics = req.body.customCharacteristics || EveCharacteristics_1.default;
|
|
264
265
|
Storage_1.Storage.saveCustomCharacteristics(customCharacteristics)
|
|
265
266
|
.then(() => {
|
|
266
267
|
res.sendStatus(200);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Characteristic } from 'hap-nodejs';
|
|
2
|
+
import { EveS2R1, EveS2R2, EveS2W1, EveS2W2 } from './eve-app/EveCharacteristics';
|
|
3
|
+
declare class HAPCharacteristic extends Characteristic {
|
|
4
|
+
static EveS2R1: typeof EveS2R1;
|
|
5
|
+
static EveS2R2: typeof EveS2R2;
|
|
6
|
+
static EveS2W1: typeof EveS2W1;
|
|
7
|
+
static EveS2W2: typeof EveS2W2;
|
|
8
|
+
}
|
|
9
|
+
export default HAPCharacteristic;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import CustomCharacteristicType from '../../types/CustomCharacteristicType';
|
|
2
|
+
import HAPCharacteristic from '../HAPCharacteristic';
|
|
3
|
+
declare const EveCharacteristics: CustomCharacteristicType[];
|
|
4
|
+
export declare class EveS2R1 extends HAPCharacteristic {
|
|
5
|
+
static readonly UUID: string;
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class EveS2R2 extends HAPCharacteristic {
|
|
9
|
+
static readonly UUID: string;
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
12
|
+
export declare class EveS2W1 extends HAPCharacteristic {
|
|
13
|
+
static readonly UUID: string;
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
16
|
+
export declare class EveS2W2 extends HAPCharacteristic {
|
|
17
|
+
static readonly UUID: string;
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
20
|
+
export default EveCharacteristics;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EveS2W2 = exports.EveS2W1 = exports.EveS2R2 = exports.EveS2R1 = void 0;
|
|
7
|
+
const HAPCharacteristic_1 = __importDefault(require("../HAPCharacteristic"));
|
|
8
|
+
const EveCharacteristics = [
|
|
9
|
+
{
|
|
10
|
+
UUID: 'E863F10A-079E-48FF-8F27-9C2605A29F52',
|
|
11
|
+
name: 'Eve-Volt',
|
|
12
|
+
format: "float",
|
|
13
|
+
perms: ["pr"],
|
|
14
|
+
description: 'Volt (V) value. Used by Eve.app.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
UUID: 'E863F126-079E-48FF-8F27-9C2605A29F52',
|
|
18
|
+
name: 'Eve-Ampere',
|
|
19
|
+
format: "float",
|
|
20
|
+
perms: ["pr"],
|
|
21
|
+
description: 'Ampere (A) value. Used by Eve.app.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
UUID: 'E863F10D-079E-48FF-8F27-9C2605A29F52',
|
|
25
|
+
name: 'Eve-Watt',
|
|
26
|
+
format: "float",
|
|
27
|
+
perms: ["pr"],
|
|
28
|
+
description: 'Watt (W) value. Used by Eve.app, reported as "Consumption".',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
UUID: 'E863F10C-079E-48FF-8F27-9C2605A29F52',
|
|
32
|
+
name: 'Eve-Kilowatt-hour',
|
|
33
|
+
format: "float",
|
|
34
|
+
perms: ["pr"],
|
|
35
|
+
description: 'Kilowatt-hour (kWh) value. Used by Eve.app, reported as Total Consumption.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
UUID: 'E863F110-079E-48FF-8F27-9C2605A29F52',
|
|
39
|
+
name: 'Eve-Volt-Ampere',
|
|
40
|
+
format: "uint16",
|
|
41
|
+
perms: ["pr"],
|
|
42
|
+
description: 'Volt-Ampere (VA) value. Used by Eve.app.',
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
class EveS2R1 extends HAPCharacteristic_1.default {
|
|
46
|
+
constructor() {
|
|
47
|
+
super('Eve-S2R1', EveS2R1.UUID, {
|
|
48
|
+
format: "data",
|
|
49
|
+
perms: ["pr", "ev", "hd"],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.EveS2R1 = EveS2R1;
|
|
54
|
+
EveS2R1.UUID = 'E863F116-079E-48FF-8F27-9C2605A29F52';
|
|
55
|
+
HAPCharacteristic_1.default.EveS2R1 = EveS2R1;
|
|
56
|
+
class EveS2R2 extends HAPCharacteristic_1.default {
|
|
57
|
+
constructor() {
|
|
58
|
+
super('Eve-S2R2', EveS2R2.UUID, {
|
|
59
|
+
format: "data",
|
|
60
|
+
perms: ["pr", "ev", "hd"],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.EveS2R2 = EveS2R2;
|
|
65
|
+
EveS2R2.UUID = 'E863F117-079E-48FF-8F27-9C2605A29F52';
|
|
66
|
+
HAPCharacteristic_1.default.EveS2R2 = EveS2R2;
|
|
67
|
+
class EveS2W1 extends HAPCharacteristic_1.default {
|
|
68
|
+
constructor() {
|
|
69
|
+
super('Eve-S2W1', EveS2W1.UUID, {
|
|
70
|
+
format: "data",
|
|
71
|
+
perms: ["pw", "hd"],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.EveS2W1 = EveS2W1;
|
|
76
|
+
EveS2W1.UUID = 'E863F11C-079E-48FF-8F27-9C2605A29F52';
|
|
77
|
+
HAPCharacteristic_1.default.EveS2W1 = EveS2W1;
|
|
78
|
+
class EveS2W2 extends HAPCharacteristic_1.default {
|
|
79
|
+
constructor() {
|
|
80
|
+
super('Eve-S2W2', EveS2W2.UUID, {
|
|
81
|
+
format: "data",
|
|
82
|
+
perms: ["pw", "hd"],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.EveS2W2 = EveS2W2;
|
|
87
|
+
EveS2W2.UUID = 'E863F121-079E-48FF-8F27-9C2605A29F52';
|
|
88
|
+
HAPCharacteristic_1.default.EveS2W2 = EveS2W2;
|
|
89
|
+
exports.default = EveCharacteristics;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EveHistoryData = void 0;
|
|
7
|
+
const HAPCharacteristic_1 = __importDefault(require("../HAPCharacteristic"));
|
|
8
|
+
const HAPService_1 = __importDefault(require("../HAPService"));
|
|
9
|
+
class EveHistoryData extends HAPService_1.default {
|
|
10
|
+
constructor() {
|
|
11
|
+
super('EveHistoryData', EveHistoryData.UUID);
|
|
12
|
+
this.addCharacteristic(HAPCharacteristic_1.default.EveS2R1);
|
|
13
|
+
this.addCharacteristic(HAPCharacteristic_1.default.EveS2R2);
|
|
14
|
+
this.addCharacteristic(HAPCharacteristic_1.default.EveS2W1);
|
|
15
|
+
this.addCharacteristic(HAPCharacteristic_1.default.EveS2W2);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.EveHistoryData = EveHistoryData;
|
|
19
|
+
EveHistoryData.UUID = 'E863F007-079E-48FF-8F27-9C2605A29F52';
|
|
20
|
+
HAPService_1.default.EveHistoryData = EveHistoryData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MDNSAdvertiser } from 'hap-nodejs';
|
|
2
2
|
import { NodeDef } from 'node-red';
|
|
3
3
|
import { SemVer } from 'semver';
|
|
4
|
-
import HapCategories from './HapCategories';
|
|
4
|
+
import HapCategories from './hap-nodejs/HapCategories';
|
|
5
5
|
type HAPHostConfigType = NodeDef & {
|
|
6
6
|
bridgeName: string;
|
|
7
7
|
pinCode: string;
|
|
@@ -13,6 +13,8 @@ type HAPHostConfigType = NodeDef & {
|
|
|
13
13
|
firmwareRev: SemVer;
|
|
14
14
|
hardwareRev: SemVer;
|
|
15
15
|
softwareRev: SemVer;
|
|
16
|
+
bind?: string;
|
|
17
|
+
bindType?: 'json' | 'str';
|
|
16
18
|
customMdnsConfig: boolean;
|
|
17
19
|
mdnsMulticast: boolean;
|
|
18
20
|
mdnsInterface: string;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/// <reference types="hap-nodejs/@types/bonjour-hap" />
|
|
2
|
-
import { MulticastOptions } from 'bonjour-hap';
|
|
3
1
|
import { Accessory, Categories } from 'hap-nodejs';
|
|
2
|
+
import BonjourMulticastOptions from './hap-nodejs/BonjourMulticastOptions';
|
|
4
3
|
import HAPHostConfigType from './HAPHostConfigType';
|
|
5
4
|
import HostType from './HostType';
|
|
6
5
|
import NodeType from './NodeType';
|
|
7
6
|
type HAPHostNodeType = NodeType & {
|
|
8
7
|
config: HAPHostConfigType;
|
|
9
|
-
mdnsConfig:
|
|
8
|
+
mdnsConfig: BonjourMulticastOptions;
|
|
10
9
|
accessoryCategory: Categories;
|
|
11
10
|
published: boolean;
|
|
12
11
|
bridgeUsername: string;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import { NodeDef } from 'node-red';
|
|
2
|
-
import
|
|
3
|
-
type HAPService2ConfigType = NodeDef & {
|
|
4
|
-
isParent: boolean;
|
|
5
|
-
hostType: number;
|
|
6
|
-
bridge: string;
|
|
7
|
-
accessoryId: string;
|
|
8
|
-
parentService: string;
|
|
9
|
-
name: string;
|
|
10
|
-
serviceName: string;
|
|
11
|
-
topic: string;
|
|
12
|
-
filter: boolean;
|
|
13
|
-
manufacturer: string;
|
|
14
|
-
model: string;
|
|
15
|
-
serialNo: string;
|
|
16
|
-
firmwareRev?: string;
|
|
17
|
-
hardwareRev?: string;
|
|
18
|
-
softwareRev?: string;
|
|
19
|
-
characteristicProperties: string;
|
|
20
|
-
waitForSetupMsg: boolean;
|
|
2
|
+
import HAPServiceConfigType from './HAPServiceConfigType';
|
|
3
|
+
type HAPService2ConfigType = NodeDef & HAPServiceConfigType & {
|
|
21
4
|
useEventCallback: boolean;
|
|
22
|
-
}
|
|
5
|
+
};
|
|
23
6
|
export default HAPService2ConfigType;
|
|
@@ -1,36 +1,7 @@
|
|
|
1
|
-
import { Accessory, Characteristic, CharacteristicChange, CharacteristicGetCallback, CharacteristicProps, CharacteristicSetCallback, CharacteristicValue, Service } from 'hap-nodejs';
|
|
2
|
-
import { HAPConnection } from 'hap-nodejs/dist/lib/util/eventedhttp';
|
|
3
|
-
import { NodeAPI } from 'node-red';
|
|
4
|
-
import { NodeStatusUtils } from '../utils/NodeStatusUtils';
|
|
5
|
-
import HAPHostNodeType from './HAPHostNodeType';
|
|
6
1
|
import HAPService2ConfigType from './HAPService2ConfigType';
|
|
7
2
|
import HAPServiceNodeType from './HAPServiceNodeType';
|
|
8
3
|
import NodeType from './NodeType';
|
|
9
|
-
|
|
10
|
-
type HAPService2NodeType = NodeType & {
|
|
4
|
+
type HAPService2NodeType = NodeType & HAPServiceNodeType & {
|
|
11
5
|
config: HAPService2ConfigType;
|
|
12
|
-
RED: NodeAPI;
|
|
13
|
-
setupDone: boolean;
|
|
14
|
-
configured: boolean;
|
|
15
|
-
handleWaitForSetup: (msg: any) => any;
|
|
16
|
-
onIdentify: (paired: boolean, callback: () => any) => void;
|
|
17
|
-
hostNode: HAPHostNodeType;
|
|
18
|
-
childNodes?: (HAPService2NodeType | HAPServiceNodeType)[];
|
|
19
|
-
service: Service;
|
|
20
|
-
parentService: Service;
|
|
21
|
-
parentNode?: HAPService2NodeType | HAPServiceNodeType;
|
|
22
|
-
accessory: Accessory;
|
|
23
|
-
characteristicProperties: {
|
|
24
|
-
[key: string]: CharacteristicProps;
|
|
25
|
-
};
|
|
26
|
-
supported: string[];
|
|
27
|
-
publishTimers: PublishTimersType;
|
|
28
|
-
topic_in: string;
|
|
29
|
-
onCharacteristicGet: (this: Characteristic, callback: CharacteristicGetCallback, context: any, connection?: HAPConnection) => void;
|
|
30
|
-
onCharacteristicSet: (this: Characteristic, newValue: CharacteristicValue, callback: CharacteristicSetCallback, context: any, connection?: HAPConnection) => void;
|
|
31
|
-
onCharacteristicChange: (this: Characteristic, change: CharacteristicChange) => void;
|
|
32
|
-
uniqueIdentifier: string;
|
|
33
|
-
reachable?: boolean;
|
|
34
|
-
nodeStatusUtils: NodeStatusUtils;
|
|
35
6
|
};
|
|
36
7
|
export default HAPService2NodeType;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AdaptiveLightingControllerMode } from 'hap-nodejs/dist/lib/controller/AdaptiveLightingController';
|
|
1
2
|
import { NodeDef } from 'node-red';
|
|
2
3
|
import CameraConfigType from './CameraConfigType';
|
|
3
4
|
type HAPServiceConfigType = NodeDef & {
|
|
@@ -18,5 +19,8 @@ type HAPServiceConfigType = NodeDef & {
|
|
|
18
19
|
softwareRev?: string;
|
|
19
20
|
characteristicProperties: string;
|
|
20
21
|
waitForSetupMsg: boolean;
|
|
22
|
+
adaptiveLightingOptionsEnable?: boolean;
|
|
23
|
+
adaptiveLightingOptionsMode?: AdaptiveLightingControllerMode;
|
|
24
|
+
adaptiveLightingOptionsCustomTemperatureAdjustment?: number;
|
|
21
25
|
} & CameraConfigType;
|
|
22
26
|
export default HAPServiceConfigType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accessory, Characteristic, CharacteristicChange, CharacteristicGetCallback, CharacteristicProps, CharacteristicSetCallback, CharacteristicValue, Service } from 'hap-nodejs';
|
|
1
|
+
import { Accessory, AdaptiveLightingController, Characteristic, CharacteristicChange, CharacteristicGetCallback, CharacteristicProps, CharacteristicSetCallback, CharacteristicValue, Service } from 'hap-nodejs';
|
|
2
2
|
import { HAPConnection } from 'hap-nodejs/dist/lib/util/eventedhttp';
|
|
3
3
|
import { NodeAPI } from 'node-red';
|
|
4
4
|
import { NodeStatusUtils } from '../utils/NodeStatusUtils';
|
|
@@ -32,5 +32,6 @@ type HAPServiceNodeType = NodeType & {
|
|
|
32
32
|
uniqueIdentifier: string;
|
|
33
33
|
reachable?: boolean;
|
|
34
34
|
nodeStatusUtils: NodeStatusUtils;
|
|
35
|
+
adaptiveLightingController?: AdaptiveLightingController;
|
|
35
36
|
};
|
|
36
37
|
export default HAPServiceNodeType;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var HapAdaptiveLightingControllerMode;
|
|
4
|
+
(function (HapAdaptiveLightingControllerMode) {
|
|
5
|
+
HapAdaptiveLightingControllerMode[HapAdaptiveLightingControllerMode["AUTOMATIC"] = 1] = "AUTOMATIC";
|
|
6
|
+
HapAdaptiveLightingControllerMode[HapAdaptiveLightingControllerMode["MANUAL"] = 2] = "MANUAL";
|
|
7
|
+
})(HapAdaptiveLightingControllerMode || (HapAdaptiveLightingControllerMode = {}));
|
|
8
|
+
exports.default = HapAdaptiveLightingControllerMode;
|