matterbridge-eve-motion 1.0.4 → 1.0.6
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/CHANGELOG.md +38 -0
- package/README.md +7 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/platform.d.ts +3 -4
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +5 -4
- package/dist/platform.js.map +1 -1
- package/link-matterbridge-script.js +1 -0
- package/package.json +31 -21
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
6
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<!-- Commented out section
|
|
10
|
+
## [1.1.2] - 2024-03-08
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- [Feature 1]: Description of the feature.
|
|
15
|
+
- [Feature 2]: Description of the feature.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- [Feature 3]: Description of the change.
|
|
20
|
+
- [Feature 4]: Description of the change.
|
|
21
|
+
|
|
22
|
+
### Deprecated
|
|
23
|
+
|
|
24
|
+
- [Feature 5]: Description of the deprecation.
|
|
25
|
+
|
|
26
|
+
### Removed
|
|
27
|
+
|
|
28
|
+
- [Feature 6]: Description of the removal.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- [Bug 1]: Description of the bug fix.
|
|
33
|
+
- [Bug 2]: Description of the bug fix.
|
|
34
|
+
|
|
35
|
+
### Security
|
|
36
|
+
|
|
37
|
+
- [Security 1]: Description of the security improvement.
|
|
38
|
+
-->
|
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge-eve-motion)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge-eve-motion)
|
|
5
|
+
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
6
|
+
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
7
|
+

