Skip to content

Commit 63eae14

Browse files
authored
Merge pull request #10 from Luligu/dev
Release 0.5.1
2 parents a0a351b + d4f7f4c commit 63eae14

16 files changed

Lines changed: 891 additions & 92 deletions

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.5.1] - 2024-06-25
6+
7+
### Added
8+
9+
- [color]: Added ColorControl cluster to shelly device with rgb.
10+
- [current]: Added the current value to EveHistory electrical cluster.
11+
12+
### Fixed
13+
14+
- [cover]: Fix cover move to position for gen 2.
15+
- [power]: Fix power value update.
16+
17+
<a href="https://www.buymeacoffee.com/luligugithub">
18+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
19+
</a>
20+
521
## [0.4.0] - 2024-06-23
622

723
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matterbridge-shelly",
3-
"version": "0.4.0",
3+
"version": "0.5.1",
44
"description": "Matterbridge shelly plugin",
55
"author": "https://github.com/Luligu",
66
"license": "Apache-2.0",

src/auth.ts

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1+
/**
2+
* This file contains the auth functions.
3+
*
4+
* @file src\auth.ts
5+
* @author Luca Liguori
6+
* @date 2024-05-01
7+
* @version 1.0.0
8+
*
9+
* Copyright 2024, 2025 Luca Liguori.
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License. *
22+
*/
23+
124
import crypto from 'crypto';
2-
/*
3-
import { AnsiLogger, TimestampFormat, db, idn, rs, zb } from 'node-ansi-logger';
4-
import { Shelly } from './shelly.js';
5-
import { ShellyDevice } from './shellyDevice.js';
6-
*/
725

826
export interface AuthParams {
927
realm: string; // device_id
@@ -53,6 +71,22 @@ export function getGen1BodyOptions(params?: Record<string, string | number | boo
5371
return new URLSearchParams(params as any).toString();
5472
}
5573

74+
/*
75+
options: {
76+
"method":"POST",
77+
"headers": {
78+
"Content-Type":"application/json"
79+
},
80+
"body": "{
81+
\"jsonrpc\":\"2.0\",
82+
\"id\":10,
83+
\"src\":\"Matterbridge\",
84+
\"method\":\"Cover.GoToPosition \",
85+
\"params\":{\"id\":0,\"pos\":90}
86+
}"
87+
}
88+
*/
89+
5690
export function getGen2BodyOptions(jsonrpc: string, id: number, src: string, method: string, params?: Record<string, string | number | boolean>, auth?: AuthParams): string {
5791
const body: Record<string, string | number | boolean | object | AuthParams> = {};
5892
body.jsonrpc = '2.0';
@@ -61,6 +95,7 @@ export function getGen2BodyOptions(jsonrpc: string, id: number, src: string, met
6195
body.method = method;
6296
if (params) body.params = params;
6397
if (auth) body.auth = auth;
98+
// console.log(JSON.stringify(body));
6499
return JSON.stringify(body);
65100
}
66101

src/ble.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/**
2+
* This file contains the ble functions.
3+
*
4+
* @file src\ble.ts
5+
* @author Luca Liguori
6+
* @date 2024-05-01
7+
* @version 1.0.0
8+
*
9+
* Copyright 2024, 2025 Luca Liguori.
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License. *
22+
*/
23+
124
/*
225
// eslint-disable-next-line @typescript-eslint/no-unused-vars
326
import { AnsiLogger, TimestampFormat, db, debugStringify, dn, hk, nf, rs, wr, zb } from 'node-ansi-logger';

src/coapServer.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/**
2+
* This file contains the class CoapServer.
3+
*
4+
* @file src\coapServer.ts
5+
* @author Luca Liguori
6+
* @date 2024-05-01
7+
* @version 1.0.0
8+
*
9+
* Copyright 2024, 2025 Luca Liguori.
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License. *
22+
*/
23+
124
import { AnsiLogger, BLUE, CYAN, MAGENTA, RESET, TimestampFormat, db, debugStringify, idn, rs } from 'node-ansi-logger';
225
import coap, { Server, IncomingMessage, OutgoingMessage, globalAgent } from 'coap';
326
import EventEmitter from 'events';

0 commit comments

Comments
 (0)