Skip to content

Commit

Permalink
Release 1.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Mar 18, 2024
1 parent 7ceb6da commit 5b40f60
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 19 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,37 @@ The easiest way is to clone:

Then change the name, version, description and author in the package.json.

Add your plugin logic in platform.ts:
Add your plugin logic in platform.ts.

### onStart(reason?: string)
## MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform api

### async onStart(reason?: string)
The method onStart() is where you have to create your MatterbridgeDevice and add all needed clusters and command handlers.

The MatterbridgeDevice class has the create cluster methods already done and all command handlers needed (see plugin examples).

The method is called when Matterbridge load the plugin.

### onConfigure()
### async onConfigure()
The method onConfigure() is where you can configure or initialize your device.

The method is called when the platform is commissioned.

### onShutdown(reason?: string)
### async onShutdown(reason?: string)
The method onShutdown() is where you have to eventually cleanup some resources.

The method is called when Matterbridge is shutting down.

### async registerDevice(device: MatterbridgeDevice)
After you created your device, add it to the platform.

### async unregisterDevice(device: MatterbridgeDevice)
You can unregister one or more device.

### async unregisterAllDevices()
You can unregister all devices you added.

It can me be useful to call this method from onShutdown if you don't want to keep all the devices.

## MatterbridgeDevice api

6 changes: 3 additions & 3 deletions frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "/static/css/main.5d339656.css",
"main.css": "/static/css/main.3804969f.css",
"main.js": "/static/js/main.82822a11.js",
"static/js/453.d855a71b.chunk.js": "/static/js/453.d855a71b.chunk.js",
"index.html": "/index.html",
"main.5d339656.css.map": "/static/css/main.5d339656.css.map",
"main.3804969f.css.map": "/static/css/main.3804969f.css.map",
"main.82822a11.js.map": "/static/js/main.82822a11.js.map",
"453.d855a71b.chunk.js.map": "/static/js/453.d855a71b.chunk.js.map"
},
"entrypoints": [
"static/css/main.5d339656.css",
"static/css/main.3804969f.css",
"static/js/main.82822a11.js"
]
}
2 changes: 1 addition & 1 deletion frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.82822a11.js"></script><link href="/static/css/main.5d339656.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.82822a11.js"></script><link href="/static/css/main.3804969f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/build/static/css/main.3804969f.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion frontend/build/static/css/main.5d339656.css.map

This file was deleted.

5 changes: 5 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ nav {
text-align: left;
}

.table-body {
max-height: 100px; /* Replace with your desired maximum height */
overflow-y: auto;
}

/* Table content style */
.table-content {
border: 1px solid #ddd;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"express": "^4.18.3",
"matter-history": "^1.0.11",
"node-ansi-logger": "^1.9.2",
"node-persist-manager": "^1.0.4",
"wtfnode": "^0.9.1"
"node-persist-manager": "^1.0.4"
}
}
6 changes: 3 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

/* eslint-disable no-console */
import wtf from 'wtfnode';
//import wtf from 'wtfnode';
import { Matterbridge } from './matterbridge.js';

let instance: Matterbridge | undefined;
Expand All @@ -42,13 +42,13 @@ function registerHandlers() {

async function shutdown() {
console.log('CLI: received shutdown event, exiting...');
wtf.dump();
//wtf.dump();
process.exit(0);
}

async function restart() {
console.log('CLI: received restart event, loading...');
wtf.dump();
//wtf.dump();
instance = await Matterbridge.loadInstance(true);
registerHandlers();
}
Expand Down
4 changes: 1 addition & 3 deletions src/matterbridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { fileURLToPath, pathToFileURL } from 'url';
import { promises as fs } from 'fs';
import { ExecException, exec, spawn } from 'child_process';
import { Server } from 'http';
import EventEmitter from 'events';
import express from 'express';
import os from 'os';
import path from 'path';
Expand All @@ -42,9 +43,6 @@ import { QrCodeSchema } from '@project-chip/matter-node.js/schema';
import { StorageBackendDisk, StorageBackendJsonFile, StorageContext, StorageManager } from '@project-chip/matter-node.js/storage';
import { requireMinNodeVersion, getParameter, getIntParameter, hasParameter } from '@project-chip/matter-node.js/util';
import { CryptoNode } from '@project-chip/matter-node.js/crypto';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { logEndpoint } from '@project-chip/matter-node.js/device';
import EventEmitter from 'events';

/*
Expand Down

0 comments on commit 5b40f60

Please sign in to comment.