|
|
5
8
|
|
|
6
9
|
[](https://www.npmjs.com/package/matterbridge)
|
|
7
10
|
[](https://www.npmjs.com/package/matter-history)
|
|
@@ -10,13 +13,14 @@
|
|
|
10
13
|
|
|
11
14
|
---
|
|
12
15
|
|
|
13
|
-
This plugin shows how to use the Matter history and how to create passive device in matter.js.
|
|
16
|
+
This plugin shows how to use the Matter history and how to create a passive device in matter.js.
|
|
14
17
|
|
|
15
|
-
It
|
|
18
|
+
It creates a virtual motion sensor with a light sensor device that continuously changes state.
|
|
19
|
+
|
|
20
|
+
If you like this project and find it useful, please consider giving it a star on GitHub at https://github.com/Luligu/matterbridge-eve-motion and sponsoring it.
|
|
16
21
|
|
|
17
22
|
## Prerequisites
|
|
18
23
|
|
|
19
24
|
### Matterbridge
|
|
20
25
|
|
|
21
26
|
See the guidelines on [Matterbridge](https://github.com/Luligu/matterbridge/blob/main/README.md) for more information.
|
|
22
|
-
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Matterbridge, PlatformConfig } from 'matterbridge';
|
|
2
|
-
import { AnsiLogger } from '
|
|
2
|
+
import { AnsiLogger } from 'matterbridge/logger';
|
|
3
3
|
import { EveMotionPlatform } from './platform.js';
|
|
4
4
|
/**
|
|
5
5
|
* This is the standard interface for MatterBridge plugins.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,qBAE3G"}
|
package/dist/platform.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AnsiLogger } from 'node-ansi-logger';
|
|
1
|
+
import { PlatformConfig, Matterbridge, MatterbridgeDevice, MatterbridgeAccessoryPlatform } from 'matterbridge';
|
|
2
|
+
import { MatterHistory } from 'matterbridge/history';
|
|
3
|
+
import { AnsiLogger } from 'matterbridge/logger';
|
|
5
4
|
export declare class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
|
|
6
5
|
motion: MatterbridgeDevice | undefined;
|
|
7
6
|
history: MatterHistory | undefined;
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,6BAA6B,EAAe,MAAM,cAAc,CAAC;AACnL,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,qBAAa,iBAAkB,SAAQ,6BAA6B;IAClE,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACvC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;gBAEzB,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc;IAKhE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM;IA4BvB,WAAW;IAqBX,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM;CAM1C"}
|
package/dist/platform.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { DeviceTypes, IlluminanceMeasurement, OccupancySensing } from 'matterbridge';
|
|
2
|
-
import {
|
|
1
|
+
import { DeviceTypes, IlluminanceMeasurement, OccupancySensing, MatterbridgeDevice, MatterbridgeAccessoryPlatform, powerSource } from 'matterbridge';
|
|
2
|
+
import { MatterHistory } from 'matterbridge/history';
|
|
3
3
|
export class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
|
|
4
4
|
motion;
|
|
5
5
|
history;
|
|
6
6
|
interval;
|
|
7
7
|
constructor(matterbridge, log, config) {
|
|
8
8
|
super(matterbridge, log, config);
|
|
9
|
+
this.log.info('Initializing platform:', this.config.name);
|
|
9
10
|
}
|
|
10
11
|
async onStart(reason) {
|
|
11
12
|
this.log.info('onStart called with reason:', reason ?? 'none');
|
|
@@ -16,10 +17,10 @@ export class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
|
|
|
16
17
|
this.motion.createDefaultOccupancySensingClusterServer();
|
|
17
18
|
this.motion.addDeviceType(DeviceTypes.LIGHT_SENSOR);
|
|
18
19
|
this.motion.createDefaultIlluminanceMeasurementClusterServer();
|
|
20
|
+
this.motion.addDeviceType(powerSource);
|
|
19
21
|
this.motion.createDefaultPowerSourceReplaceableBatteryClusterServer();
|
|
20
|
-
this.motion.createDefaultPowerSourceConfigurationClusterServer(1);
|
|
21
22
|
// Add the EveHistory cluster to the device as last cluster!
|
|
22
|
-
this.
|
|
23
|
+
this.history.createMotionEveHistoryClusterServer(this.motion, this.log);
|
|
23
24
|
this.history.autoPilot(this.motion);
|
|
24
25
|
await this.registerDevice(this.motion);
|
|
25
26
|
this.motion.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
|
package/dist/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,gBAAgB,EAAgC,kBAAkB,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACnL,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,MAAM,OAAO,iBAAkB,SAAQ,6BAA6B;IAClE,MAAM,CAAiC;IACvC,OAAO,CAA4B;IACnC,QAAQ,CAA6B;IAErC,YAAY,YAA0B,EAAE,GAAe,EAAE,MAAsB;QAC7E,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAEQ,KAAK,CAAC,OAAO,CAAC,MAAe;QACpC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC;QAE/D,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAEhH,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAkB,CAAC,WAAW,CAAC,gBAAgB,CAAC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AK,CAAC,UAAU,CAAC,MAAe;QACvC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gCAAgC,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC;QAClE,MAAM,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,oBAAoB,KAAK,IAAI;YAAE,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACnF,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-eve-motion",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Matterbridge eve motion with history",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
|
-
"types": "dist/index.d.
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/Luligu/matterbridge-eve-motion.git"
|
|
@@ -25,26 +25,28 @@
|
|
|
25
25
|
"history"
|
|
26
26
|
],
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": "
|
|
28
|
+
"node": ">=18.0.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "tsc",
|
|
32
32
|
"watch": "tsc --watch",
|
|
33
33
|
"start:bridge": "matterbridge -bridge",
|
|
34
34
|
"start:childbridge": "matterbridge -childbridge",
|
|
35
|
-
"test": "jest",
|
|
36
|
-
"test:verbose": "jest --verbose",
|
|
37
|
-
"test:watch": "jest --watch",
|
|
38
|
-
"
|
|
39
|
-
"lint
|
|
40
|
-
"
|
|
41
|
-
"format
|
|
35
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests",
|
|
36
|
+
"test:verbose": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests --verbose",
|
|
37
|
+
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests --watch",
|
|
38
|
+
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests --coverage",
|
|
39
|
+
"lint": "eslint --max-warnings=0 .",
|
|
40
|
+
"lint:fix": "eslint --fix --max-warnings=0 .",
|
|
41
|
+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
42
|
+
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
42
43
|
"clean": "rimraf tsconfig.tsbuildinfo ./dist",
|
|
43
44
|
"cleanBuild": "npm run clean && tsc",
|
|
44
|
-
"deepClean": "rimraf tsconfig.tsbuildinfo package-lock.json ./dist ./
|
|
45
|
+
"deepClean": "rimraf tsconfig.tsbuildinfo package-lock.json ./dist ./node_modulesI",
|
|
46
|
+
"deepCleanRebuild": "npm run deepClean && npm install && npm run build",
|
|
45
47
|
"prepublishOnly": "npm run lint && npm run cleanBuild",
|
|
46
48
|
"checkDependencies": "npx npm-check-updates",
|
|
47
|
-
"updateDependencies": "npx npm-check-updates -u",
|
|
49
|
+
"updateDependencies": "npx npm-check-updates -u && npm install & npm run cleanBuild",
|
|
48
50
|
"matterbridge:add": "matterbridge -add .\\",
|
|
49
51
|
"matterbridge:remove": "matterbridge -remove .\\",
|
|
50
52
|
"matterbridge:enable": "matterbridge -enable .\\",
|
|
@@ -55,18 +57,26 @@
|
|
|
55
57
|
"dev:uninstall": "npm uninstall matterbridge && npm unlink matterbridge",
|
|
56
58
|
"install": "node link-matterbridge-script.js"
|
|
57
59
|
},
|
|
60
|
+
"overrides": {
|
|
61
|
+
"eslint": "latest"
|
|
62
|
+
},
|
|
58
63
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@types/
|
|
62
|
-
"@
|
|
63
|
-
"@typescript-eslint/parser": "^7.8.0",
|
|
64
|
+
"@eslint/js": "^9.6.0",
|
|
65
|
+
"@types/eslint__js": "^8.42.3",
|
|
66
|
+
"@types/jest": "^29.5.12",
|
|
67
|
+
"@types/node": "^20.14.10",
|
|
64
68
|
"eslint-config-prettier": "^9.1.0",
|
|
69
|
+
"eslint-plugin-jest": "^28.6.0",
|
|
65
70
|
"eslint-plugin-prettier": "^5.1.3",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
71
|
+
"jest": "^29.7.0",
|
|
72
|
+
"prettier": "^3.3.2",
|
|
73
|
+
"rimraf": "^6.0.0",
|
|
74
|
+
"ts-jest": "^29.2.1",
|
|
75
|
+
"typescript": "^5.5.3",
|
|
76
|
+
"typescript-eslint": "^7.16.0"
|
|
68
77
|
},
|
|
69
78
|
"dependencies": {
|
|
70
|
-
"node-ansi-logger": "^1.9.5"
|
|
79
|
+
"node-ansi-logger": "^1.9.5",
|
|
80
|
+
"node-persist-manager": "^1.0.7"
|
|
71
81
|
}
|
|
72
|
-
}
|
|
82
|
+
}
|