homebridge-openrgb-multi 7.0.0 → 7.0.1
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/dist/platformFactory.js +3 -3
- package/dist/platformFactory.js.map +1 -1
- package/dist/services/PersistenceService.d.ts +4 -1
- package/dist/services/PersistenceService.js +3 -2
- package/dist/services/PersistenceService.js.map +1 -1
- package/dist/types/configuration/PlatformConfiguration.d.ts +2 -0
- package/package.json +2 -2
- package/src/platformFactory.ts +1 -1
- package/src/services/PersistenceService.ts +6 -2
- package/src/types/configuration/PlatformConfiguration.ts +2 -0
- package/tsconfig.json +2 -2
package/dist/platformFactory.js
CHANGED
|
@@ -22,7 +22,7 @@ const constants_1 = require("./constants");
|
|
|
22
22
|
const createPlatform = (homebridge) => {
|
|
23
23
|
class Platform {
|
|
24
24
|
constructor(homebridgeLog, configuration) {
|
|
25
|
-
var _a, _b;
|
|
25
|
+
var _a, _b, _c;
|
|
26
26
|
this.configuration = configuration;
|
|
27
27
|
this.zones = new Map();
|
|
28
28
|
const log = (0, winston_1.createLogger)({
|
|
@@ -30,11 +30,11 @@ const createPlatform = (homebridge) => {
|
|
|
30
30
|
new helpers_for_homebridge_1.HomebridgeLogTransport(homebridgeLog),
|
|
31
31
|
],
|
|
32
32
|
});
|
|
33
|
-
const persistence = new services_1.PersistenceService({
|
|
33
|
+
const persistence = new services_1.PersistenceService((_a = configuration.persistence) !== null && _a !== void 0 ? _a : {}, {
|
|
34
34
|
homebridge,
|
|
35
35
|
log,
|
|
36
36
|
});
|
|
37
|
-
const openRgbClient = new openrgb_sdk_1.Client('default', (
|
|
37
|
+
const openRgbClient = new openrgb_sdk_1.Client('default', (_b = configuration.openRgbPort) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_OPENRGB_PORT, (_c = configuration.openRgbHost) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OPENRGB_HOST);
|
|
38
38
|
const palette = new palette_kit_core_1.Palette({}, { log });
|
|
39
39
|
const paletteClient = configuration.paletteClient
|
|
40
40
|
? new palette_kit_client_1.PaletteClient(configuration.paletteClient, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformFactory.js","sourceRoot":"","sources":["../src/platformFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAsD;AAEtD,qCAAuC;AACvC,mEAAgE;AAChE,kEAAsD;AACtD,sEAA8D;AAG9D,yCAAgD;AAChD,+CAIuB;AACvB,iCAA8B;AAC9B,2CAAyE;AAElE,MAAM,cAAc,GAAG,CAAC,UAAe,EAAE,EAAE;IAChD,MAAM,QAAQ;QAIZ,YACE,aAAsB,EACb,aAAoC;;YAApC,kBAAa,GAAb,aAAa,CAAuB;YAJ/C,UAAK,GAAG,IAAI,GAAG,EAA8B,CAAC;YAM5C,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC;gBACvB,UAAU,EAAE;oBACV,IAAI,+CAAsB,CAAC,aAAa,CAAC;iBAC1C;aACF,CAAC,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,6BAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"platformFactory.js","sourceRoot":"","sources":["../src/platformFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAsD;AAEtD,qCAAuC;AACvC,mEAAgE;AAChE,kEAAsD;AACtD,sEAA8D;AAG9D,yCAAgD;AAChD,+CAIuB;AACvB,iCAA8B;AAC9B,2CAAyE;AAElE,MAAM,cAAc,GAAG,CAAC,UAAe,EAAE,EAAE;IAChD,MAAM,QAAQ;QAIZ,YACE,aAAsB,EACb,aAAoC;;YAApC,kBAAa,GAAb,aAAa,CAAuB;YAJ/C,UAAK,GAAG,IAAI,GAAG,EAA8B,CAAC;YAM5C,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC;gBACvB,UAAU,EAAE;oBACV,IAAI,+CAAsB,CAAC,aAAa,CAAC;iBAC1C;aACF,CAAC,CAAC;YACH,MAAM,WAAW,GAAG,IA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,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjC,CAAC,CAAA,CAAC,CACH,CAAC;gBAEF,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAC7D,CAAC,IAAI,EAAE,EAAE;oBACP,MAAM,mBAAmB,GAAG,IAAI,iCAAmB,CACjD,IAAI,EACJ,IAAI,CAAC,OAAO,CACb,CAAC;oBACF,MAAM,uBAAuB,GAAG,IAAI,qCAAuB,CACzD,IAAI,EACJ,IAAI,CAAC,OAAO,CACb,CAAC;oBACF,MAAM,4BAA4B,GAAG,IAAI,0CAA4B,CACnE,IAAI,EACJ,IAAI,CAAC,OAAO,CACb,CAAC;oBAEF,IAAI,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,UAAU,EAAE,EAAE;wBACzC,uBAAuB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;oBACvD,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,EAAE,CAAC,6BAA6B,EAAE,CAAC,qBAAqB,EAAE,EAAE;wBAC/D,4BAA4B,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;oBAC7D,CAAC,CAAC,CAAC;oBAEH,OAAO;wBACL,mBAAmB;wBACnB,uBAAuB;wBACvB,4BAA4B;qBAC7B,CAAC;gBACJ,CAAC,CACF,CAAC;gBAEF,MAAM,WAAW,GAAG,CAAC,GAAG,eAAe,CAAC,CAAC;gBAEzC,QAAQ,CAAC,WAAW,CAAC,CAAC;YACxB,CAAC;SAAA;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAnGW,QAAA,cAAc,kBAmGzB"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { BasicPersistenceService, Context } from 'helpers-for-homebridge';
|
|
2
2
|
import { PlatformPersistence, ZonePersistence } from '../types';
|
|
3
|
+
export interface PersistenceServiceConfiguration {
|
|
4
|
+
fileName?: string;
|
|
5
|
+
}
|
|
3
6
|
export declare class PersistenceService extends BasicPersistenceService<PlatformPersistence> {
|
|
4
|
-
constructor(context: Context);
|
|
7
|
+
constructor(configuration: PersistenceServiceConfiguration, context: Context);
|
|
5
8
|
getZonePersistence(zoneId: string): Promise<ZonePersistence | null>;
|
|
6
9
|
getZoneActive(zoneId: string): Promise<boolean>;
|
|
7
10
|
getZoneBrightness(zoneId: string): Promise<number>;
|
|
@@ -13,9 +13,10 @@ exports.PersistenceService = void 0;
|
|
|
13
13
|
const helpers_for_homebridge_1 = require("helpers-for-homebridge");
|
|
14
14
|
const constants_1 = require("../constants");
|
|
15
15
|
class PersistenceService extends helpers_for_homebridge_1.BasicPersistenceService {
|
|
16
|
-
constructor(context) {
|
|
16
|
+
constructor(configuration, context) {
|
|
17
|
+
var _a;
|
|
17
18
|
super({
|
|
18
|
-
fileName: constants_1.DEFAULT_PERSISTENCE_FILENAME,
|
|
19
|
+
fileName: (_a = configuration.fileName) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_PERSISTENCE_FILENAME,
|
|
19
20
|
defaultValue: {
|
|
20
21
|
zones: {},
|
|
21
22
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersistenceService.js","sourceRoot":"","sources":["../../src/services/PersistenceService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAIgC;AAEhC,4CAA4D;
|
|
1
|
+
{"version":3,"file":"PersistenceService.js","sourceRoot":"","sources":["../../src/services/PersistenceService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAIgC;AAEhC,4CAA4D;AAM5D,MAAa,kBAAmB,SAAQ,gDAA4C;IAClF,YAAY,aAA8C,EAAE,OAAgB;;QAC1E,KAAK,CACH;YACE,QAAQ,EAAE,MAAA,aAAa,CAAC,QAAQ,mCAAI,wCAA4B;YAChE,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;aACV;SACF,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAEK,kBA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;KAAA;IAEK,eAAe,CAAC,MAAc,EAAE,QAAgB;;YACpD,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE;gBACtC,QAAQ;aACT,CAAC,CAAC;QACL,CAAC;KAAA;CACF;AAjED,gDAiEC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientConfiguration } from '@manganese/palette-kit-client';
|
|
2
|
+
import { PersistenceServiceConfiguration } from '../../services';
|
|
2
3
|
import { ZoneConfiguration } from '.';
|
|
3
4
|
export interface PlatformConfiguration {
|
|
4
5
|
discoveryInterval?: number;
|
|
@@ -7,4 +8,5 @@ export interface PlatformConfiguration {
|
|
|
7
8
|
openRgbPort: number;
|
|
8
9
|
paletteClient?: ClientConfiguration;
|
|
9
10
|
zones: ZoneConfiguration[];
|
|
11
|
+
persistence?: PersistenceServiceConfiguration;
|
|
10
12
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "homebridge-openrgb-multi",
|
|
3
3
|
"displayName": "Homebridge OpenRGB Multi",
|
|
4
4
|
"description": "Homebridge plugin for multi-color dynamic effects for OpenRGB",
|
|
5
|
-
"version": "7.0.
|
|
5
|
+
"version": "7.0.1",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"homebridge-plugin"
|
|
8
8
|
],
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"main": "dist/index.js",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@manganese/core-kit-node": "^4.0.0",
|
|
34
|
-
"@manganese/effect-kit": "^3.
|
|
34
|
+
"@manganese/effect-kit": "^3.3.2",
|
|
35
35
|
"@manganese/palette-kit-client": "^5.0.0",
|
|
36
36
|
"@manganese/palette-kit-core": "^5.0.0",
|
|
37
37
|
"helpers-for-homebridge": "^6.0.0",
|
package/src/platformFactory.ts
CHANGED
|
@@ -29,7 +29,7 @@ export const createPlatform = (homebridge: API) => {
|
|
|
29
29
|
new HomebridgeLogTransport(homebridgeLog),
|
|
30
30
|
],
|
|
31
31
|
});
|
|
32
|
-
const persistence = new PersistenceService({
|
|
32
|
+
const persistence = new PersistenceService(configuration.persistence ?? {}, {
|
|
33
33
|
homebridge,
|
|
34
34
|
log,
|
|
35
35
|
});
|
|
@@ -6,11 +6,15 @@ import {
|
|
|
6
6
|
import { PlatformPersistence, ZonePersistence } from '../types';
|
|
7
7
|
import { DEFAULT_PERSISTENCE_FILENAME } from '../constants';
|
|
8
8
|
|
|
9
|
+
export interface PersistenceServiceConfiguration {
|
|
10
|
+
fileName?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
export class PersistenceService extends BasicPersistenceService<PlatformPersistence> {
|
|
10
|
-
constructor(context: Context) {
|
|
14
|
+
constructor(configuration: PersistenceServiceConfiguration, context: Context) {
|
|
11
15
|
super(
|
|
12
16
|
{
|
|
13
|
-
fileName: DEFAULT_PERSISTENCE_FILENAME,
|
|
17
|
+
fileName: configuration.fileName ?? DEFAULT_PERSISTENCE_FILENAME,
|
|
14
18
|
defaultValue: {
|
|
15
19
|
zones: {},
|
|
16
20
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientConfiguration } from '@manganese/palette-kit-client';
|
|
2
|
+
import { PersistenceServiceConfiguration } from '../../services';
|
|
2
3
|
import { ZoneConfiguration } from '.';
|
|
3
4
|
|
|
4
5
|
export interface PlatformConfiguration {
|
|
@@ -8,4 +9,5 @@ export interface PlatformConfiguration {
|
|
|
8
9
|
openRgbPort: number;
|
|
9
10
|
paletteClient?: ClientConfiguration;
|
|
10
11
|
zones: ZoneConfiguration[];
|
|
12
|
+
persistence?: PersistenceServiceConfiguration;
|
|
11
13
|
}
|
package/tsconfig.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"rootDir": "./src",
|
|
4
4
|
"outDir": "./dist",
|
|
5
|
-
"module": "
|
|
5
|
+
"module": "NodeNext",
|
|
6
6
|
"lib": ["ES6", "ES2020", "ESNext"],
|
|
7
7
|
"target": "ES2015",
|
|
8
8
|
"noImplicitAny": false,
|
|
9
|
-
"moduleResolution": "
|
|
9
|
+
"moduleResolution": "NodeNext",
|
|
10
10
|
"sourceMap": true,
|
|
11
11
|
"allowSyntheticDefaultImports": true,
|
|
12
12
|
"allowJs": true,
|