matterbridge-example-camera 0.0.1 → 0.0.2-dev-20260713-96dfc44
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 +14 -0
- package/README.md +14 -0
- package/dist/behaviors/chimeServer.js +4 -0
- package/dist/devices/chime.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -27,6 +27,20 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
27
27
|
|
|
28
28
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
29
29
|
|
|
30
|
+
## [0.0.2] - Dev branch
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- [chime]: Added validation in `MatterbridgeChimeServer.playChimeSound` to reject a `chimeId` that is not present in `installedChimeSounds` with a `NotFound` status response.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- [chime]: Documented the Chime device features in the README.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- [chime]: Fixed `Chime` to omit the `powerSource` device type when `powerSourceType` is `'None'`.
|
|
43
|
+
|
|
30
44
|
## [0.0.1] - 2026-07-13
|
|
31
45
|
|
|
32
46
|
- First published release.
|
package/README.md
CHANGED
|
@@ -28,3 +28,17 @@ This repository is used to create all Camera Device Types in chapter 16 of Matte
|
|
|
28
28
|
- `src/module.ts` will create all device types for easy testing;
|
|
29
29
|
- `src/devices/` contains all single class device types (it will be moved directly in matterbridge core package).
|
|
30
30
|
- `src/behaviors/` contains all required behaviors (it will be moved directly in matterbridge core package).
|
|
31
|
+
|
|
32
|
+
## Supported device types
|
|
33
|
+
|
|
34
|
+
### Chime
|
|
35
|
+
|
|
36
|
+
Features:
|
|
37
|
+
|
|
38
|
+
- Exposes the Chime cluster with a configurable list of installed chime sounds, playable via the PlayChimeSound command.
|
|
39
|
+
- Supports selecting a chime sound with the SelectedChime attribute or by passing a chimeId to the PlayChimeSound command.
|
|
40
|
+
- Validates the requested chimeId against the InstalledChimeSounds list and rejects unknown ids with a NotFound response.
|
|
41
|
+
- Emits the ChimeStartedPlaying event when a chime sound starts playing.
|
|
42
|
+
- Chime sounds can be enabled or disabled with the Enabled attribute.
|
|
43
|
+
- Optional Identify cluster support, with configurable identify time and type.
|
|
44
|
+
- Configurable Power Source cluster type: Rechargeable, Replaceable, Battery, Wired, or None to omit the Power Source cluster entirely.
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { MatterbridgeServer } from 'matterbridge/behaviors';
|
|
2
2
|
import { ChimeServer } from 'matterbridge/matter/behaviors';
|
|
3
|
+
import { Status, StatusResponseError } from 'matterbridge/matter/types';
|
|
3
4
|
export class MatterbridgeChimeServer extends ChimeServer {
|
|
4
5
|
async playChimeSound(request) {
|
|
5
6
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
6
7
|
const chimeId = request.chimeId ?? this.state.selectedChime;
|
|
8
|
+
if (!this.state.installedChimeSounds.some((chimeSound) => chimeSound.chimeId === chimeId)) {
|
|
9
|
+
throw new StatusResponseError(`Chime sound ${chimeId} is not present in installedChimeSounds`, Status.NotFound);
|
|
10
|
+
}
|
|
7
11
|
device.log.info(`Playing chime sound ${chimeId} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
8
12
|
device.log.debug(`MatterbridgeChimeServer: playChimeSound called with chimeId ${chimeId}`);
|
|
9
13
|
this.events.chimeStartedPlaying?.emit({ chimeId }, this.context);
|
package/dist/devices/chime.js
CHANGED
|
@@ -9,7 +9,7 @@ export class Chime extends MatterbridgeEndpoint {
|
|
|
9
9
|
name: 'Default Chime',
|
|
10
10
|
},
|
|
11
11
|
], selectedChime = 0, enabled = true, } = options;
|
|
12
|
-
super([chime, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
|
|
12
|
+
super(powerSourceType === 'None' ? [chime] : [chime, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
|
|
13
13
|
if (identifyType !== Identify.IdentifyType.None) {
|
|
14
14
|
this.createDefaultIdentifyClusterServer(identifyTime, identifyType);
|
|
15
15
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-camera",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-dev-20260713-96dfc44",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-camera",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.2-dev-20260713-96dfc44",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.0",
|