homebridge-tapo 1.5.1 → 1.5.2
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 +1 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +6 -11
- package/dist/config.js.map +1 -1
- package/dist/custom-characteristics/currentConsumptionCharacteristic.d.ts +0 -1
- package/dist/custom-characteristics/currentConsumptionCharacteristic.js +15 -20
- package/dist/custom-characteristics/currentConsumptionCharacteristic.js.map +1 -1
- package/dist/custom-characteristics/default-characteristic.d.ts +0 -1
- package/dist/custom-characteristics/default-characteristic.js +1 -4
- package/dist/custom-characteristics/default-characteristic.js.map +1 -1
- package/dist/custom-characteristics/index.d.ts +0 -1
- package/dist/custom-characteristics/index.js +7 -13
- package/dist/custom-characteristics/index.js.map +1 -1
- package/dist/custom-characteristics/resetConsumptionCharacteristic.d.ts +0 -1
- package/dist/custom-characteristics/resetConsumptionCharacteristic.js +14 -19
- package/dist/custom-characteristics/resetConsumptionCharacteristic.js.map +1 -1
- package/dist/custom-characteristics/totalConsumptionCharacteristic.d.ts +0 -1
- package/dist/custom-characteristics/totalConsumptionCharacteristic.js +15 -20
- package/dist/custom-characteristics/totalConsumptionCharacteristic.js.map +1 -1
- package/dist/homekit-device/types.d.ts +0 -1
- package/dist/homekit-device/types.js +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +7 -8
- package/dist/index.js.map +1 -1
- package/dist/platform.d.ts +2 -3
- package/dist/platform.js +38 -35
- package/dist/platform.js.map +1 -1
- package/dist/platformL510EAccessory.d.ts +3 -4
- package/dist/platformL510EAccessory.js +9 -11
- package/dist/platformL510EAccessory.js.map +1 -1
- package/dist/platformL520EAccessory.d.ts +3 -4
- package/dist/platformL520EAccessory.js +9 -11
- package/dist/platformL520EAccessory.js.map +1 -1
- package/dist/platformL530Accessory.d.ts +3 -5
- package/dist/platformL530Accessory.js +31 -25
- package/dist/platformL530Accessory.js.map +1 -1
- package/dist/platformP100Accessory.d.ts +3 -4
- package/dist/platformP100Accessory.js +9 -11
- package/dist/platformP100Accessory.js.map +1 -1
- package/dist/platformP110Accessory.d.ts +3 -4
- package/dist/platformP110Accessory.js +20 -13
- package/dist/platformP110Accessory.js.map +1 -1
- package/dist/platformTPLinkAccessory.d.ts +3 -5
- package/dist/platformTPLinkAccessory.js +11 -7
- package/dist/platformTPLinkAccessory.js.map +1 -1
- package/dist/settings.d.ts +0 -1
- package/dist/settings.js +2 -5
- package/dist/settings.js.map +1 -1
- package/dist/utils/energyUsage.d.ts +0 -1
- package/dist/utils/energyUsage.js +2 -5
- package/dist/utils/energyUsage.js.map +1 -1
- package/dist/utils/l510e.d.ts +2 -3
- package/dist/utils/l510e.js +8 -8
- package/dist/utils/l510e.js.map +1 -1
- package/dist/utils/l520e.d.ts +2 -3
- package/dist/utils/l520e.js +8 -8
- package/dist/utils/l520e.js.map +1 -1
- package/dist/utils/l530.d.ts +4 -4
- package/dist/utils/l530.js +22 -12
- package/dist/utils/l530.js.map +1 -1
- package/dist/utils/newTpLinkCipher.d.ts +2 -4
- package/dist/utils/newTpLinkCipher.js +18 -11
- package/dist/utils/newTpLinkCipher.js.map +1 -1
- package/dist/utils/p100.d.ts +9 -8
- package/dist/utils/p100.js +161 -102
- package/dist/utils/p100.js.map +1 -1
- package/dist/utils/p110.d.ts +3 -4
- package/dist/utils/p110.js +10 -10
- package/dist/utils/p110.js.map +1 -1
- package/dist/utils/powerUsage.d.ts +1 -2
- package/dist/utils/powerUsage.js +4 -5
- package/dist/utils/powerUsage.js.map +1 -1
- package/dist/utils/tpLinkCipher.d.ts +3 -4
- package/dist/utils/tpLinkCipher.js +8 -7
- package/dist/utils/tpLinkCipher.js.map +1 -1
- package/dist/utils/tplinkAccessory.d.ts +4 -5
- package/dist/utils/tplinkAccessory.js +1 -2
- package/dist/utils/usage.d.ts +0 -1
- package/dist/utils/usage.js +4 -5
- package/dist/utils/usage.js.map +1 -1
- package/package.json +13 -8
- package/dist/config.d.ts.map +0 -1
- package/dist/custom-characteristics/currentConsumptionCharacteristic.d.ts.map +0 -1
- package/dist/custom-characteristics/default-characteristic.d.ts.map +0 -1
- package/dist/custom-characteristics/index.d.ts.map +0 -1
- package/dist/custom-characteristics/resetConsumptionCharacteristic.d.ts.map +0 -1
- package/dist/custom-characteristics/totalConsumptionCharacteristic.d.ts.map +0 -1
- package/dist/homekit-device/types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/platform.d.ts.map +0 -1
- package/dist/platformL510EAccessory.d.ts.map +0 -1
- package/dist/platformL520EAccessory.d.ts.map +0 -1
- package/dist/platformL530Accessory.d.ts.map +0 -1
- package/dist/platformP100Accessory.d.ts.map +0 -1
- package/dist/platformP110Accessory.d.ts.map +0 -1
- package/dist/platformTPLinkAccessory.d.ts.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/utils/energyUsage.d.ts.map +0 -1
- package/dist/utils/l510e.d.ts.map +0 -1
- package/dist/utils/l520e.d.ts.map +0 -1
- package/dist/utils/l530.d.ts.map +0 -1
- package/dist/utils/newTpLinkCipher.d.ts.map +0 -1
- package/dist/utils/p100.d.ts.map +0 -1
- package/dist/utils/p110.d.ts.map +0 -1
- package/dist/utils/powerUsage.d.ts.map +0 -1
- package/dist/utils/tpLinkCipher.d.ts.map +0 -1
- package/dist/utils/tplinkAccessory.d.ts.map +0 -1
- package/dist/utils/usage.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
<p align="center">
|
|
3
3
|
|
|
4
|
-
<img src="https://github.com/homebridge/branding/raw/
|
|
4
|
+
<img src="https://github.com/homebridge/branding/raw/latest/logos/homebridge-wordmark-logo-vertical.png" width="150">
|
|
5
5
|
|
|
6
6
|
</p>
|
|
7
7
|
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.parseConfig = exports.defaultConfig = void 0;
|
|
7
|
-
const lodash_defaults_1 = __importDefault(require("lodash.defaults"));
|
|
8
|
-
exports.defaultConfig = {
|
|
1
|
+
import defaults from 'lodash.defaults';
|
|
2
|
+
export const defaultConfig = {
|
|
9
3
|
name: 'Tapo Smart Platform',
|
|
10
4
|
username: '',
|
|
11
5
|
password: '',
|
|
@@ -14,8 +8,8 @@ exports.defaultConfig = {
|
|
|
14
8
|
timeout: 15,
|
|
15
9
|
waitTimeUpdate: 100,
|
|
16
10
|
};
|
|
17
|
-
function parseConfig(config) {
|
|
18
|
-
const c = (
|
|
11
|
+
export function parseConfig(config) {
|
|
12
|
+
const c = defaults(config, defaultConfig);
|
|
19
13
|
const defaultSendOptions = {
|
|
20
14
|
timeout: c.timeout * 1000,
|
|
21
15
|
};
|
|
@@ -30,9 +24,10 @@ function parseConfig(config) {
|
|
|
30
24
|
deviceOptions: {
|
|
31
25
|
defaultSendOptions,
|
|
32
26
|
},
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
28
|
+
//@ts-ignore
|
|
33
29
|
devices: c.devices,
|
|
34
30
|
},
|
|
35
31
|
};
|
|
36
32
|
}
|
|
37
|
-
exports.parseConfig = parseConfig;
|
|
38
33
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAkFvC,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,eAAe,EAAE,EAAE;IACnB,OAAO,EAAE,SAAS;IAElB,OAAO,EAAE,EAAE;IACX,cAAc,EAAE,GAAG;CACpB,CAAC;AAEF,MAAM,UAAU,WAAW,CACzB,MAA+B;IAG/B,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE1C,MAAM,kBAAkB,GAAG;QACzB,OAAO,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI;KAC1B,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,cAAc,EAAE,CAAC,CAAC,cAAc;QAEhC,kBAAkB;QAElB,gBAAgB,EAAE;YAChB,iBAAiB,EAAE,CAAC,CAAC,eAAe,GAAG,IAAI;YAC3C,aAAa,EAAE;gBACb,kBAAkB;aACnB;YACD,6DAA6D;YAC7D,YAAY;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor
|
|
1
|
+
export default function currentConsumption(DefaultCharacteristic) {
|
|
2
|
+
return class CurrentConsumptionCharacteristic extends DefaultCharacteristic {
|
|
3
|
+
static UUID = 'E863F10D-079E-48FF-8F27-9C2605A29F52';
|
|
4
|
+
constructor() {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-ignore: unable to override class constructor parameters as its a type and not a value
|
|
7
|
+
super('Current Consumption', CurrentConsumptionCharacteristic.UUID, {
|
|
7
8
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
|
-
// @ts-ignore:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
_a.UUID = 'E863F10D-079E-48FF-8F27-9C2605A29F52',
|
|
20
|
-
_a;
|
|
9
|
+
// @ts-ignore: custom unit
|
|
10
|
+
unit: 'Watt',
|
|
11
|
+
maxValue: 65535,
|
|
12
|
+
minValue: 0,
|
|
13
|
+
minStep: 1,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
21
17
|
}
|
|
22
|
-
exports.default = currentConsumption;
|
|
23
18
|
//# sourceMappingURL=currentConsumptionCharacteristic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currentConsumptionCharacteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/currentConsumptionCharacteristic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"currentConsumptionCharacteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/currentConsumptionCharacteristic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,qBAA4C;IAE5C,OAAO,MAAM,gCAAiC,SAAQ,qBAAqB;QACzE,MAAM,CAAU,IAAI,GAAG,sCAAsC,CAAC;QAE9D;YACE,6DAA6D;YAC7D,4FAA4F;YAC5F,KAAK,CAAC,qBAAqB,EAAE,gCAAgC,CAAC,IAAI,EAAE;gBAClE,6DAA6D;gBAC7D,0BAA0B;gBAC1B,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,KAAK;gBACf,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE,CAAC;aACX,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function defaultCharacteristic(Characteristic) {
|
|
1
|
+
export default function defaultCharacteristic(Characteristic) {
|
|
4
2
|
return class DefaultCharacteristic extends Characteristic {
|
|
5
3
|
constructor(displayName, UUID, props) {
|
|
6
4
|
const combinedProps = {
|
|
@@ -15,5 +13,4 @@ function defaultCharacteristic(Characteristic) {
|
|
|
15
13
|
}
|
|
16
14
|
};
|
|
17
15
|
}
|
|
18
|
-
exports.default = defaultCharacteristic;
|
|
19
16
|
//# sourceMappingURL=default-characteristic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-characteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/default-characteristic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-characteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/default-characteristic.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,cAA0C;IAE1C,OAAO,MAAM,qBAAsB,SAAQ,cAAc;QACvD,YACE,WAAmB,EACnB,IAAY,EACZ,KAA6D;YAE7D,MAAM,aAAa,GAAG;gBACpB,MAAM,6BAAe;gBACrB,QAAQ,EAAE,CAAC;gBACX,QAAQ,EAAE,KAAK;gBACf,KAAK,EAAE,uDAAiC;gBACxC,GAAG,KAAK;aACT,CAAC;YACF,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Characteristic as CharacteristicClass, WithUUID } from 'homebridge';
|
|
2
2
|
export default function characteristic(Characteristic: typeof CharacteristicClass): Record<'CurrentConsumptionCharacteristic' | 'TotalConsumptionCharacteristic', WithUUID<new () => CharacteristicClass>>;
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const default_characteristic_1 = __importDefault(require("./default-characteristic"));
|
|
7
|
-
const currentConsumptionCharacteristic_1 = __importDefault(require("./currentConsumptionCharacteristic"));
|
|
8
|
-
const totalConsumptionCharacteristic_1 = __importDefault(require("./totalConsumptionCharacteristic"));
|
|
9
|
-
function characteristic(Characteristic) {
|
|
10
|
-
const DefaultCharacteristic = (0, default_characteristic_1.default)(Characteristic);
|
|
1
|
+
import DefaultCharacteristicImport from './default-characteristic.js';
|
|
2
|
+
import CurrentConsumptionCharacteristicImport from './currentConsumptionCharacteristic.js';
|
|
3
|
+
import TotalConsumptionCharacteristicImport from './totalConsumptionCharacteristic.js';
|
|
4
|
+
export default function characteristic(Characteristic) {
|
|
5
|
+
const DefaultCharacteristic = DefaultCharacteristicImport(Characteristic);
|
|
11
6
|
return {
|
|
12
|
-
CurrentConsumptionCharacteristic: (
|
|
13
|
-
TotalConsumptionCharacteristic: (
|
|
7
|
+
CurrentConsumptionCharacteristic: CurrentConsumptionCharacteristicImport(DefaultCharacteristic),
|
|
8
|
+
TotalConsumptionCharacteristic: TotalConsumptionCharacteristicImport(DefaultCharacteristic),
|
|
14
9
|
};
|
|
15
10
|
}
|
|
16
|
-
exports.default = characteristic;
|
|
17
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/custom-characteristics/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/custom-characteristics/index.ts"],"names":[],"mappings":"AAKA,OAAO,2BAA2B,MAAM,6BAA6B,CAAC;AACtE,OAAO,sCAAsC,MAAM,uCAAuC,CAAC;AAC3F,OAAO,oCAAoC,MAAM,qCAAqC,CAAC;AAEvF,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,cAA0C;IAM1C,MAAM,qBAAqB,GAAG,2BAA2B,CAAC,cAAc,CAAC,CAAC;IAE1E,OAAO;QACL,gCAAgC,EAAE,sCAAsC,CAAC,qBAAqB,CAAC;QAC/F,8BAA8B,EAAE,oCAAoC,CAAC,qBAAqB,CAAC;KAC5F,CAAC;AACJ,CAAC"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor
|
|
1
|
+
export default function resetConsumption(DefaultCharacteristic) {
|
|
2
|
+
return class ResetConsumptionCharacteristic extends DefaultCharacteristic {
|
|
3
|
+
static UUID = 'E863F112-079E-48FF-8F27-9C2605A29F52';
|
|
4
|
+
constructor() {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-ignore: unable to override class constructor parameters as its a type and not a value
|
|
7
|
+
super('Reset Total', ResetConsumptionCharacteristic.UUID, {
|
|
7
8
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
|
-
// @ts-ignore:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
_a.UUID = 'E863F112-079E-48FF-8F27-9C2605A29F52',
|
|
19
|
-
_a;
|
|
9
|
+
// @ts-ignore: custom unit
|
|
10
|
+
format: "uint32" /* Formats.UINT32 */,
|
|
11
|
+
unit: "seconds" /* Units.SECONDS */,
|
|
12
|
+
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */, "pw" /* Perms.PAIRED_WRITE */],
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
20
16
|
}
|
|
21
|
-
exports.default = resetConsumption;
|
|
22
17
|
//# sourceMappingURL=resetConsumptionCharacteristic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resetConsumptionCharacteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/resetConsumptionCharacteristic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resetConsumptionCharacteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/resetConsumptionCharacteristic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,qBAA4C;IAE5C,OAAO,MAAM,8BAA+B,SAAQ,qBAAqB;QACvE,MAAM,CAAU,IAAI,GAAG,sCAAsC,CAAC;QAE9D;YACE,6DAA6D;YAC7D,4FAA4F;YAC5F,KAAK,CAAC,aAAa,EAAE,8BAA8B,CAAC,IAAI,EAAE;gBACxD,6DAA6D;gBAC7D,0BAA0B;gBAC1B,MAAM,+BAAgB;gBACtB,IAAI,+BAAe;gBACnB,KAAK,EAAE,sFAAqD;aAC7D,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor
|
|
1
|
+
export default function totalConsumption(DefaultCharacteristic) {
|
|
2
|
+
return class TotalConsumptionCharacteristic extends DefaultCharacteristic {
|
|
3
|
+
static UUID = 'E863F10C-079E-48FF-8F27-9C2605A29F52';
|
|
4
|
+
constructor() {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-ignore: unable to override class constructor parameters as its a type and not a value
|
|
7
|
+
super('Total Consumption', TotalConsumptionCharacteristic.UUID, {
|
|
8
|
+
maxValue: 4294967295,
|
|
9
|
+
minValue: 0,
|
|
7
10
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
|
-
// @ts-ignore:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
unit: 'kWh',
|
|
15
|
-
minStep: 0.001,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
_a.UUID = 'E863F10C-079E-48FF-8F27-9C2605A29F52',
|
|
20
|
-
_a;
|
|
11
|
+
// @ts-ignore: custom unit
|
|
12
|
+
unit: 'kWh',
|
|
13
|
+
minStep: 0.001,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
21
17
|
}
|
|
22
|
-
exports.default = totalConsumption;
|
|
23
18
|
//# sourceMappingURL=totalConsumptionCharacteristic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"totalConsumptionCharacteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/totalConsumptionCharacteristic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"totalConsumptionCharacteristic.js","sourceRoot":"","sources":["../../src/custom-characteristics/totalConsumptionCharacteristic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,qBAA4C;IAE5C,OAAO,MAAM,8BAA+B,SAAQ,qBAAqB;QACvE,MAAM,CAAU,IAAI,GAAG,sCAAsC,CAAC;QAE9D;YACE,6DAA6D;YAC7D,4FAA4F;YAC5F,KAAK,CAAC,mBAAmB,EAAE,8BAA8B,CAAC,IAAI,EAAE;gBAC9D,QAAQ,EAAE,UAAU;gBACpB,QAAQ,EAAE,CAAC;gBACX,6DAA6D;gBAC7D,0BAA0B;gBAC1B,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,KAAK;aACf,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
api.registerPlatform(settings_1.PLATFORM_NAME, platform_1.default);
|
|
1
|
+
import { TapoPlatform } from './platform.js';
|
|
2
|
+
import { PLATFORM_NAME } from './settings.js';
|
|
3
|
+
/**
|
|
4
|
+
* This method registers the platform with Homebridge
|
|
5
|
+
*/
|
|
6
|
+
export default (api) => {
|
|
7
|
+
api.registerPlatform(PLATFORM_NAME, TapoPlatform);
|
|
9
8
|
};
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;GAEG;AACH,eAAe,CAAC,GAAQ,EAAE,EAAE;IAC1B,GAAG,CAAC,gBAAgB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC,CAAC"}
|
package/dist/platform.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic, WithUUID } from 'homebridge';
|
|
2
|
-
import { TapoConfig } from './config';
|
|
2
|
+
import { TapoConfig } from './config.js';
|
|
3
3
|
/**
|
|
4
4
|
* TapoPlatform
|
|
5
5
|
* This class is the main constructor for your plugin, this is where you should
|
|
6
6
|
* parse the user config and discover/register accessories with Homebridge.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare class TapoPlatform implements DynamicPlatformPlugin {
|
|
9
9
|
readonly log: Logger;
|
|
10
10
|
readonly api: API;
|
|
11
11
|
readonly Service: typeof Service;
|
|
@@ -29,4 +29,3 @@ export default class TapoPlatform implements DynamicPlatformPlugin {
|
|
|
29
29
|
*/
|
|
30
30
|
discoverDevices(): void;
|
|
31
31
|
}
|
|
32
|
-
//# sourceMappingURL=platform.d.ts.map
|
package/dist/platform.js
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const platformP110Accessory_1 = require("./platformP110Accessory");
|
|
13
|
-
const custom_characteristics_1 = __importDefault(require("./custom-characteristics"));
|
|
14
|
-
const platformL520EAccessory_1 = require("./platformL520EAccessory");
|
|
1
|
+
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js';
|
|
2
|
+
import { P100Accessory } from './platformP100Accessory.js';
|
|
3
|
+
import { parseConfig } from './config.js';
|
|
4
|
+
import { L510EAccessory } from './platformL510EAccessory.js';
|
|
5
|
+
import { L530Accessory } from './platformL530Accessory.js';
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7
|
+
//@ts-ignore
|
|
8
|
+
import fakegato from 'fakegato-history';
|
|
9
|
+
import { P110Accessory } from './platformP110Accessory.js';
|
|
10
|
+
import Characteristics from './custom-characteristics/index.js';
|
|
11
|
+
import { L520EAccessory } from './platformL520EAccessory.js';
|
|
15
12
|
/**
|
|
16
13
|
* TapoPlatform
|
|
17
14
|
* This class is the main constructor for your plugin, this is where you should
|
|
18
15
|
* parse the user config and discover/register accessories with Homebridge.
|
|
19
16
|
*/
|
|
20
|
-
class TapoPlatform {
|
|
17
|
+
export class TapoPlatform {
|
|
18
|
+
log;
|
|
19
|
+
api;
|
|
20
|
+
Service;
|
|
21
|
+
Characteristic;
|
|
22
|
+
FakeGatoHistoryService;
|
|
23
|
+
// this is used to track restored cached accessories
|
|
24
|
+
accessories = [];
|
|
25
|
+
config;
|
|
26
|
+
customCharacteristics;
|
|
21
27
|
constructor(log, config, api) {
|
|
22
28
|
this.log = log;
|
|
23
29
|
this.api = api;
|
|
24
|
-
this.Service =
|
|
25
|
-
this.Characteristic =
|
|
26
|
-
// this is used to track restored cached accessories
|
|
27
|
-
this.accessories = [];
|
|
30
|
+
this.Service = api.hap.Service;
|
|
31
|
+
this.Characteristic = api.hap.Characteristic;
|
|
28
32
|
this.log.debug('config.json: %j', config);
|
|
29
|
-
this.config =
|
|
33
|
+
this.config = parseConfig(config);
|
|
30
34
|
this.log.debug('config: %j', this.config);
|
|
31
35
|
this.log.debug('Finished initializing platform:', this.config.name);
|
|
32
|
-
this.customCharacteristics = (
|
|
33
|
-
this.FakeGatoHistoryService = (
|
|
36
|
+
this.customCharacteristics = Characteristics(api.hap.Characteristic);
|
|
37
|
+
this.FakeGatoHistoryService = fakegato(this.api);
|
|
34
38
|
// When this event is fired it means Homebridge has restored all cached accessories from disk.
|
|
35
39
|
// Dynamic Platform plugins should only register new accessories after this event was fired,
|
|
36
40
|
// in order to ensure they weren't added to homebridge already. This event can also be used
|
|
@@ -80,19 +84,19 @@ class TapoPlatform {
|
|
|
80
84
|
// create the accessory handler for the restored accessory
|
|
81
85
|
// this is imported from `platformAccessory.ts`
|
|
82
86
|
if (device.type && device.type.toLowerCase() === 'colorlight') {
|
|
83
|
-
new
|
|
87
|
+
new L530Accessory(this.log, this, existingAccessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
84
88
|
}
|
|
85
89
|
else if (device.type && device.type.toLowerCase() === 'whiteLight') {
|
|
86
|
-
new
|
|
90
|
+
new L520EAccessory(this.log, this, existingAccessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
87
91
|
}
|
|
88
92
|
else if (device.type && device.type.toLowerCase() === 'light') {
|
|
89
|
-
new
|
|
93
|
+
new L510EAccessory(this.log, this, existingAccessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
90
94
|
}
|
|
91
95
|
else if (device.type && device.type.toLowerCase() === 'powerplug') {
|
|
92
|
-
new
|
|
96
|
+
new P110Accessory(this.log, this, existingAccessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
93
97
|
}
|
|
94
98
|
else {
|
|
95
|
-
new
|
|
99
|
+
new P100Accessory(this.log, this, existingAccessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
96
100
|
}
|
|
97
101
|
// update accessory cache with any changes to the accessory details and information
|
|
98
102
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -100,7 +104,7 @@ class TapoPlatform {
|
|
|
100
104
|
else if (!device) {
|
|
101
105
|
// it is possible to remove platform accessories at any time using `api.unregisterPlatformAccessories`, eg.:
|
|
102
106
|
// remove platform accessories when no longer present
|
|
103
|
-
this.api.unregisterPlatformAccessories(
|
|
107
|
+
this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [existingAccessory]);
|
|
104
108
|
this.log.info('Removing existing accessory from cache:', existingAccessory.displayName);
|
|
105
109
|
}
|
|
106
110
|
}
|
|
@@ -116,7 +120,7 @@ class TapoPlatform {
|
|
|
116
120
|
// store a copy of the device object in the `accessory.context`
|
|
117
121
|
// the `context` property can be used to store any data about the accessory you may need
|
|
118
122
|
accessory.context.device = device;
|
|
119
|
-
new
|
|
123
|
+
new L530Accessory(this.log, this, accessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
120
124
|
}
|
|
121
125
|
else if (device.type && device.type.toLowerCase() === 'light') {
|
|
122
126
|
// create a new accessory
|
|
@@ -124,7 +128,7 @@ class TapoPlatform {
|
|
|
124
128
|
// store a copy of the device object in the `accessory.context`
|
|
125
129
|
// the `context` property can be used to store any data about the accessory you may need
|
|
126
130
|
accessory.context.device = device;
|
|
127
|
-
new
|
|
131
|
+
new L510EAccessory(this.log, this, accessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
128
132
|
}
|
|
129
133
|
else if (device.type && device.type.toLowerCase() === 'whiteLight') {
|
|
130
134
|
// create a new accessory
|
|
@@ -132,7 +136,7 @@ class TapoPlatform {
|
|
|
132
136
|
// store a copy of the device object in the `accessory.context`
|
|
133
137
|
// the `context` property can be used to store any data about the accessory you may need
|
|
134
138
|
accessory.context.device = device;
|
|
135
|
-
new
|
|
139
|
+
new L520EAccessory(this.log, this, accessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
136
140
|
}
|
|
137
141
|
else if (device.type && device.type.toLowerCase() === 'powerplug') {
|
|
138
142
|
// create a new accessory
|
|
@@ -140,7 +144,7 @@ class TapoPlatform {
|
|
|
140
144
|
// store a copy of the device object in the `accessory.context`
|
|
141
145
|
// the `context` property can be used to store any data about the accessory you may need
|
|
142
146
|
accessory.context.device = device;
|
|
143
|
-
new
|
|
147
|
+
new P110Accessory(this.log, this, accessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
144
148
|
}
|
|
145
149
|
else {
|
|
146
150
|
// create a new accessory
|
|
@@ -148,14 +152,13 @@ class TapoPlatform {
|
|
|
148
152
|
// store a copy of the device object in the `accessory.context`
|
|
149
153
|
// the `context` property can be used to store any data about the accessory you may need
|
|
150
154
|
accessory.context.device = device;
|
|
151
|
-
new
|
|
155
|
+
new P100Accessory(this.log, this, accessory, device.timeout ? device.timeout : 2, device.updateInterval);
|
|
152
156
|
}
|
|
153
157
|
// link the accessory to your platform
|
|
154
|
-
this.api.registerPlatformAccessories(
|
|
158
|
+
this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
|
-
exports.default = TapoPlatform;
|
|
161
164
|
//# sourceMappingURL=platform.js.map
|
package/dist/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAc,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,6DAA6D;AAC7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,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;gBAChF,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAccessory, CharacteristicValue, CharacteristicSetCallback, CharacteristicGetCallback, Logger } from 'homebridge';
|
|
2
|
-
import TapoPlatform from './platform';
|
|
3
|
-
import L510E from './utils/l510e';
|
|
4
|
-
import { TPLinkPlatformAccessory } from './platformTPLinkAccessory';
|
|
2
|
+
import type { TapoPlatform } from './platform.js';
|
|
3
|
+
import L510E from './utils/l510e.js';
|
|
4
|
+
import { TPLinkPlatformAccessory } from './platformTPLinkAccessory.js';
|
|
5
5
|
/**
|
|
6
6
|
* L510E Accessory
|
|
7
7
|
* An instance of this class is created for each accessory your platform registers
|
|
@@ -28,4 +28,3 @@ export declare class L510EAccessory extends TPLinkPlatformAccessory<L510E> {
|
|
|
28
28
|
getBrightness(callback: CharacteristicGetCallback): void;
|
|
29
29
|
protected updateState(interval: number): void;
|
|
30
30
|
}
|
|
31
|
-
//# sourceMappingURL=platformL510EAccessory.d.ts.map
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.L510EAccessory = void 0;
|
|
7
|
-
const l510e_1 = __importDefault(require("./utils/l510e"));
|
|
8
|
-
const platformTPLinkAccessory_1 = require("./platformTPLinkAccessory");
|
|
1
|
+
import L510E from './utils/l510e.js';
|
|
2
|
+
import { TPLinkPlatformAccessory } from './platformTPLinkAccessory.js';
|
|
9
3
|
/**
|
|
10
4
|
* L510E Accessory
|
|
11
5
|
* An instance of this class is created for each accessory your platform registers
|
|
12
6
|
* Each accessory may expose multiple services of different service types.
|
|
13
7
|
*/
|
|
14
|
-
class L510EAccessory extends
|
|
8
|
+
export class L510EAccessory extends TPLinkPlatformAccessory {
|
|
9
|
+
log;
|
|
10
|
+
platform;
|
|
11
|
+
accessory;
|
|
12
|
+
timeout;
|
|
13
|
+
updateInterval;
|
|
15
14
|
constructor(log, platform, accessory, timeout, updateInterval) {
|
|
16
15
|
super(log, platform, accessory, timeout, updateInterval);
|
|
17
16
|
this.log = log;
|
|
@@ -19,7 +18,7 @@ class L510EAccessory extends platformTPLinkAccessory_1.TPLinkPlatformAccessory {
|
|
|
19
18
|
this.accessory = accessory;
|
|
20
19
|
this.timeout = timeout;
|
|
21
20
|
this.updateInterval = updateInterval;
|
|
22
|
-
this.tpLinkAccessory = new
|
|
21
|
+
this.tpLinkAccessory = new L510E(this.log, accessory.context.device.host, platform.config.username, platform.config.password, this.timeout);
|
|
23
22
|
this.initialise(platform, updateInterval);
|
|
24
23
|
// get the Outlet service if it exists, otherwise create a new Outlet service
|
|
25
24
|
this.service = this.accessory.getService(this.platform.Service.Lightbulb) || this.accessory.addService(this.platform.Service.Lightbulb);
|
|
@@ -134,5 +133,4 @@ class L510EAccessory extends platformTPLinkAccessory_1.TPLinkPlatformAccessory {
|
|
|
134
133
|
}, interval);
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
|
-
exports.L510EAccessory = L510EAccessory;
|
|
138
136
|
//# sourceMappingURL=platformL510EAccessory.js.map
|