mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-29 07:08:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03a0966528 | ||
|
|
f0a00ad580 | ||
|
|
2fd44b6776 | ||
|
|
e25d30ffe7 | ||
|
|
6d7c40de77 | ||
|
|
eeafbcf593 | ||
|
|
39328222f2 | ||
|
|
c8fe986927 | ||
|
|
a4b14a1238 | ||
|
|
61da16ef4d | ||
|
|
e58cf262fb | ||
|
|
47b2b63f8d | ||
|
|
d72b6cf1e2 | ||
|
|
828fb6b70f | ||
|
|
5498eb2b51 | ||
|
|
dc4f780c6e | ||
|
|
63d4b4a8ac | ||
|
|
8315e5dfd9 | ||
|
|
76bc864311 | ||
|
|
bd1ac17b97 | ||
|
|
87fd958507 | ||
|
|
80290f6452 | ||
|
|
bf7d5e2ab2 | ||
|
|
c5abd4584c | ||
|
|
af71b37591 | ||
|
|
ee489e846f | ||
|
|
a511770677 | ||
|
|
2157f53c49 | ||
|
|
db717f6f7d | ||
|
|
990b2e5721 | ||
|
|
70cf72350f | ||
|
|
63b4e7f7a3 | ||
|
|
acadfb2b3f | ||
|
|
77948bfc94 | ||
|
|
c964536071 | ||
|
|
7e0cdd1827 | ||
|
|
67f129489f | ||
|
|
26105ec6a5 | ||
|
|
0bde66abc6 | ||
|
|
65b7410b4b | ||
|
|
ea4cda3f52 | ||
|
|
236bbae62c | ||
|
|
50fcab5b4f | ||
|
|
e4dc92fd21 | ||
|
|
7968198ad3 | ||
|
|
806022ef65 | ||
|
|
c8351c2654 | ||
|
|
5617643690 | ||
|
|
34be9016d5 | ||
|
|
5f633506d3 | ||
|
|
793eb0bd31 | ||
|
|
172299ee3e | ||
|
|
43c73e91ff | ||
|
|
8293a8944c | ||
|
|
828a39ea07 | ||
|
|
f8510b42ab | ||
|
|
87d411ff23 | ||
|
|
bc4884fde3 | ||
|
|
e34671deab | ||
|
|
e1c19d47f3 | ||
|
|
04f77fd537 | ||
|
|
ca2302dc04 | ||
|
|
a34031d65b | ||
|
|
144cfcfac8 | ||
|
|
d4c742303a | ||
|
|
b9c9e0be85 | ||
|
|
16a4a810cd | ||
|
|
94d07acf03 | ||
|
|
38d1cfd5ac | ||
|
|
8b51679981 | ||
|
|
9e7984d504 | ||
|
|
df8dbaab7f | ||
|
|
aea91a27c3 | ||
|
|
38412501de | ||
|
|
c5a184f107 | ||
|
|
b9626ade8b | ||
|
|
c4ad959564 | ||
|
|
8f0313cb8f | ||
|
|
a3a41ba560 | ||
|
|
fa70444e82 | ||
|
|
d7a0829881 | ||
|
|
bc86c64639 | ||
|
|
78fb5f32db | ||
|
|
4010a1f8f1 | ||
|
|
8cfbeef775 | ||
|
|
342031366c | ||
|
|
b22b1fb200 | ||
|
|
c95de22d5b | ||
|
|
c11b3505ef | ||
|
|
2c7c727316 | ||
|
|
faa7a8bcb2 | ||
|
|
12f3b3d621 | ||
|
|
a7993f23a6 | ||
|
|
5dcd5a94b2 | ||
|
|
366efe196c | ||
|
|
44b20937eb | ||
|
|
8b4f32618b | ||
|
|
807974afa0 | ||
|
|
51231b9397 | ||
|
|
df3866aff4 | ||
|
|
e6f3d348fe | ||
|
|
c318e62636 | ||
|
|
96d7e91439 | ||
|
|
e8990c1bbb | ||
|
|
5eeed1bc6e | ||
|
|
db33961a25 | ||
|
|
a464dcfea3 | ||
|
|
45ec158d4d | ||
|
|
b85af0a771 | ||
|
|
922cc90521 | ||
|
|
a7979ce14e | ||
|
|
5122559c35 | ||
|
|
bd1f9fb098 | ||
|
|
d441b03073 | ||
|
|
13555819b8 | ||
|
|
3a8e47a06c | ||
|
|
6c8d1b8c2a | ||
|
|
bf23ee6e70 | ||
|
|
0384a134aa | ||
|
|
f7dd995fc1 | ||
|
|
ab6f7b7f86 | ||
|
|
e1dbd7d036 | ||
|
|
1c4cb6b1b6 | ||
|
|
b586f9fc0f | ||
|
|
8a263fc213 | ||
|
|
f81b2fa286 | ||
|
|
89228e7250 | ||
|
|
cbc9e8d948 | ||
|
|
21bb4186f1 | ||
|
|
959440055f | ||
|
|
de01e26a37 | ||
|
|
cda68c281f | ||
|
|
a748507aae | ||
|
|
6037563712 | ||
|
|
7ce933384c | ||
|
|
dfff9f6bea | ||
|
|
1c05883e0b | ||
|
|
d6ce05f2cb | ||
|
|
43d9726e52 | ||
|
|
9f24fcec96 | ||
|
|
8c2311bfd9 | ||
|
|
557eee9cbc | ||
|
|
c741240526 | ||
|
|
c652a64d91 | ||
|
|
e9d703d635 | ||
|
|
97c6860a34 | ||
|
|
1d0386c236 | ||
|
|
33fa818802 | ||
|
|
571caead21 | ||
|
|
d8cdfbd6b9 | ||
|
|
906996bc5b | ||
|
|
e9caf9276f | ||
|
|
a9ce5b54df | ||
|
|
b84070cde7 | ||
|
|
cea5a2bf6e | ||
|
|
3edfe80af6 | ||
|
|
b966a5642b | ||
|
|
3e31936510 | ||
|
|
10bbb1320a | ||
|
|
df5f63f786 | ||
|
|
fc56123a20 | ||
|
|
e745ab21f2 | ||
|
|
00ddd44543 | ||
|
|
4d233d2006 | ||
|
|
f9bb69ce3a | ||
|
|
aaf8191ef1 | ||
|
|
84299bc015 | ||
|
|
158b3fbb22 | ||
|
|
5f3ee38ef9 | ||
|
|
e83a758321 | ||
|
|
7990235d21 | ||
|
|
0110694375 | ||
|
|
b8c8883c01 | ||
|
|
713d57ff0f | ||
|
|
af94609b7d | ||
|
|
d796c5788b | ||
|
|
3e1a7d11a6 | ||
|
|
a2a149bbf8 | ||
|
|
c5eaac9a4b | ||
|
|
8747fc3e19 | ||
|
|
3c80793a2e | ||
|
|
45835fdd14 | ||
|
|
71c0acfb84 | ||
|
|
714a325377 | ||
|
|
b305b18d49 | ||
|
|
51d093dacf | ||
|
|
59748a1aed | ||
|
|
60befc7258 | ||
|
|
133c9f5775 | ||
|
|
b51947ef77 | ||
|
|
fe8777c1e9 | ||
|
|
74e6ffaff2 | ||
|
|
c9b5837a4a | ||
|
|
d0db680b28 | ||
|
|
1456a724e3 | ||
|
|
d308937631 | ||
|
|
1b0f14ff0d | ||
|
|
7aafa09f93 | ||
|
|
6e094d8fc0 | ||
|
|
363959f96f | ||
|
|
492d19a3f8 | ||
|
|
955d215162 | ||
|
|
ff05bfd345 | ||
|
|
c127931473 | ||
|
|
d649480881 | ||
|
|
481b569749 | ||
|
|
185d257fd3 | ||
|
|
8edf459ad8 | ||
|
|
5056ae80cd | ||
|
|
666557a8da | ||
|
|
2365d74d71 | ||
|
|
68280d00b9 | ||
|
|
421ec1c811 | ||
|
|
0670fd43be | ||
|
|
57b31c81ee | ||
|
|
30d73e3a8d | ||
|
|
3dba2c0d84 | ||
|
|
fbcfc27036 | ||
|
|
02b0fc44e2 | ||
|
|
b8a84b4604 | ||
|
|
997e961343 | ||
|
|
b977a9badf | ||
|
|
417b99c367 | ||
|
|
310a95a431 | ||
|
|
f3b8023ca8 | ||
|
|
a6ff8dc1b5 | ||
|
|
426ed8e125 | ||
|
|
2c2653e0db | ||
|
|
42314cfe2d | ||
|
|
e00d5a106d | ||
|
|
e3328b3660 | ||
|
|
40d21e4634 | ||
|
|
f5052bc411 | ||
|
|
f1a9a17bcf | ||
|
|
420a4db6f2 | ||
|
|
042b0bc5aa | ||
|
|
bbd69d96a9 | ||
|
|
c4fb905100 | ||
|
|
46741f103e | ||
|
|
7d89775e45 | ||
|
|
f62f8b7469 | ||
|
|
74d246479e | ||
|
|
546f246e35 | ||
|
|
6352481c92 | ||
|
|
980130aa2f | ||
|
|
1ebbc79913 | ||
|
|
37a9a55892 | ||
|
|
752671a228 | ||
|
|
a68de9179e | ||
|
|
8ebe5705db | ||
|
|
c824f33f63 | ||
|
|
ec65341356 | ||
|
|
870ccbe69c | ||
|
|
bdc72c40cc | ||
|
|
4566485bc2 | ||
|
|
23f2fe2c83 | ||
|
|
7968aa3bd5 | ||
|
|
6116237e17 | ||
|
|
d391bbbf07 | ||
|
|
f161eb1496 | ||
|
|
4122a972cb | ||
|
|
af63a6e5c1 | ||
|
|
37ec03f458 | ||
|
|
9a68b075ef | ||
|
|
a7828b3f34 | ||
|
|
e293ceaf59 | ||
|
|
3c90538049 | ||
|
|
ef3e2deef3 | ||
|
|
27e9cf2924 | ||
|
|
96f4acd316 | ||
|
|
a05c48615a | ||
|
|
1a6e18395a | ||
|
|
92f75387d5 | ||
|
|
6dffe4c406 | ||
|
|
5f679d2599 | ||
|
|
a8158b58eb | ||
|
|
b7a74443c5 | ||
|
|
16a424a387 | ||
|
|
4828eb6f2d | ||
|
|
5acb0150af | ||
|
|
3193b80e76 | ||
|
|
e74883a503 | ||
|
|
dcd69a2ede | ||
|
|
9783436db2 | ||
|
|
4e9281c2a8 | ||
|
|
afccea07e8 | ||
|
|
9ebb6dac6a | ||
|
|
c237b1af71 | ||
|
|
554ba562c1 | ||
|
|
984e4523b5 | ||
|
|
1f7c6ba765 | ||
|
|
ba9ea4b685 | ||
|
|
00afb66382 | ||
|
|
1a29da2413 | ||
|
|
6d0f686b96 | ||
|
|
d80898b932 | ||
|
|
da3efe1a66 | ||
|
|
bedd9e4de7 | ||
|
|
beb91a7254 | ||
|
|
cd259a4c9d | ||
|
|
398ffec4ad | ||
|
|
0cd359eb05 | ||
|
|
6255dc1734 | ||
|
|
d67d2d3058 | ||
|
|
aaac9503bb | ||
|
|
d14140238b | ||
|
|
23ee97e14f | ||
|
|
5a119a3451 | ||
|
|
7e85c083af | ||
|
|
f9643ac8e9 | ||
|
|
221cdb9017 | ||
|
|
eb8b6b9198 | ||
|
|
63dabce636 | ||
|
|
c5a7438111 | ||
|
|
751d3a50a7 | ||
|
|
31625c34c0 | ||
|
|
a86e33d640 | ||
|
|
b0b0ff031b | ||
|
|
90b7d3f3e5 | ||
|
|
3a7a3aa2eb | ||
|
|
94a629249d | ||
|
|
b25d168bc4 | ||
|
|
db8d0128c2 | ||
|
|
6179bab315 | ||
|
|
6f8c921aca | ||
|
|
cf83ece432 | ||
|
|
35891e67cb | ||
|
|
7213913cff | ||
|
|
9f1a5849a7 | ||
|
|
2a08c97208 | ||
|
|
6657c03078 | ||
|
|
e0fa35a096 | ||
|
|
5a55c8aae1 | ||
|
|
bafa20d1ce | ||
|
|
8b49159954 | ||
|
|
6acc0dd837 | ||
|
|
2b0f2cb98d | ||
|
|
f508917a4e | ||
|
|
96a3e1c781 | ||
|
|
d19056be38 | ||
|
|
939c1fe3d1 | ||
|
|
3b6aa7a981 | ||
|
|
574f90d9f8 | ||
|
|
a33888d86f | ||
|
|
ec3b908ec2 | ||
|
|
a271ab5efb | ||
|
|
a3b52c6ae5 | ||
|
|
e966b56235 | ||
|
|
ad2ac2354c | ||
|
|
7c54e2f63f | ||
|
|
0fc733cab9 | ||
|
|
7a29fb0d9e | ||
|
|
5964edb25e | ||
|
|
388dad7cf6 | ||
|
|
0eca48bf1c | ||
|
|
b26aa39428 | ||
|
|
2c6688e794 | ||
|
|
62d2146dfd | ||
|
|
d68da013e2 | ||
|
|
d06014eeb3 | ||
|
|
c9abc09f21 | ||
|
|
0729ed18aa | ||
|
|
eaf93fee7f | ||
|
|
4fbb0f8d02 | ||
|
|
cdcefbaa70 | ||
|
|
c377df9dc8 | ||
|
|
260eb96419 | ||
|
|
9f6b7e57b4 | ||
|
|
c4c43eb78b | ||
|
|
f977c25c32 | ||
|
|
dd7ed404c9 | ||
|
|
89638a79b9 | ||
|
|
6cad5a6c49 | ||
|
|
bbd6546242 | ||
|
|
20c2c12ede | ||
|
|
8dda33ee0f | ||
|
|
e5f2656098 | ||
|
|
73fce708db | ||
|
|
d657fc48b8 | ||
|
|
970ba6eba9 | ||
|
|
10f039a7df | ||
|
|
029967e096 | ||
|
|
5ade60e6d3 | ||
|
|
eb601c8d8f | ||
|
|
ec88247f36 | ||
|
|
c904a45750 | ||
|
|
39d1f95f65 | ||
|
|
642775254b | ||
|
|
983e123b87 | ||
|
|
211d637a0c | ||
|
|
4802490604 | ||
|
|
591e010392 | ||
|
|
f580266b86 | ||
|
|
e89a52e221 | ||
|
|
1b5e88f8ac | ||
|
|
761e86f10c | ||
|
|
18388717a1 | ||
|
|
32e2b534ec | ||
|
|
6fa01b10a7 | ||
|
|
b1679b9097 | ||
|
|
e4c893fcd6 | ||
|
|
c563bc386c | ||
|
|
c8e5d856a2 | ||
|
|
61b460a376 | ||
|
|
ecbf648b63 | ||
|
|
3126d5da4e | ||
|
|
0feca99c5a | ||
|
|
40f41d49a4 | ||
|
|
15f8f910d0 | ||
|
|
af44408dbb | ||
|
|
09ccd0e47f | ||
|
|
fdf3f6c18d | ||
|
|
05f1a73af6 | ||
|
|
51525422e8 | ||
|
|
d9f74e3ff3 | ||
|
|
155d3b5ef0 | ||
|
|
0308b23da5 | ||
|
|
1ee8f4bac3 | ||
|
|
ea9498659d | ||
|
|
ce6218cfc7 | ||
|
|
66e7717751 | ||
|
|
7f17909fd8 | ||
|
|
b1b7b50a6e | ||
|
|
56658f8492 | ||
|
|
dc1b8d9bd2 | ||
|
|
81ca6af7ff | ||
|
|
d25dd93262 | ||
|
|
9d040afd26 | ||
|
|
fdf4983211 | ||
|
|
d1b434eac1 | ||
|
|
37b39deadb | ||
|
|
1109d979b8 | ||
|
|
bdb6b44bea | ||
|
|
6c1a40ce8c | ||
|
|
29d76a4848 | ||
|
|
5ba6189341 | ||
|
|
8b1d07dd26 | ||
|
|
71d4ba4594 | ||
|
|
0700a4b56d | ||
|
|
143e27e56d | ||
|
|
d1a543a145 | ||
|
|
3c90c3d7bb | ||
|
|
84238187b0 | ||
|
|
bf79a825bc | ||
|
|
43c6caf744 | ||
|
|
cc877f5057 | ||
|
|
49de52fb53 | ||
|
|
ae7ea4b734 | ||
|
|
b1ff5f5405 | ||
|
|
d1c5338a1a | ||
|
|
0496e1ff93 | ||
|
|
0ce8d2a41f | ||
|
|
357389f270 | ||
|
|
0f05179586 | ||
|
|
ac3fe3ff9e | ||
|
|
f147e6a18a | ||
|
|
b7a71db800 | ||
|
|
64fa5f88f9 | ||
|
|
20b297d6e9 | ||
|
|
105176d4b7 | ||
|
|
149b4a38fc | ||
|
|
61220097f4 | ||
|
|
2f91655617 | ||
|
|
c132af6454 | ||
|
|
d4df8c22c8 | ||
|
|
7784aa45f9 | ||
|
|
05544273ab | ||
|
|
45d97b262f | ||
|
|
4c1c74faab | ||
|
|
490b662690 | ||
|
|
2eb0d3f52a | ||
|
|
67890dced6 | ||
|
|
9cff3a9f4c | ||
|
|
d0f0b1b0d9 | ||
|
|
b3feb13bc2 | ||
|
|
9135b68e12 | ||
|
|
8f037e771c | ||
|
|
af416a9d26 | ||
|
|
ab954842e3 | ||
|
|
0744b67280 | ||
|
|
ed96d85801 | ||
|
|
871142b427 | ||
|
|
9cfe41b627 | ||
|
|
8e1de2b8d4 | ||
|
|
8bc79bf9ef | ||
|
|
3cd45a7226 | ||
|
|
3a85596ef7 | ||
|
|
48fadba8ec | ||
|
|
ce64ba47ce | ||
|
|
924c602da3 | ||
|
|
110eb9abc4 | ||
|
|
6b06817470 | ||
|
|
ce49db85a7 | ||
|
|
bb855f8f94 | ||
|
|
423f2229da |
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:24",
|
||||
|
||||
"postCreateCommand": "pnpm config set store-dir /home/node/.local/share/pnpm/store && npm install typescript -g",
|
||||
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {
|
||||
"workbench.colorTheme": "Default Dark Modern",
|
||||
"window.menuBarVisibility": "classic",
|
||||
"editor.defaultFormatter": "biomejs.biome",
|
||||
"notebook.defaultFormatter": "biomejs.biome",
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.tabSize": 4,
|
||||
"editor.insertSpaces": true,
|
||||
"files.defaultLanguage": "typescript",
|
||||
"files.eol": "\n"
|
||||
},
|
||||
"extensions": ["biomejs.biome", "vitest.explorer"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
.eslintignore
|
||||
.eslintrc.js
|
||||
.git
|
||||
.github
|
||||
.gitignore
|
||||
.idea
|
||||
.npmrc
|
||||
.travis*
|
||||
.travis.yml
|
||||
README.md
|
||||
docker/Dockerfile*
|
||||
images
|
||||
node_modules
|
||||
scripts
|
||||
test
|
||||
coverage
|
||||
update.sh
|
||||
@@ -1,4 +0,0 @@
|
||||
github: [koenkk]
|
||||
custom:
|
||||
- https://www.paypal.me/koenkk
|
||||
- https://www.buymeacoffee.com/koenkk
|
||||
@@ -1,26 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 'IMPORTANT: Check development branch changelog first!!'
|
||||
url: https://gist.github.com/Koenkk/bfd4c3d1725a2cccacc11d6ba51008ba
|
||||
about: Before submitting an issue, check that it has not already been solved in the development branch. Click here to see the release notes of the development branch.
|
||||
- name: Switch to the development branch
|
||||
url: https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html
|
||||
about: If the development branch solves an issue you are facing, click here to see the instructions to switch to the development branch.
|
||||
- name: Questions/discussions
|
||||
url: https://github.com/Koenkk/zigbee2mqtt/discussions/new
|
||||
about: Ask questions, discuss devices, show things you made...
|
||||
- name: Original frontend issues
|
||||
url: https://github.com/nurikk/zigbee2mqtt-frontend/issues
|
||||
about: Issues with the frontend package zigbee2mqtt-frontend
|
||||
- name: WindFront frontend issues
|
||||
url: https://github.com/Nerivec/zigbee2mqtt-windfront/issues
|
||||
about: Issues with the frontend package zigbee2mqtt-windfront
|
||||
- name: Home Assistant addon issues
|
||||
url: https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/issues
|
||||
about: Issues with the Home Assistant addon
|
||||
- name: FAQ
|
||||
url: https://www.zigbee2mqtt.io/guide/faq
|
||||
about: Frequently asked questions
|
||||
- name: Support Chat
|
||||
url: https://discord.gg/NyseBeK
|
||||
about: Chat for feedback, questions and troubleshooting
|
||||
@@ -1,55 +0,0 @@
|
||||
name: External converter
|
||||
description: Submit an external converter
|
||||
title: '[External Converter]: '
|
||||
labels: [external converter]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**IMPORTANT:** In case the external converter fully works, please consider submitting a [pull request](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html#_4-create-a-pull-request) instead.
|
||||
- type: input
|
||||
id: link
|
||||
attributes:
|
||||
label: Link
|
||||
description: Link of this device (product page)
|
||||
placeholder: https://www.linktomydevice.org
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: database
|
||||
attributes:
|
||||
label: Database entry
|
||||
description: Entry of this device in `data/database.db` after pairing it
|
||||
placeholder: '{"id":53,"type":"Router","ieeeAddr":"0x10458d00024284f69","nwkAddr":10148,"manufId":4151,"manufName":"LUMI","powerSource":"DC Source","modelId":"lumi.relay.c2acn01","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":257,"inClusterList":[0,3,4,5,1,2,10,6,16,2820,12],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"lumi.relay.c2acn01","appVersion":1,"manufacturerName":"LUMI","powerSource":4,"zclVersion":0,"stackVersion":2,"hwVersion":18,"dateCode":"8-6-2020"}},"genAnalogInput":{"attributes":{"presentValue":129.04425048828125}},"genOnOff":{"attributes":{"61440":117440715,"onOff":1}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":257,"inClusterList":[6,16,4,5],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"61440":237478966,"onOff":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":1,"stackVersion":2,"hwVersion":18,"dateCode":"8-6-2020","zclVersion":0,"interviewCompleted":true,"meta":{},"lastSeen":1640285631405}'
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: z2m_version
|
||||
attributes:
|
||||
label: Zigbee2MQTT version
|
||||
description: Can be found in the frontend -> settings -> about -> Zigbee2MQTT version. Are you running Zigbee2MQTT 1.18.1? Then read [this](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.19.0).
|
||||
placeholder: '1.22.1'
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: external_definition
|
||||
attributes:
|
||||
label: External converter
|
||||
description: Code of the external converter, to retrieve in the Z2M frontend go to Settings -> Dev Console -> External Converters
|
||||
render: JavaScript
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What does/doesn't work with the external definition?
|
||||
description: Indicate what works and what doesn't work with the external definition.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: notes
|
||||
attributes:
|
||||
label: Notes
|
||||
description: Any additional information or context that might be helpful
|
||||
placeholder: Add any relevant notes or context here
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,38 +0,0 @@
|
||||
name: Feature request
|
||||
description: Suggest an idea for this project
|
||||
title: '[Feature request]: '
|
||||
labels: [feature request]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**IMPORTANT:** Before submitting:
|
||||
- Is your feature request related to the frontend? Then click [here](https://github.com/nurikk/zigbee2mqtt-frontend/issues/new?assignees=&labels=&template=feature_request.md&title=)
|
||||
- type: textarea
|
||||
id: textarea1
|
||||
attributes:
|
||||
label: Is your feature request related to a problem? Please describe
|
||||
placeholder: A clear and concise description of what the problem is. Eg. I'm always frustrated when [...]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: textarea2
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
placeholder: A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: textarea3
|
||||
attributes:
|
||||
label: Describe alternatives you've considered
|
||||
placeholder: A clear and concise description of any alternative solutions or features you've considered.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: textarea4
|
||||
attributes:
|
||||
label: Additional context
|
||||
placeholder: Add any other context or screenshots about the feature request here.
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,59 +0,0 @@
|
||||
name: New device support request
|
||||
description: Request support for a new device
|
||||
title: '[New device support]: '
|
||||
labels: [new device support]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**IMPORTANT:** Before submitting:
|
||||
- Make sure this device is not already supported in the dev branch by checking the [dev branch changelog](https://gist.github.com/Koenkk/bfd4c3d1725a2cccacc11d6ba51008ba#new-supported-devices)
|
||||
- Make sure there is no existing issue or PR for this device already, search for your device here: https://github.com/Koenkk/zigbee2mqtt/issues
|
||||
- Follow this [guide](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html)
|
||||
- If you are using the Home Assistant addon and are still on 1.18.1, check the first point of [this](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.19.0)
|
||||
- type: input
|
||||
id: link
|
||||
attributes:
|
||||
label: Link
|
||||
description: Link of this device (product page)
|
||||
placeholder: https://www.linktomydevice.org
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: database
|
||||
attributes:
|
||||
label: Database entry
|
||||
description: Entry of this device in `data/database.db` after pairing it
|
||||
placeholder: '{"id":53,"type":"Router","ieeeAddr":"0x10458d00024284f69","nwkAddr":10148,"manufId":4151,"manufName":"LUMI","powerSource":"DC Source","modelId":"lumi.relay.c2acn01","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":257,"inClusterList":[0,3,4,5,1,2,10,6,16,2820,12],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"lumi.relay.c2acn01","appVersion":1,"manufacturerName":"LUMI","powerSource":4,"zclVersion":0,"stackVersion":2,"hwVersion":18,"dateCode":"8-6-2020"}},"genAnalogInput":{"attributes":{"presentValue":129.04425048828125}},"genOnOff":{"attributes":{"61440":117440715,"onOff":1}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":257,"inClusterList":[6,16,4,5],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"61440":237478966,"onOff":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":1,"stackVersion":2,"hwVersion":18,"dateCode":"8-6-2020","zclVersion":0,"interviewCompleted":true,"meta":{},"lastSeen":1640285631405}'
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: z2m_version
|
||||
attributes:
|
||||
label: Zigbee2MQTT version
|
||||
description: Can be found in the frontend -> settings -> about -> Zigbee2MQTT version. Are you running Zigbee2MQTT 1.18.1? Then read [this](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.19.0).
|
||||
placeholder: '1.22.1'
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: external_definition
|
||||
attributes:
|
||||
label: External definition
|
||||
description: See [Creating the external definition](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html#_2-creating-the-external-definition)
|
||||
render: JavaScript
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What does/doesn't work with the external definition?
|
||||
description: Indicate what works and what doesn't work with the external definition.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: notes
|
||||
attributes:
|
||||
label: Notes
|
||||
description: Any additional information or context that might be helpful
|
||||
placeholder: Add any relevant notes or context here
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,93 +0,0 @@
|
||||
name: Problem report
|
||||
description: Create a report to help us improve
|
||||
labels: [problem]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**IMPORTANT:** Before submitting:
|
||||
- Zigbee2MQTT fails to start? Read [this](https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html)
|
||||
- Raspberry Pi users? Make sure to check [this](https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html#raspberry-pi-users-use-a-good-power-supply)
|
||||
- You read the [FAQ](https://www.zigbee2mqtt.io/guide/faq/)
|
||||
- Are you using an EZSP adapter (e.g. Dongle-E/SkyConnect)? Try the [new driver](https://github.com/Koenkk/zigbee2mqtt/discussions/21462)
|
||||
- Make sure the bug also occurs in the [dev branch](https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)
|
||||
- Make sure you are using the [latest firmware](https://www.zigbee2mqtt.io/guide/adapters/#recommended) on your adapter
|
||||
- The issue has not been [reported already](https://github.com/Koenkk/zigbee2mqtt/issues)
|
||||
- Is your issue related to the frontend? Then click [here](https://github.com/nurikk/zigbee2mqtt-frontend/issues/new?assignees=&labels=bug%2Ctriage&template=bug_report.yaml&title=%5BBug%5D%3A+)
|
||||
- If you are using the Home Assistant addon and are still on 1.18.1, check the first point of [this](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.19.0)
|
||||
- type: textarea
|
||||
id: what_happend
|
||||
attributes:
|
||||
label: What happened?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expect_to_happen
|
||||
attributes:
|
||||
label: What did you expect to happen?
|
||||
placeholder: I expected that ...
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: How to reproduce it (minimal and precise)
|
||||
placeholder: First do this, then this..
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: z2m_version
|
||||
attributes:
|
||||
label: Zigbee2MQTT version
|
||||
description: Can be found in the frontend -> settings -> about -> Zigbee2MQTT version. Are you running Zigbee2MQTT 1.18.1? Then read [this](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.19.0).
|
||||
placeholder: '1.22.1'
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: adapter_fwversion
|
||||
attributes:
|
||||
label: Adapter firmware version
|
||||
description: Can be found in the frontend -> settings -> about -> coordinator revision
|
||||
placeholder: '20211210'
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: adapter
|
||||
attributes:
|
||||
label: Adapter
|
||||
description: The adapter you are using. In case of EZSP, try the [new `ember` driver](https://github.com/Koenkk/zigbee2mqtt/discussions/21462) first.
|
||||
placeholder: Electrolama zig-a-zig-ah! (zzh!), Slaesh's CC2652RB stick, ...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: setup
|
||||
attributes:
|
||||
label: Setup
|
||||
description: |-
|
||||
How do you run Z2M (plain, add-on...) and on what machine (Pi, x86-64, containerized...)?
|
||||
When running on Linux also include output of: `uname -a && cat /etc/issue.net`
|
||||
placeholder: Add-on on Home Assistant OS on Intel NUC, Plain on Docker container, ...
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: device
|
||||
attributes:
|
||||
label: Device `database.db` entry
|
||||
description: If the problem is related to a specific device, paste the `database.db` entry here
|
||||
placeholder: '{"id":117,"type":"EndDevice","ieeeAddr":"0x00158d0001d8e1d2","nwkAddr":25887 ...'
|
||||
- type: textarea
|
||||
id: log
|
||||
attributes:
|
||||
label: Debug log
|
||||
description: After enabling [debug logging](https://www.zigbee2mqtt.io/guide/configuration/logging.html#debugging) the log can be found under `data/log`. Attach the file below
|
||||
placeholder: Click here and drag the file into it or click on "Attach files by.." below
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: notes
|
||||
attributes:
|
||||
label: Notes
|
||||
description: Any additional information or context that might be helpful
|
||||
placeholder: Add any relevant notes or context here
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,67 +0,0 @@
|
||||
name: Wrong device picture/vendor/model/description
|
||||
description: Use if device is detected as supported and is fully functional but has a wrong picture, vendor, model or description
|
||||
title: '[Wrong device]: '
|
||||
labels: [wrong device]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Submit this issue only if your device is detected as **supported** and works **fully**, but displays an incorrect picture, vendor, model, or description.
|
||||
|
||||
**IMPORTANT**: Before opening this issue, please review the [guide](https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html#fixing-tuya-device-detection) for instructions on fixing the device detection yourself.
|
||||
This usually only takes 5 minutes.
|
||||
- type: input
|
||||
id: link
|
||||
attributes:
|
||||
label: Link
|
||||
description: Link of this device (product page)
|
||||
placeholder: https://www.linktomydevice.org
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: model
|
||||
attributes:
|
||||
label: Model
|
||||
description: Expected model, model that is printed on the device, for Tuya device this is NOT something like TS0601 or _TZE200_cf1sl3tj
|
||||
placeholder: RTCGQ01LM
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: Expected description
|
||||
placeholder: Motion sensor
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: vendor
|
||||
attributes:
|
||||
label: Vendor
|
||||
description: Expected vendor
|
||||
placeholder: Xiaomi
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: picture
|
||||
attributes:
|
||||
label: Picture (link)
|
||||
description: Expected picture
|
||||
placeholder: https://www.linktomydevice.org/RTCGQ01LM.jpg
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: database
|
||||
attributes:
|
||||
label: Database entry
|
||||
description: Entry of this device in `data/database.db` after pairing it
|
||||
placeholder: '{"id":53,"type":"Router","ieeeAddr":"0x10458d00024284f69","nwkAddr":10148,"manufId":4151,"manufName":"LUMI","powerSource":"DC Source","modelId":"lumi.relay.c2acn01","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":257,"inClusterList":[0,3,4,5,1,2,10,6,16,2820,12],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"lumi.relay.c2acn01","appVersion":1,"manufacturerName":"LUMI","powerSource":4,"zclVersion":0,"stackVersion":2,"hwVersion":18,"dateCode":"8-6-2020"}},"genAnalogInput":{"attributes":{"presentValue":129.04425048828125}},"genOnOff":{"attributes":{"61440":117440715,"onOff":1}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":257,"inClusterList":[6,16,4,5],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"61440":237478966,"onOff":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":1,"stackVersion":2,"hwVersion":18,"dateCode":"8-6-2020","zclVersion":0,"interviewCompleted":true,"meta":{},"lastSeen":1640285631405}'
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: notes
|
||||
attributes:
|
||||
label: Notes
|
||||
placeholder: Some additional notes...
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,459 +0,0 @@
|
||||
# GitHub Copilot Instructions
|
||||
|
||||
## Priority Guidelines
|
||||
|
||||
When generating code for this repository:
|
||||
|
||||
1. **Version Compatibility**: Always detect and respect the exact versions of languages, frameworks, and libraries used in this project
|
||||
2. **Context Files**: Prioritize patterns and standards defined in the .github/copilot directory
|
||||
3. **Codebase Patterns**: When context files don't provide specific guidance, scan the codebase for established patterns
|
||||
4. **Architectural Consistency**: Maintain our layered architectural style with clear separation between controller, extensions, models, and utilities
|
||||
5. **Code Quality**: Prioritize maintainability, performance, security, and testability in all generated code
|
||||
|
||||
## Technology Stack
|
||||
|
||||
### Core Technologies
|
||||
- **Language**: TypeScript 5.9.3 with target `esnext` and module `NodeNext`
|
||||
- **Runtime**: Node.js ^20 || ^22 || ^24
|
||||
- **Package Manager**: pnpm 10.12.1
|
||||
- **Testing**: Vitest 3.1.1 with @vitest/coverage-v8
|
||||
- **Linting/Formatting**: Biome 2.2.5 (configured with 4-space indents, 150 line width, no bracket spacing)
|
||||
|
||||
### Key Dependencies
|
||||
- **zigbee-herdsman**: 6.2.0 (exact version - critical for Zigbee protocol compatibility)
|
||||
- **zigbee-herdsman-converters**: 25.42.0 (exact version - device definitions)
|
||||
- **MQTT**: mqtt 5.14.1
|
||||
- **Logging**: winston 3.18.3
|
||||
- **YAML**: js-yaml 4.1.0
|
||||
- **Decorators**: bind-decorator 1.0.11
|
||||
- **WebSocket**: ws 8.18.1
|
||||
|
||||
### TypeScript Configuration
|
||||
- **Strict Mode**: Enabled with `noImplicitAny` and `noImplicitThis`
|
||||
- **Module System**: NodeNext with ESM interop
|
||||
- **Decorators**: Experimental decorators enabled
|
||||
- **Composite**: True (for project references)
|
||||
- **Source Maps**: Inline source maps enabled
|
||||
- **Output**: Compiled to `dist/` directory
|
||||
|
||||
## Project Architecture
|
||||
|
||||
### Directory Structure
|
||||
```
|
||||
lib/ # Source TypeScript files
|
||||
├── controller.ts # Main controller orchestrating all components
|
||||
├── mqtt.ts # MQTT client management
|
||||
├── zigbee.ts # Zigbee network management
|
||||
├── state.ts # State management
|
||||
├── eventBus.ts # Event-driven communication
|
||||
├── extension/ # Extension system (plugins)
|
||||
│ ├── extension.ts # Abstract base class
|
||||
│ ├── availability.ts
|
||||
│ ├── bind.ts
|
||||
│ ├── bridge.ts
|
||||
│ ├── configure.ts
|
||||
│ └── ...
|
||||
├── model/ # Domain models
|
||||
│ ├── device.ts
|
||||
│ └── group.ts
|
||||
├── util/ # Utility functions
|
||||
│ ├── logger.ts
|
||||
│ ├── settings.ts
|
||||
│ ├── utils.ts
|
||||
│ └── ...
|
||||
└── types/ # TypeScript type definitions
|
||||
└── api.ts
|
||||
test/ # Vitest test files
|
||||
data/ # Runtime configuration and data
|
||||
```
|
||||
|
||||
### Architectural Patterns
|
||||
|
||||
#### Extension Pattern
|
||||
All extensions inherit from the abstract `Extension` base class:
|
||||
```typescript
|
||||
abstract class Extension {
|
||||
protected zigbee: Zigbee;
|
||||
protected mqtt: Mqtt;
|
||||
protected state: State;
|
||||
protected publishEntityState: PublishEntityState;
|
||||
protected eventBus: EventBus;
|
||||
|
||||
async start(): Promise<void> {}
|
||||
async stop(): Promise<void> {}
|
||||
}
|
||||
```
|
||||
|
||||
#### Event-Driven Architecture
|
||||
Use the `EventBus` for component communication. Events are strongly typed:
|
||||
```typescript
|
||||
interface EventBusMap {
|
||||
deviceMessage: [data: eventdata.DeviceMessage];
|
||||
mqttMessage: [data: eventdata.MQTTMessage];
|
||||
publishEntityState: [data: eventdata.PublishEntityState];
|
||||
// ... other events
|
||||
}
|
||||
```
|
||||
|
||||
#### Dependency Injection
|
||||
The `Controller` class instantiates and injects dependencies into extensions. Follow this pattern when creating new extensions.
|
||||
|
||||
## Code Style and Conventions
|
||||
|
||||
### Naming Conventions
|
||||
- **Classes**: PascalCase (e.g., `Extension`, `Device`, `EventBus`)
|
||||
- **Interfaces/Types**: PascalCase (e.g., `MqttPublishOptions`, `DeviceOptions`)
|
||||
- **Functions/Methods**: camelCase (e.g., `publishEntityState`, `enableDisableExtension`)
|
||||
- **Constants**: SCREAMING_SNAKE_CASE for top-level constants (e.g., `CURRENT_VERSION`, `LOG_LEVELS`)
|
||||
- **Private members**: Prefix with underscore for private class fields only when needed to distinguish from public properties (e.g., `_definitionModelID`)
|
||||
- **Files**: camelCase for TypeScript files (e.g., `eventBus.ts`, `externalJS.ts`)
|
||||
|
||||
### Import Organization
|
||||
Follow this import order (separated by blank lines):
|
||||
1. Node.js built-in modules (use `node:` prefix: `import fs from "node:fs"`)
|
||||
2. Third-party libraries (e.g., `bind-decorator`, `mqtt`)
|
||||
3. Type-only imports from external packages (using `type` keyword)
|
||||
4. Internal absolute imports from project root
|
||||
5. Type-only imports from internal modules
|
||||
|
||||
Example:
|
||||
```typescript
|
||||
import fs from "node:fs";
|
||||
import bind from "bind-decorator";
|
||||
import type {IClientOptions} from "mqtt";
|
||||
import {connectAsync} from "mqtt";
|
||||
import type {Zigbee2MQTTAPI} from "./types/api";
|
||||
import logger from "./util/logger";
|
||||
import * as settings from "./util/settings";
|
||||
```
|
||||
|
||||
### Type Annotations
|
||||
- Use `type` imports for TypeScript types: `import type * as zhc from "zigbee-herdsman-converters"`
|
||||
- Explicitly type function parameters and return types
|
||||
- Use `KeyValue` type for generic object payloads: `type KeyValue = Record<string, any>`
|
||||
- Prefer interfaces for object shapes, type aliases for unions/intersections
|
||||
- Use namespace exports for related types: `export type * as ZSpec from "zigbee-herdsman/dist/zspec"`
|
||||
|
||||
### Async/Await Patterns
|
||||
- Always use `async/await` for asynchronous operations
|
||||
- Return types should be explicitly `Promise<Type>`
|
||||
- Methods that don't return values should be `Promise<void>`
|
||||
- Use `Awaited<ReturnType<typeof fn>>` for inferring async function return types
|
||||
|
||||
### Decorators
|
||||
Use `@bind` decorator from `bind-decorator` for methods that need `this` binding:
|
||||
```typescript
|
||||
@bind async onMQTTMessage(data: eventdata.MQTTMessage): Promise<void> {
|
||||
// Implementation
|
||||
}
|
||||
```
|
||||
|
||||
### Error Handling
|
||||
- Use `throw new Error("message")` for explicit errors
|
||||
- Include descriptive error messages
|
||||
- Log errors using the logger: `logger.error("message")`
|
||||
- For Zigbee-herdsman errors, log the stack trace: `logger.error((error as Error).stack!)`
|
||||
- Catch and handle errors at appropriate boundaries (controller level)
|
||||
|
||||
### Logging
|
||||
Use the centralized logger (winston-based):
|
||||
```typescript
|
||||
import logger from "./util/logger";
|
||||
|
||||
logger.info("message");
|
||||
logger.warning("message");
|
||||
logger.error("message");
|
||||
logger.debug("message");
|
||||
```
|
||||
|
||||
- Use namespaced loggers for specific modules (created internally by logger)
|
||||
- Log levels: `error`, `warning`, `info`, `debug` (from most to least critical)
|
||||
- Include relevant context in log messages (device names, IEEE addresses, etc.)
|
||||
|
||||
## Code Quality Standards
|
||||
|
||||
### Maintainability
|
||||
- Write self-documenting code with clear, descriptive names
|
||||
- Keep methods focused on single responsibilities
|
||||
- Abstract classes should define clear contracts with protected members for subclasses
|
||||
- Use constructor dependency injection for required dependencies
|
||||
- Limit function complexity - methods should be concise and focused
|
||||
- Use TypeScript's strict mode features (`noImplicitAny`, `noImplicitThis`)
|
||||
|
||||
### Performance
|
||||
- Use `fs.rmSync(path, {recursive: true, force: true})` for synchronous file deletion when appropriate
|
||||
- Leverage async/await for I/O operations to avoid blocking
|
||||
- Use JSON stable stringify util for consistent object serialization
|
||||
- Cache computed values when appropriate (see device model patterns)
|
||||
- Use getter methods for computed properties that should be cached
|
||||
|
||||
### Security
|
||||
- Validate input using Ajv JSON schema validation (see `settings.ts` pattern)
|
||||
- Sanitize file paths using `path.join` from Node.js
|
||||
- Use YAML safe loading: `yaml.safeLoad()`
|
||||
- Handle sensitive data (credentials, tokens) through settings with proper defaults
|
||||
- Never log sensitive information (passwords, tokens)
|
||||
|
||||
### Testability
|
||||
- Write tests using Vitest with describe/it/expect patterns
|
||||
- Mock external dependencies using Vitest's `vi.mock()`
|
||||
- Use `beforeEach`, `afterEach`, `beforeAll`, `afterAll` for test setup/teardown
|
||||
- Place test files in `test/` directory with `.test.ts` extension
|
||||
- Mock constructors and modules in the pattern shown in `test/controller.test.ts`
|
||||
- Use `flushPromises()` utility for async test synchronization
|
||||
- Target 100% code coverage (configured in vitest.config.mts)
|
||||
|
||||
## Testing Standards
|
||||
|
||||
### Unit Testing Structure
|
||||
```typescript
|
||||
import {afterAll, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
|
||||
describe("ComponentName", () => {
|
||||
beforeEach(() => {
|
||||
// Setup
|
||||
});
|
||||
|
||||
it("Should do something specific", async () => {
|
||||
// Arrange
|
||||
const input = {};
|
||||
|
||||
// Act
|
||||
const result = await someFunction(input);
|
||||
|
||||
// Assert
|
||||
expect(result).toBe(expected);
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
### Mocking Patterns
|
||||
- Create mock modules in `test/mocks/` directory
|
||||
- Use `vi.fn()` for function mocks
|
||||
- Use `vi.mock()` for module mocks
|
||||
- Clear mocks in `afterEach` or between tests
|
||||
- Mock external libraries like `mqtt`, `zigbee-herdsman` consistently
|
||||
|
||||
### Test Coverage
|
||||
- All code in `lib/**` should be covered
|
||||
- Use coverage reports: `pnpm test:coverage`
|
||||
- Thresholds set to 100% (can be adjusted per project needs)
|
||||
- Tests should cover both success and failure paths
|
||||
|
||||
## Documentation Standards
|
||||
|
||||
### JSDoc Comments
|
||||
Use JSDoc-style comments for classes and public methods:
|
||||
```typescript
|
||||
/**
|
||||
* Besides initializing variables, the constructor should do nothing!
|
||||
*
|
||||
* @param {Zigbee} zigbee Zigbee controller
|
||||
* @param {Mqtt} mqtt MQTT controller
|
||||
* @param {State} state State controller
|
||||
* @param {Function} publishEntityState Method to publish device state to MQTT.
|
||||
* @param {EventBus} eventBus The event bus
|
||||
*/
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, ...) {
|
||||
```
|
||||
|
||||
### Comment Style
|
||||
- Use single-line comments (`//`) for implementation notes
|
||||
- Use JSDoc (`/** */`) for public APIs and class/method documentation
|
||||
- Include context for non-obvious logic
|
||||
- Document parameters with their types and purposes
|
||||
- Use `@param` tags with TypeScript types in braces
|
||||
- Use biome-ignore comments when necessary: `// biome-ignore lint/rule: reason`
|
||||
|
||||
### Code Documentation
|
||||
- Document complex algorithms or business logic
|
||||
- Explain "why" not just "what" when logic is non-trivial
|
||||
- Include links to relevant issues or documentation when applicable
|
||||
- Document deprecations and breaking changes
|
||||
|
||||
## TypeScript-Specific Guidelines
|
||||
|
||||
### Module System
|
||||
- Use ES modules with `import`/`export` syntax
|
||||
- Default exports for main classes: `export default class Device {}`
|
||||
- Named exports for utilities and types: `export const LOG_LEVELS = ...`
|
||||
- Namespace exports for related types: `export type * as ZSpec from ...`
|
||||
- Use `.js` extension in imports for local modules when using dynamic imports: `await import("./extension/frontend.js")`
|
||||
|
||||
### Type Safety
|
||||
- Enable all strict type checking options
|
||||
- Use type guards and assertions when necessary: `asserts expose is zhc.Numeric`
|
||||
- Prefer `unknown` over `any` when type is truly unknown
|
||||
- Use `// biome-ignore lint/suspicious/noExplicitAny: API` when `any` is necessary
|
||||
- Define proper interfaces for external module types (e.g., `unix-dgram.d.ts`)
|
||||
|
||||
### Generic Types
|
||||
- Use generics for reusable, type-safe abstractions
|
||||
- Example: `abstract class ExternalJSExtension<M> extends Extension`
|
||||
- Constrain generics when appropriate
|
||||
- Document generic type parameters
|
||||
|
||||
### Utility Types
|
||||
- Use built-in utility types: `Partial`, `Required`, `Pick`, `Omit`, `Record`
|
||||
- Use `Awaited<ReturnType<typeof fn>>` for async function return types
|
||||
- Define custom utility types when patterns emerge
|
||||
- Use `type` for aliases, `interface` for object shapes
|
||||
|
||||
## Version Control and Releases
|
||||
|
||||
### Versioning Strategy
|
||||
- Follow Semantic Versioning (MAJOR.MINOR.PATCH)
|
||||
- Current version managed in `package.json`
|
||||
- Use `-dev` suffix for development versions (e.g., `2.6.2-dev`)
|
||||
- Configuration version tracked separately: `CURRENT_VERSION = 4`
|
||||
|
||||
### Changelog
|
||||
- Maintain CHANGELOG.md with all changes
|
||||
- Group changes by type: Bug Fixes, Features, Breaking Changes
|
||||
- Include issue/PR references: `([#28583](url))`
|
||||
- Include commit references: `([09f33b3](url))`
|
||||
- Use conventional commits format
|
||||
|
||||
### Git Workflow
|
||||
- Development on `dev` branch
|
||||
- Production releases from `master` branch
|
||||
- Use meaningful commit messages
|
||||
- Reference issues in commits
|
||||
|
||||
## Project-Specific Patterns
|
||||
|
||||
### Settings Management
|
||||
- All configuration loaded through `util/settings.ts`
|
||||
- Validate settings using Ajv with JSON schema
|
||||
- Schema defined in `settings.schema.json`
|
||||
- Support runtime setting changes with restart detection
|
||||
- Use `settings.get()` to access current configuration
|
||||
- Use `settings.getDevice(ieeeAddr)` for device-specific config
|
||||
|
||||
### Device and Group Models
|
||||
- Devices and groups are domain models wrapping `zigbee-herdsman` entities
|
||||
- Access underlying entity via `.zh` property
|
||||
- Expose computed properties as getters
|
||||
- Include definition from `zigbee-herdsman-converters`
|
||||
- Handle coordinator devices specially (type checking)
|
||||
|
||||
### MQTT Integration
|
||||
- MQTT client wrapped in `Mqtt` class
|
||||
- Publish options: `retain`, `qos` properties
|
||||
- Topics follow pattern: `{base_topic}/{device}/{attribute}`
|
||||
- Event-based message handling via EventBus
|
||||
- Clean disconnect handling with retry logic
|
||||
|
||||
### Extension System
|
||||
- Extensions are loosely coupled plugins
|
||||
- Lifecycle: constructor → start() → stop()
|
||||
- Constructor should only assign properties (no side effects)
|
||||
- Use EventBus for inter-extension communication
|
||||
- Extensions can be enabled/disabled at runtime
|
||||
- External extensions loaded from `data/external_extensions/`
|
||||
|
||||
### State Management
|
||||
- State persisted to `state.json`
|
||||
- Cached in memory for performance
|
||||
- Device states include all exposed attributes
|
||||
- State changes trigger events via EventBus
|
||||
|
||||
## Best Practices Specific to This Project
|
||||
|
||||
1. **Never use language features beyond TypeScript 5.9.3 or ES2024**
|
||||
2. **Always respect exact versions of zigbee-herdsman and zigbee-herdsman-converters** - these are critical for device compatibility
|
||||
3. **Use the EventBus for all component communication** - avoid direct coupling
|
||||
4. **Follow the Extension pattern for new features** - don't add logic directly to Controller
|
||||
5. **Log appropriately** - info for user-relevant events, debug for developer info, error for failures
|
||||
6. **Test with real Zigbee scenarios** - many edge cases exist with different device types
|
||||
7. **Handle coordinator specially** - coordinator is a device but with unique behavior
|
||||
8. **Validate all external input** - MQTT messages, configuration files, device data
|
||||
9. **Use the bind decorator** for event handlers to preserve `this` context
|
||||
10. **Match the exact code formatting** - Biome enforces 4 spaces, 150 line width, no bracket spacing
|
||||
|
||||
## Common Patterns to Follow
|
||||
|
||||
### Creating a New Extension
|
||||
1. Extend `Extension` abstract class
|
||||
2. Accept all dependencies in constructor
|
||||
3. Implement `start()` method for initialization
|
||||
4. Subscribe to EventBus events in `start()`
|
||||
5. Implement `stop()` method for cleanup
|
||||
6. Export as default: `export default class MyExtension extends Extension`
|
||||
|
||||
### Accessing Device Information
|
||||
```typescript
|
||||
const device: Device; // Our wrapper
|
||||
device.ieeeAddr; // IEEE address
|
||||
device.name; // Friendly name
|
||||
device.zh; // Underlying zigbee-herdsman device
|
||||
device.definition; // zigbee-herdsman-converters definition
|
||||
device.options; // User configuration
|
||||
```
|
||||
|
||||
### Publishing MQTT Messages
|
||||
```typescript
|
||||
await this.mqtt.publish(topic, message, {retain: true, qos: 0});
|
||||
```
|
||||
|
||||
### Emitting Events
|
||||
```typescript
|
||||
this.eventBus.emit('deviceMessage', {device, message});
|
||||
```
|
||||
|
||||
### Listening to Events
|
||||
```typescript
|
||||
this.eventBus.on('deviceMessage', this.onDeviceMessage, this);
|
||||
```
|
||||
|
||||
## Integration Points
|
||||
|
||||
### Zigbee-Herdsman Integration
|
||||
- Start controller: `await this.zigbee.start()`
|
||||
- Access coordinator: `this.zigbee.coordinator()`
|
||||
- Device operations through `zigbee-herdsman` API
|
||||
- Event handling through EventBus wrappers
|
||||
|
||||
### MQTT Integration
|
||||
- Connect: `await this.mqtt.connect()`
|
||||
- Subscribe: `await this.mqtt.subscribe(topic)`
|
||||
- Publish: `await this.mqtt.publish(topic, message, options)`
|
||||
- Handle messages via EventBus `mqttMessage` event
|
||||
|
||||
### Frontend Integration
|
||||
- Optional extension loaded dynamically
|
||||
- Serves static files with compression
|
||||
- WebSocket support for real-time updates
|
||||
- Configurable port and base URL
|
||||
|
||||
### Home Assistant Integration
|
||||
- Optional extension for discovery
|
||||
- Publishes discovery messages to MQTT
|
||||
- Supports entities, sensors, and devices
|
||||
- Configurable discovery topic
|
||||
|
||||
## Critical Compatibility Notes
|
||||
|
||||
1. **Node.js**: Only versions 20, 22, and 24 are supported
|
||||
2. **TypeScript**: Features must be compatible with 5.9.3
|
||||
3. **Zigbee Libraries**: Exact versions are critical - do not suggest upgrades without testing
|
||||
4. **MQTT Protocol**: Uses MQTT 3.1.1 and 5.0 features
|
||||
5. **ES Modules**: Project uses ESM with NodeNext resolution
|
||||
6. **Experimental Decorators**: Required for `@bind` decorator support
|
||||
|
||||
## When in Doubt
|
||||
|
||||
1. **Search for similar patterns** in the existing codebase
|
||||
2. **Check existing extensions** for implementation examples
|
||||
3. **Follow the controller and extension architecture** - don't bypass it
|
||||
4. **Consult the test files** for usage examples
|
||||
5. **Match the exact style** - run `pnpm check` to verify
|
||||
6. **Prioritize consistency** over external best practices
|
||||
7. **Test thoroughly** - this project controls real hardware
|
||||
|
||||
## Resources
|
||||
|
||||
- Repository: https://github.com/Koenkk/zigbee2mqtt
|
||||
- Documentation: https://koenkk.github.io/zigbee2mqtt
|
||||
- License: GPL-3.0
|
||||
- Issue Tracker: https://github.com/Koenkk/zigbee2mqtt/issues
|
||||
@@ -1,30 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
versioning-strategy: increase
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
target-branch: dev
|
||||
commit-message:
|
||||
prefix: fix(ignore)
|
||||
groups:
|
||||
minor-patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: docker
|
||||
directory: /docker
|
||||
schedule:
|
||||
interval: weekly
|
||||
target-branch: dev
|
||||
commit-message:
|
||||
prefix: fix(ignore)
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
target-branch: dev
|
||||
commit-message:
|
||||
prefix: chore
|
||||
@@ -1,294 +0,0 @@
|
||||
---
|
||||
description: 'Technology-agnostic blueprint generator for creating comprehensive copilot-instructions.md files that guide GitHub Copilot to produce code consistent with project standards, architecture patterns, and exact technology versions by analyzing existing codebase patterns and avoiding assumptions.'
|
||||
mode: 'agent'
|
||||
---
|
||||
|
||||
# Copilot Instructions Blueprint Generator
|
||||
|
||||
## Configuration Variables
|
||||
${PROJECT_TYPE="Auto-detect|.NET|Java|JavaScript|TypeScript|React|Angular|Python|Multiple|Other"} <!-- Primary technology -->
|
||||
${ARCHITECTURE_STYLE="Layered|Microservices|Monolithic|Domain-Driven|Event-Driven|Serverless|Mixed"} <!-- Architectural approach -->
|
||||
${CODE_QUALITY_FOCUS="Maintainability|Performance|Security|Accessibility|Testability|All"} <!-- Quality priorities -->
|
||||
${DOCUMENTATION_LEVEL="Minimal|Standard|Comprehensive"} <!-- Documentation requirements -->
|
||||
${TESTING_REQUIREMENTS="Unit|Integration|E2E|TDD|BDD|All"} <!-- Testing approach -->
|
||||
${VERSIONING="Semantic|CalVer|Custom"} <!-- Versioning approach -->
|
||||
|
||||
## Generated Prompt
|
||||
|
||||
"Generate a comprehensive copilot-instructions.md file that will guide GitHub Copilot to produce code consistent with our project's standards, architecture, and technology versions. The instructions must be strictly based on actual code patterns in our codebase and avoid making any assumptions. Follow this approach:
|
||||
|
||||
### 1. Core Instruction Structure
|
||||
|
||||
```markdown
|
||||
# GitHub Copilot Instructions
|
||||
|
||||
## Priority Guidelines
|
||||
|
||||
When generating code for this repository:
|
||||
|
||||
1. **Version Compatibility**: Always detect and respect the exact versions of languages, frameworks, and libraries used in this project
|
||||
2. **Context Files**: Prioritize patterns and standards defined in the .github/copilot directory
|
||||
3. **Codebase Patterns**: When context files don't provide specific guidance, scan the codebase for established patterns
|
||||
4. **Architectural Consistency**: Maintain our ${ARCHITECTURE_STYLE} architectural style and established boundaries
|
||||
5. **Code Quality**: Prioritize ${CODE_QUALITY_FOCUS == "All" ? "maintainability, performance, security, accessibility, and testability" : CODE_QUALITY_FOCUS} in all generated code
|
||||
|
||||
## Technology Version Detection
|
||||
|
||||
Before generating code, scan the codebase to identify:
|
||||
|
||||
1. **Language Versions**: Detect the exact versions of programming languages in use
|
||||
- Examine project files, configuration files, and package managers
|
||||
- Look for language-specific version indicators (e.g., <LangVersion> in .NET projects)
|
||||
- Never use language features beyond the detected version
|
||||
|
||||
2. **Framework Versions**: Identify the exact versions of all frameworks
|
||||
- Check package.json, .csproj, pom.xml, requirements.txt, etc.
|
||||
- Respect version constraints when generating code
|
||||
- Never suggest features not available in the detected framework versions
|
||||
|
||||
3. **Library Versions**: Note the exact versions of key libraries and dependencies
|
||||
- Generate code compatible with these specific versions
|
||||
- Never use APIs or features not available in the detected versions
|
||||
|
||||
## Context Files
|
||||
|
||||
Prioritize the following files in .github/copilot directory (if they exist):
|
||||
|
||||
- **architecture.md**: System architecture guidelines
|
||||
- **tech-stack.md**: Technology versions and framework details
|
||||
- **coding-standards.md**: Code style and formatting standards
|
||||
- **folder-structure.md**: Project organization guidelines
|
||||
- **exemplars.md**: Exemplary code patterns to follow
|
||||
|
||||
## Codebase Scanning Instructions
|
||||
|
||||
When context files don't provide specific guidance:
|
||||
|
||||
1. Identify similar files to the one being modified or created
|
||||
2. Analyze patterns for:
|
||||
- Naming conventions
|
||||
- Code organization
|
||||
- Error handling
|
||||
- Logging approaches
|
||||
- Documentation style
|
||||
- Testing patterns
|
||||
|
||||
3. Follow the most consistent patterns found in the codebase
|
||||
4. When conflicting patterns exist, prioritize patterns in newer files or files with higher test coverage
|
||||
5. Never introduce patterns not found in the existing codebase
|
||||
|
||||
## Code Quality Standards
|
||||
|
||||
${CODE_QUALITY_FOCUS.includes("Maintainability") || CODE_QUALITY_FOCUS == "All" ? `### Maintainability
|
||||
- Write self-documenting code with clear naming
|
||||
- Follow the naming and organization conventions evident in the codebase
|
||||
- Follow established patterns for consistency
|
||||
- Keep functions focused on single responsibilities
|
||||
- Limit function complexity and length to match existing patterns` : ""}
|
||||
|
||||
${CODE_QUALITY_FOCUS.includes("Performance") || CODE_QUALITY_FOCUS == "All" ? `### Performance
|
||||
- Follow existing patterns for memory and resource management
|
||||
- Match existing patterns for handling computationally expensive operations
|
||||
- Follow established patterns for asynchronous operations
|
||||
- Apply caching consistently with existing patterns
|
||||
- Optimize according to patterns evident in the codebase` : ""}
|
||||
|
||||
${CODE_QUALITY_FOCUS.includes("Security") || CODE_QUALITY_FOCUS == "All" ? `### Security
|
||||
- Follow existing patterns for input validation
|
||||
- Apply the same sanitization techniques used in the codebase
|
||||
- Use parameterized queries matching existing patterns
|
||||
- Follow established authentication and authorization patterns
|
||||
- Handle sensitive data according to existing patterns` : ""}
|
||||
|
||||
${CODE_QUALITY_FOCUS.includes("Accessibility") || CODE_QUALITY_FOCUS == "All" ? `### Accessibility
|
||||
- Follow existing accessibility patterns in the codebase
|
||||
- Match ARIA attribute usage with existing components
|
||||
- Maintain keyboard navigation support consistent with existing code
|
||||
- Follow established patterns for color and contrast
|
||||
- Apply text alternative patterns consistent with the codebase` : ""}
|
||||
|
||||
${CODE_QUALITY_FOCUS.includes("Testability") || CODE_QUALITY_FOCUS == "All" ? `### Testability
|
||||
- Follow established patterns for testable code
|
||||
- Match dependency injection approaches used in the codebase
|
||||
- Apply the same patterns for managing dependencies
|
||||
- Follow established mocking and test double patterns
|
||||
- Match the testing style used in existing tests` : ""}
|
||||
|
||||
## Documentation Requirements
|
||||
|
||||
${DOCUMENTATION_LEVEL == "Minimal" ?
|
||||
`- Match the level and style of comments found in existing code
|
||||
- Document according to patterns observed in the codebase
|
||||
- Follow existing patterns for documenting non-obvious behavior
|
||||
- Use the same format for parameter descriptions as existing code` : ""}
|
||||
|
||||
${DOCUMENTATION_LEVEL == "Standard" ?
|
||||
`- Follow the exact documentation format found in the codebase
|
||||
- Match the XML/JSDoc style and completeness of existing comments
|
||||
- Document parameters, returns, and exceptions in the same style
|
||||
- Follow existing patterns for usage examples
|
||||
- Match class-level documentation style and content` : ""}
|
||||
|
||||
${DOCUMENTATION_LEVEL == "Comprehensive" ?
|
||||
`- Follow the most detailed documentation patterns found in the codebase
|
||||
- Match the style and completeness of the best-documented code
|
||||
- Document exactly as the most thoroughly documented files do
|
||||
- Follow existing patterns for linking documentation
|
||||
- Match the level of detail in explanations of design decisions` : ""}
|
||||
|
||||
## Testing Approach
|
||||
|
||||
${TESTING_REQUIREMENTS.includes("Unit") || TESTING_REQUIREMENTS == "All" ?
|
||||
`### Unit Testing
|
||||
- Match the exact structure and style of existing unit tests
|
||||
- Follow the same naming conventions for test classes and methods
|
||||
- Use the same assertion patterns found in existing tests
|
||||
- Apply the same mocking approach used in the codebase
|
||||
- Follow existing patterns for test isolation` : ""}
|
||||
|
||||
${TESTING_REQUIREMENTS.includes("Integration") || TESTING_REQUIREMENTS == "All" ?
|
||||
`### Integration Testing
|
||||
- Follow the same integration test patterns found in the codebase
|
||||
- Match existing patterns for test data setup and teardown
|
||||
- Use the same approach for testing component interactions
|
||||
- Follow existing patterns for verifying system behavior` : ""}
|
||||
|
||||
${TESTING_REQUIREMENTS.includes("E2E") || TESTING_REQUIREMENTS == "All" ?
|
||||
`### End-to-End Testing
|
||||
- Match the existing E2E test structure and patterns
|
||||
- Follow established patterns for UI testing
|
||||
- Apply the same approach for verifying user journeys` : ""}
|
||||
|
||||
${TESTING_REQUIREMENTS.includes("TDD") || TESTING_REQUIREMENTS == "All" ?
|
||||
`### Test-Driven Development
|
||||
- Follow TDD patterns evident in the codebase
|
||||
- Match the progression of test cases seen in existing code
|
||||
- Apply the same refactoring patterns after tests pass` : ""}
|
||||
|
||||
${TESTING_REQUIREMENTS.includes("BDD") || TESTING_REQUIREMENTS == "All" ?
|
||||
`### Behavior-Driven Development
|
||||
- Match the existing Given-When-Then structure in tests
|
||||
- Follow the same patterns for behavior descriptions
|
||||
- Apply the same level of business focus in test cases` : ""}
|
||||
|
||||
## Technology-Specific Guidelines
|
||||
|
||||
${PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### .NET Guidelines
|
||||
- Detect and strictly adhere to the specific .NET version in use
|
||||
- Use only C# language features compatible with the detected version
|
||||
- Follow LINQ usage patterns exactly as they appear in the codebase
|
||||
- Match async/await usage patterns from existing code
|
||||
- Apply the same dependency injection approach used in the codebase
|
||||
- Use the same collection types and patterns found in existing code` : ""}
|
||||
|
||||
${PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### Java Guidelines
|
||||
- Detect and adhere to the specific Java version in use
|
||||
- Follow the exact same design patterns found in the codebase
|
||||
- Match exception handling patterns from existing code
|
||||
- Use the same collection types and approaches found in the codebase
|
||||
- Apply the dependency injection patterns evident in existing code` : ""}
|
||||
|
||||
${PROJECT_TYPE == "JavaScript" || PROJECT_TYPE == "TypeScript" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### JavaScript/TypeScript Guidelines
|
||||
- Detect and adhere to the specific ECMAScript/TypeScript version in use
|
||||
- Follow the same module import/export patterns found in the codebase
|
||||
- Match TypeScript type definitions with existing patterns
|
||||
- Use the same async patterns (promises, async/await) as existing code
|
||||
- Follow error handling patterns from similar files` : ""}
|
||||
|
||||
${PROJECT_TYPE == "React" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### React Guidelines
|
||||
- Detect and adhere to the specific React version in use
|
||||
- Match component structure patterns from existing components
|
||||
- Follow the same hooks and lifecycle patterns found in the codebase
|
||||
- Apply the same state management approach used in existing components
|
||||
- Match prop typing and validation patterns from existing code` : ""}
|
||||
|
||||
${PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### Angular Guidelines
|
||||
- Detect and adhere to the specific Angular version in use
|
||||
- Follow the same component and module patterns found in the codebase
|
||||
- Match decorator usage exactly as seen in existing code
|
||||
- Apply the same RxJS patterns found in the codebase
|
||||
- Follow existing patterns for component communication` : ""}
|
||||
|
||||
${PROJECT_TYPE == "Python" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### Python Guidelines
|
||||
- Detect and adhere to the specific Python version in use
|
||||
- Follow the same import organization found in existing modules
|
||||
- Match type hinting approaches if used in the codebase
|
||||
- Apply the same error handling patterns found in existing code
|
||||
- Follow the same module organization patterns` : ""}
|
||||
|
||||
## Version Control Guidelines
|
||||
|
||||
${VERSIONING == "Semantic" ?
|
||||
`- Follow Semantic Versioning patterns as applied in the codebase
|
||||
- Match existing patterns for documenting breaking changes
|
||||
- Follow the same approach for deprecation notices` : ""}
|
||||
|
||||
${VERSIONING == "CalVer" ?
|
||||
`- Follow Calendar Versioning patterns as applied in the codebase
|
||||
- Match existing patterns for documenting changes
|
||||
- Follow the same approach for highlighting significant changes` : ""}
|
||||
|
||||
${VERSIONING == "Custom" ?
|
||||
`- Match the exact versioning pattern observed in the codebase
|
||||
- Follow the same changelog format used in existing documentation
|
||||
- Apply the same tagging conventions used in the project` : ""}
|
||||
|
||||
## General Best Practices
|
||||
|
||||
- Follow naming conventions exactly as they appear in existing code
|
||||
- Match code organization patterns from similar files
|
||||
- Apply error handling consistent with existing patterns
|
||||
- Follow the same approach to testing as seen in the codebase
|
||||
- Match logging patterns from existing code
|
||||
- Use the same approach to configuration as seen in the codebase
|
||||
|
||||
## Project-Specific Guidance
|
||||
|
||||
- Scan the codebase thoroughly before generating any code
|
||||
- Respect existing architectural boundaries without exception
|
||||
- Match the style and patterns of surrounding code
|
||||
- When in doubt, prioritize consistency with existing code over external best practices
|
||||
```
|
||||
|
||||
### 2. Codebase Analysis Instructions
|
||||
|
||||
To create the copilot-instructions.md file, first analyze the codebase to:
|
||||
|
||||
1. **Identify Exact Technology Versions**:
|
||||
- ${PROJECT_TYPE == "Auto-detect" ? "Detect all programming languages, frameworks, and libraries by scanning file extensions and configuration files" : `Focus on ${PROJECT_TYPE} technologies`}
|
||||
- Extract precise version information from project files, package.json, .csproj, etc.
|
||||
- Document version constraints and compatibility requirements
|
||||
|
||||
2. **Understand Architecture**:
|
||||
- Analyze folder structure and module organization
|
||||
- Identify clear layer boundaries and component relationships
|
||||
- Document communication patterns between components
|
||||
|
||||
3. **Document Code Patterns**:
|
||||
- Catalog naming conventions for different code elements
|
||||
- Note documentation styles and completeness
|
||||
- Document error handling patterns
|
||||
- Map testing approaches and coverage
|
||||
|
||||
4. **Note Quality Standards**:
|
||||
- Identify performance optimization techniques actually used
|
||||
- Document security practices implemented in the code
|
||||
- Note accessibility features present (if applicable)
|
||||
- Document code quality patterns evident in the codebase
|
||||
|
||||
### 3. Implementation Notes
|
||||
|
||||
The final copilot-instructions.md should:
|
||||
- Be placed in the .github directory
|
||||
- Reference only patterns and standards that exist in the codebase
|
||||
- Include explicit version compatibility requirements
|
||||
- Avoid prescribing any practices not evident in the code
|
||||
- Provide concrete examples from the codebase
|
||||
- Be comprehensive yet concise enough for Copilot to effectively use
|
||||
|
||||
Important: Only include guidance based on patterns actually observed in the codebase. Explicitly instruct Copilot to prioritize consistency with existing code over external best practices or newer language features.
|
||||
"
|
||||
|
||||
## Expected Output
|
||||
|
||||
A comprehensive copilot-instructions.md file that will guide GitHub Copilot to produce code that is perfectly compatible with your existing technology versions and follows your established patterns and architecture.
|
||||
@@ -1,249 +0,0 @@
|
||||
---
|
||||
description: "Prompt for generating an AGENTS.md file for a repository"
|
||||
mode: "agent"
|
||||
---
|
||||
|
||||
# Create high‑quality AGENTS.md file
|
||||
|
||||
You are a code agent. Your task is to create a complete, accurate AGENTS.md at the root of this repository that follows the public guidance at https://agents.md/.
|
||||
|
||||
AGENTS.md is an open format designed to provide coding agents with the context and instructions they need to work effectively on a project.
|
||||
|
||||
## What is AGENTS.md?
|
||||
|
||||
AGENTS.md is a Markdown file that serves as a "README for agents" - a dedicated, predictable place to provide context and instructions to help AI coding agents work on your project. It complements README.md by containing detailed technical context that coding agents need but might clutter a human-focused README.
|
||||
|
||||
## Key Principles
|
||||
|
||||
- **Agent-focused**: Contains detailed technical instructions for automated tools
|
||||
- **Complements README.md**: Doesn't replace human documentation but adds agent-specific context
|
||||
- **Standardized location**: Placed at repository root (or subproject roots for monorepos)
|
||||
- **Open format**: Uses standard Markdown with flexible structure
|
||||
- **Ecosystem compatibility**: Works across 20+ different AI coding tools and agents
|
||||
|
||||
## File Structure and Content Guidelines
|
||||
|
||||
### 1. Required Setup
|
||||
|
||||
- Create the file as `AGENTS.md` in the repository root
|
||||
- Use standard Markdown formatting
|
||||
- No required fields - flexible structure based on project needs
|
||||
|
||||
### 2. Essential Sections to Include
|
||||
|
||||
#### Project Overview
|
||||
|
||||
- Brief description of what the project does
|
||||
- Architecture overview if complex
|
||||
- Key technologies and frameworks used
|
||||
|
||||
#### Setup Commands
|
||||
|
||||
- Installation instructions
|
||||
- Environment setup steps
|
||||
- Dependency management commands
|
||||
- Database setup if applicable
|
||||
|
||||
#### Development Workflow
|
||||
|
||||
- How to start development server
|
||||
- Build commands
|
||||
- Watch/hot-reload setup
|
||||
- Package manager specifics (npm, pnpm, yarn, etc.)
|
||||
|
||||
#### Testing Instructions
|
||||
|
||||
- How to run tests (unit, integration, e2e)
|
||||
- Test file locations and naming conventions
|
||||
- Coverage requirements
|
||||
- Specific test patterns or frameworks used
|
||||
- How to run subset of tests or focus on specific areas
|
||||
|
||||
#### Code Style Guidelines
|
||||
|
||||
- Language-specific conventions
|
||||
- Linting and formatting rules
|
||||
- File organization patterns
|
||||
- Naming conventions
|
||||
- Import/export patterns
|
||||
|
||||
#### Build and Deployment
|
||||
|
||||
- Build commands and outputs
|
||||
- Environment configurations
|
||||
- Deployment steps and requirements
|
||||
- CI/CD pipeline information
|
||||
|
||||
### 3. Optional but Recommended Sections
|
||||
|
||||
#### Security Considerations
|
||||
|
||||
- Security testing requirements
|
||||
- Secrets management
|
||||
- Authentication patterns
|
||||
- Permission models
|
||||
|
||||
#### Monorepo Instructions (if applicable)
|
||||
|
||||
- How to work with multiple packages
|
||||
- Cross-package dependencies
|
||||
- Selective building/testing
|
||||
- Package-specific commands
|
||||
|
||||
#### Pull Request Guidelines
|
||||
|
||||
- Title format requirements
|
||||
- Required checks before submission
|
||||
- Review process
|
||||
- Commit message conventions
|
||||
|
||||
#### Debugging and Troubleshooting
|
||||
|
||||
- Common issues and solutions
|
||||
- Logging patterns
|
||||
- Debug configuration
|
||||
- Performance considerations
|
||||
|
||||
## Example Template
|
||||
|
||||
Use this as a starting template and customize based on the specific project:
|
||||
|
||||
```markdown
|
||||
# AGENTS.md
|
||||
|
||||
## Project Overview
|
||||
|
||||
[Brief description of the project, its purpose, and key technologies]
|
||||
|
||||
## Setup Commands
|
||||
|
||||
- Install dependencies: `[package manager] install`
|
||||
- Start development server: `[command]`
|
||||
- Build for production: `[command]`
|
||||
|
||||
## Development Workflow
|
||||
|
||||
- [Development server startup instructions]
|
||||
- [Hot reload/watch mode information]
|
||||
- [Environment variable setup]
|
||||
|
||||
## Testing Instructions
|
||||
|
||||
- Run all tests: `[command]`
|
||||
- Run unit tests: `[command]`
|
||||
- Run integration tests: `[command]`
|
||||
- Test coverage: `[command]`
|
||||
- [Specific testing patterns or requirements]
|
||||
|
||||
## Code Style
|
||||
|
||||
- [Language and framework conventions]
|
||||
- [Linting rules and commands]
|
||||
- [Formatting requirements]
|
||||
- [File organization patterns]
|
||||
|
||||
## Build and Deployment
|
||||
|
||||
- [Build process details]
|
||||
- [Output directories]
|
||||
- [Environment-specific builds]
|
||||
- [Deployment commands]
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
- Title format: [component] Brief description
|
||||
- Required checks: `[lint command]`, `[test command]`
|
||||
- [Review requirements]
|
||||
|
||||
## Additional Notes
|
||||
|
||||
- [Any project-specific context]
|
||||
- [Common gotchas or troubleshooting tips]
|
||||
- [Performance considerations]
|
||||
```
|
||||
|
||||
## Working Example from agents.md
|
||||
|
||||
Here's a real example from the agents.md website:
|
||||
|
||||
```markdown
|
||||
# Sample AGENTS.md file
|
||||
|
||||
## Dev environment tips
|
||||
|
||||
- Use `pnpm dlx turbo run where <project_name>` to jump to a package instead of scanning with `ls`.
|
||||
- Run `pnpm install --filter <project_name>` to add the package to your workspace so Vite, ESLint, and TypeScript can see it.
|
||||
- Use `pnpm create vite@latest <project_name> -- --template react-ts` to spin up a new React + Vite package with TypeScript checks ready.
|
||||
- Check the name field inside each package's package.json to confirm the right name—skip the top-level one.
|
||||
|
||||
## Testing instructions
|
||||
|
||||
- Find the CI plan in the .github/workflows folder.
|
||||
- Run `pnpm turbo run test --filter <project_name>` to run every check defined for that package.
|
||||
- From the package root you can just call `pnpm test`. The commit should pass all tests before you merge.
|
||||
- To focus on one step, add the Vitest pattern: `pnpm vitest run -t "<test name>"`.
|
||||
- Fix any test or type errors until the whole suite is green.
|
||||
- After moving files or changing imports, run `pnpm lint --filter <project_name>` to be sure ESLint and TypeScript rules still pass.
|
||||
- Add or update tests for the code you change, even if nobody asked.
|
||||
|
||||
## PR instructions
|
||||
|
||||
- Title format: [<project_name>] <Title>
|
||||
- Always run `pnpm lint` and `pnpm test` before committing.
|
||||
```
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
1. **Analyze the project structure** to understand:
|
||||
|
||||
- Programming languages and frameworks used
|
||||
- Package managers and build tools
|
||||
- Testing frameworks
|
||||
- Project architecture (monorepo, single package, etc.)
|
||||
|
||||
2. **Identify key workflows** by examining:
|
||||
|
||||
- package.json scripts
|
||||
- Makefile or other build files
|
||||
- CI/CD configuration files
|
||||
- Documentation files
|
||||
|
||||
3. **Create comprehensive sections** covering:
|
||||
|
||||
- All essential setup and development commands
|
||||
- Testing strategies and commands
|
||||
- Code style and conventions
|
||||
- Build and deployment processes
|
||||
|
||||
4. **Include specific, actionable commands** that agents can execute directly
|
||||
|
||||
5. **Test the instructions** by ensuring all commands work as documented
|
||||
|
||||
6. **Keep it focused** on what agents need to know, not general project information
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Be specific**: Include exact commands, not vague descriptions
|
||||
- **Use code blocks**: Wrap commands in backticks for clarity
|
||||
- **Include context**: Explain why certain steps are needed
|
||||
- **Stay current**: Update as the project evolves
|
||||
- **Test commands**: Ensure all listed commands actually work
|
||||
- **Consider nested files**: For monorepos, create AGENTS.md files in subprojects as needed
|
||||
|
||||
## Monorepo Considerations
|
||||
|
||||
For large monorepos:
|
||||
|
||||
- Place a main AGENTS.md at the repository root
|
||||
- Create additional AGENTS.md files in subproject directories
|
||||
- The closest AGENTS.md file takes precedence for any given location
|
||||
- Include navigation tips between packages/projects
|
||||
|
||||
## Final Notes
|
||||
|
||||
- AGENTS.md works with 20+ AI coding tools including Cursor, Aider, Gemini CLI, and many others
|
||||
- The format is intentionally flexible - adapt it to your project's needs
|
||||
- Focus on actionable instructions that help agents understand and work with your codebase
|
||||
- This is living documentation - update it as your project evolves
|
||||
|
||||
When creating the AGENTS.md file, prioritize clarity, completeness, and actionability. The goal is to give any coding agent enough context to effectively contribute to the project without requiring additional human guidance.
|
||||
@@ -1,127 +0,0 @@
|
||||
---
|
||||
mode: 'agent'
|
||||
description: 'Create a new specification file for the solution, optimized for Generative AI consumption.'
|
||||
tools: ['changes', 'codebase', 'editFiles', 'extensions', 'fetch', 'githubRepo', 'openSimpleBrowser', 'problems', 'runTasks', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure', 'usages', 'vscodeAPI']
|
||||
---
|
||||
# Create Specification
|
||||
|
||||
Your goal is to create a new specification file for `${input:SpecPurpose}`.
|
||||
|
||||
The specification file must define the requirements, constraints, and interfaces for the solution components in a manner that is clear, unambiguous, and structured for effective use by Generative AIs. Follow established documentation standards and ensure the content is machine-readable and self-contained.
|
||||
|
||||
## Best Practices for AI-Ready Specifications
|
||||
|
||||
- Use precise, explicit, and unambiguous language.
|
||||
- Clearly distinguish between requirements, constraints, and recommendations.
|
||||
- Use structured formatting (headings, lists, tables) for easy parsing.
|
||||
- Avoid idioms, metaphors, or context-dependent references.
|
||||
- Define all acronyms and domain-specific terms.
|
||||
- Include examples and edge cases where applicable.
|
||||
- Ensure the document is self-contained and does not rely on external context.
|
||||
|
||||
The specification should be saved in the [/spec/](/spec/) directory and named according to the following convention: `spec-[a-z0-9-]+.md`, where the name should be descriptive of the specification's content and starting with the highlevel purpose, which is one of [schema, tool, data, infrastructure, process, architecture, or design].
|
||||
|
||||
The specification file must be formatted in well formed Markdown.
|
||||
|
||||
Specification files must follow the template below, ensuring that all sections are filled out appropriately. The front matter for the markdown should be structured correctly as per the example following:
|
||||
|
||||
```md
|
||||
---
|
||||
title: [Concise Title Describing the Specification's Focus]
|
||||
version: [Optional: e.g., 1.0, Date]
|
||||
date_created: [YYYY-MM-DD]
|
||||
last_updated: [Optional: YYYY-MM-DD]
|
||||
owner: [Optional: Team/Individual responsible for this spec]
|
||||
tags: [Optional: List of relevant tags or categories, e.g., `infrastructure`, `process`, `design`, `app` etc]
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
[A short concise introduction to the specification and the goal it is intended to achieve.]
|
||||
|
||||
## 1. Purpose & Scope
|
||||
|
||||
[Provide a clear, concise description of the specification's purpose and the scope of its application. State the intended audience and any assumptions.]
|
||||
|
||||
## 2. Definitions
|
||||
|
||||
[List and define all acronyms, abbreviations, and domain-specific terms used in this specification.]
|
||||
|
||||
## 3. Requirements, Constraints & Guidelines
|
||||
|
||||
[Explicitly list all requirements, constraints, rules, and guidelines. Use bullet points or tables for clarity.]
|
||||
|
||||
- **REQ-001**: Requirement 1
|
||||
- **SEC-001**: Security Requirement 1
|
||||
- **[3 LETTERS]-001**: Other Requirement 1
|
||||
- **CON-001**: Constraint 1
|
||||
- **GUD-001**: Guideline 1
|
||||
- **PAT-001**: Pattern to follow 1
|
||||
|
||||
## 4. Interfaces & Data Contracts
|
||||
|
||||
[Describe the interfaces, APIs, data contracts, or integration points. Use tables or code blocks for schemas and examples.]
|
||||
|
||||
## 5. Acceptance Criteria
|
||||
|
||||
[Define clear, testable acceptance criteria for each requirement using Given-When-Then format where appropriate.]
|
||||
|
||||
- **AC-001**: Given [context], When [action], Then [expected outcome]
|
||||
- **AC-002**: The system shall [specific behavior] when [condition]
|
||||
- **AC-003**: [Additional acceptance criteria as needed]
|
||||
|
||||
## 6. Test Automation Strategy
|
||||
|
||||
[Define the testing approach, frameworks, and automation requirements.]
|
||||
|
||||
- **Test Levels**: Unit, Integration, End-to-End
|
||||
- **Frameworks**: MSTest, FluentAssertions, Moq (for .NET applications)
|
||||
- **Test Data Management**: [approach for test data creation and cleanup]
|
||||
- **CI/CD Integration**: [automated testing in GitHub Actions pipelines]
|
||||
- **Coverage Requirements**: [minimum code coverage thresholds]
|
||||
- **Performance Testing**: [approach for load and performance testing]
|
||||
|
||||
## 7. Rationale & Context
|
||||
|
||||
[Explain the reasoning behind the requirements, constraints, and guidelines. Provide context for design decisions.]
|
||||
|
||||
## 8. Dependencies & External Integrations
|
||||
|
||||
[Define the external systems, services, and architectural dependencies required for this specification. Focus on **what** is needed rather than **how** it's implemented. Avoid specific package or library versions unless they represent architectural constraints.]
|
||||
|
||||
### External Systems
|
||||
- **EXT-001**: [External system name] - [Purpose and integration type]
|
||||
|
||||
### Third-Party Services
|
||||
- **SVC-001**: [Service name] - [Required capabilities and SLA requirements]
|
||||
|
||||
### Infrastructure Dependencies
|
||||
- **INF-001**: [Infrastructure component] - [Requirements and constraints]
|
||||
|
||||
### Data Dependencies
|
||||
- **DAT-001**: [External data source] - [Format, frequency, and access requirements]
|
||||
|
||||
### Technology Platform Dependencies
|
||||
- **PLT-001**: [Platform/runtime requirement] - [Version constraints and rationale]
|
||||
|
||||
### Compliance Dependencies
|
||||
- **COM-001**: [Regulatory or compliance requirement] - [Impact on implementation]
|
||||
|
||||
**Note**: This section should focus on architectural and business dependencies, not specific package implementations. For example, specify "OAuth 2.0 authentication library" rather than "Microsoft.AspNetCore.Authentication.JwtBearer v6.0.1".
|
||||
|
||||
## 9. Examples & Edge Cases
|
||||
|
||||
```code
|
||||
// Code snippet or data example demonstrating the correct application of the guidelines, including edge cases
|
||||
```
|
||||
|
||||
## 10. Validation Criteria
|
||||
|
||||
[List the criteria or tests that must be satisfied for compliance with this specification.]
|
||||
|
||||
## 11. Related Specifications / Further Reading
|
||||
|
||||
[Link to related spec 1]
|
||||
[Link to relevant external documentation]
|
||||
|
||||
```
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
mode: 'agent'
|
||||
description: 'Review and refactor code in your project according to defined instructions'
|
||||
---
|
||||
|
||||
## Role
|
||||
|
||||
You're a senior expert software engineer with extensive experience in maintaining projects over a long time and ensuring clean code and best practices.
|
||||
|
||||
## Task
|
||||
|
||||
1. Take a deep breath, and review all coding guidelines instructions in `.github/instructions/*.md` and `.github/copilot-instructions.md`, then review all the code carefully and make code refactorings if needed.
|
||||
2. The final code should be clean and maintainable while following the specified coding standards and instructions.
|
||||
3. Do not split up the code, keep the existing files intact.
|
||||
4. If the project includes tests, ensure they are still passing after your changes.
|
||||
@@ -1,127 +0,0 @@
|
||||
---
|
||||
mode: 'agent'
|
||||
description: 'Update an existing specification file for the solution, optimized for Generative AI consumption based on new requirements or updates to any existing code.'
|
||||
tools: ['changes', 'codebase', 'editFiles', 'extensions', 'fetch', 'githubRepo', 'openSimpleBrowser', 'problems', 'runTasks', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure', 'usages', 'vscodeAPI']
|
||||
---
|
||||
# Update Specification
|
||||
|
||||
Your goal is to update the existing specification file `${file}` based on new requirements or updates to any existing code.
|
||||
|
||||
The specification file must define the requirements, constraints, and interfaces for the solution components in a manner that is clear, unambiguous, and structured for effective use by Generative AIs. Follow established documentation standards and ensure the content is machine-readable and self-contained.
|
||||
|
||||
## Best Practices for AI-Ready Specifications
|
||||
|
||||
- Use precise, explicit, and unambiguous language.
|
||||
- Clearly distinguish between requirements, constraints, and recommendations.
|
||||
- Use structured formatting (headings, lists, tables) for easy parsing.
|
||||
- Avoid idioms, metaphors, or context-dependent references.
|
||||
- Define all acronyms and domain-specific terms.
|
||||
- Include examples and edge cases where applicable.
|
||||
- Ensure the document is self-contained and does not rely on external context.
|
||||
|
||||
The specification should be saved in the [/spec/](/spec/) directory and named according to the following convention: `[a-z0-9-]+.md`, where the name should be descriptive of the specification's content and starting with the highlevel purpose, which is one of [schema, tool, data, infrastructure, process, architecture, or design].
|
||||
|
||||
The specification file must be formatted in well formed Markdown.
|
||||
|
||||
Specification files must follow the template below, ensuring that all sections are filled out appropriately. The front matter for the markdown should be structured correctly as per the example following:
|
||||
|
||||
```md
|
||||
---
|
||||
title: [Concise Title Describing the Specification's Focus]
|
||||
version: [Optional: e.g., 1.0, Date]
|
||||
date_created: [YYYY-MM-DD]
|
||||
last_updated: [Optional: YYYY-MM-DD]
|
||||
owner: [Optional: Team/Individual responsible for this spec]
|
||||
tags: [Optional: List of relevant tags or categories, e.g., `infrastructure`, `process`, `design`, `app` etc]
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
[A short concise introduction to the specification and the goal it is intended to achieve.]
|
||||
|
||||
## 1. Purpose & Scope
|
||||
|
||||
[Provide a clear, concise description of the specification's purpose and the scope of its application. State the intended audience and any assumptions.]
|
||||
|
||||
## 2. Definitions
|
||||
|
||||
[List and define all acronyms, abbreviations, and domain-specific terms used in this specification.]
|
||||
|
||||
## 3. Requirements, Constraints & Guidelines
|
||||
|
||||
[Explicitly list all requirements, constraints, rules, and guidelines. Use bullet points or tables for clarity.]
|
||||
|
||||
- **REQ-001**: Requirement 1
|
||||
- **SEC-001**: Security Requirement 1
|
||||
- **[3 LETTERS]-001**: Other Requirement 1
|
||||
- **CON-001**: Constraint 1
|
||||
- **GUD-001**: Guideline 1
|
||||
- **PAT-001**: Pattern to follow 1
|
||||
|
||||
## 4. Interfaces & Data Contracts
|
||||
|
||||
[Describe the interfaces, APIs, data contracts, or integration points. Use tables or code blocks for schemas and examples.]
|
||||
|
||||
## 5. Acceptance Criteria
|
||||
|
||||
[Define clear, testable acceptance criteria for each requirement using Given-When-Then format where appropriate.]
|
||||
|
||||
- **AC-001**: Given [context], When [action], Then [expected outcome]
|
||||
- **AC-002**: The system shall [specific behavior] when [condition]
|
||||
- **AC-003**: [Additional acceptance criteria as needed]
|
||||
|
||||
## 6. Test Automation Strategy
|
||||
|
||||
[Define the testing approach, frameworks, and automation requirements.]
|
||||
|
||||
- **Test Levels**: Unit, Integration, End-to-End
|
||||
- **Frameworks**: MSTest, FluentAssertions, Moq (for .NET applications)
|
||||
- **Test Data Management**: [approach for test data creation and cleanup]
|
||||
- **CI/CD Integration**: [automated testing in GitHub Actions pipelines]
|
||||
- **Coverage Requirements**: [minimum code coverage thresholds]
|
||||
- **Performance Testing**: [approach for load and performance testing]
|
||||
|
||||
## 7. Rationale & Context
|
||||
|
||||
[Explain the reasoning behind the requirements, constraints, and guidelines. Provide context for design decisions.]
|
||||
|
||||
## 8. Dependencies & External Integrations
|
||||
|
||||
[Define the external systems, services, and architectural dependencies required for this specification. Focus on **what** is needed rather than **how** it's implemented. Avoid specific package or library versions unless they represent architectural constraints.]
|
||||
|
||||
### External Systems
|
||||
- **EXT-001**: [External system name] - [Purpose and integration type]
|
||||
|
||||
### Third-Party Services
|
||||
- **SVC-001**: [Service name] - [Required capabilities and SLA requirements]
|
||||
|
||||
### Infrastructure Dependencies
|
||||
- **INF-001**: [Infrastructure component] - [Requirements and constraints]
|
||||
|
||||
### Data Dependencies
|
||||
- **DAT-001**: [External data source] - [Format, frequency, and access requirements]
|
||||
|
||||
### Technology Platform Dependencies
|
||||
- **PLT-001**: [Platform/runtime requirement] - [Version constraints and rationale]
|
||||
|
||||
### Compliance Dependencies
|
||||
- **COM-001**: [Regulatory or compliance requirement] - [Impact on implementation]
|
||||
|
||||
**Note**: This section should focus on architectural and business dependencies, not specific package implementations. For example, specify "OAuth 2.0 authentication library" rather than "Microsoft.AspNetCore.Authentication.JwtBearer v6.0.1".
|
||||
|
||||
## 9. Examples & Edge Cases
|
||||
|
||||
```code
|
||||
// Code snippet or data example demonstrating the correct application of the guidelines, including edge cases
|
||||
```
|
||||
|
||||
## 10. Validation Criteria
|
||||
|
||||
[List the criteria or tests that must be satisfied for compliance with this specification.]
|
||||
|
||||
## 11. Related Specifications / Further Reading
|
||||
|
||||
[Link to related spec 1]
|
||||
[Link to relevant external documentation]
|
||||
|
||||
```
|
||||
@@ -1,240 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '[0-9]+.[0-9]+.[0-9]+'
|
||||
branches:
|
||||
- dev
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write # for npm publish
|
||||
actions: read # for Nerivec/action-ci-bench
|
||||
pull-requests: write # for Nerivec/action-ci-bench
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push'
|
||||
with:
|
||||
# Required for `release: merge dev -> master and promote dev`
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- uses: actions/checkout@v7
|
||||
if: ((github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push') == false
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile
|
||||
|
||||
- name: Check
|
||||
run: pnpm run check
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
|
||||
- name: Test
|
||||
run: pnpm run test:coverage
|
||||
|
||||
- name: Bench
|
||||
if: github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release-please-'))
|
||||
uses: Nerivec/action-ci-bench@main
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
compare-against: dev
|
||||
base-cmd: npx vitest bench --run --config ./test/vitest.config.mts --outputJson bench.json
|
||||
compare-cmd: npx vitest bench --run --config ./test/vitest.config.mts --compare bench.json
|
||||
base-result: bench.json
|
||||
|
||||
- name: Log in to the Docker container registry
|
||||
if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push'
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: koenkk
|
||||
password: ${{ secrets.DOCKER_KEY }}
|
||||
|
||||
- name: Log in to the GitHub container registry
|
||||
if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push'
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: koenkk
|
||||
password: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- name: Docker setup - QEMU
|
||||
if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push'
|
||||
uses: docker/setup-qemu-action@v4
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: Docker setup - Buildx
|
||||
if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push'
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: dev - Docker build and push
|
||||
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
platforms: linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/riscv64,linux/386
|
||||
tags: koenkk/zigbee2mqtt:latest-dev,ghcr.io/koenkk/zigbee2mqtt:latest-dev
|
||||
push: true
|
||||
build-args: |
|
||||
COMMIT=${{ github.sha }}
|
||||
VERSION=dev
|
||||
DATE=${{ github.event.repository.updated_at }}
|
||||
|
||||
- name: dev - Publish types
|
||||
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
|
||||
run: |
|
||||
pnpm run build:types
|
||||
temp_dir=$(mktemp -d)
|
||||
cp -R package.json LICENSE dist $temp_dir
|
||||
git fetch --unshallow
|
||||
git checkout dev-types
|
||||
rm -rf *
|
||||
cp -R $temp_dir/* .
|
||||
# remove unnecessary dependencies
|
||||
KEEP_DEPS='["zigbee-herdsman","zigbee-herdsman-converters"]'
|
||||
tmp_pkg=$(mktemp)
|
||||
jq --indent 4 --argjson keep "$KEEP_DEPS" 'def filterDeps: (. // {}) | with_entries(select(.key as $k | $keep | index($k))); .dependencies |= filterDeps | .devDependencies |= filterDeps | .optionalDependencies |= filterDeps' package.json > "$tmp_pkg"
|
||||
mv "$tmp_pkg" package.json
|
||||
git add -A
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git commit -m "$GITHUB_SHA" || echo 'Nothing to commit'
|
||||
git push --force --set-upstream origin dev-types
|
||||
|
||||
- name: release - Docker meta
|
||||
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
||||
uses: docker/metadata-action@v6
|
||||
id: meta
|
||||
with:
|
||||
images: |
|
||||
koenkk/zigbee2mqtt
|
||||
ghcr.io/koenkk/zigbee2mqtt
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
||||
- name: release - Docker build and push
|
||||
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
platforms: linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/riscv64,linux/386
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
push: true
|
||||
build-args: |
|
||||
COMMIT=${{ github.sha }}
|
||||
VERSION=${{ github.ref_name }}
|
||||
DATE=${{ github.event.repository.updated_at }}
|
||||
|
||||
- name: 'release: Publish to npm'
|
||||
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
||||
run: pnpm publish --no-git-checks
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
|
||||
- name: 'dev: Trigger zigbee2mqtt/hassio-zigbee2mqtt build'
|
||||
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
|
||||
run: |
|
||||
curl \
|
||||
-X POST \
|
||||
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
https://api.github.com/repos/zigbee2mqtt/hassio-zigbee2mqtt/actions/workflows/ci.yml/dispatches \
|
||||
-d '{"ref":"master","inputs":{}}'
|
||||
|
||||
- name: 'release: Trigger zigbee2mqtt/hassio-zigbee2mqtt build'
|
||||
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/*/}
|
||||
echo "Triggering with tag '$TAG'"
|
||||
curl \
|
||||
-X POST \
|
||||
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github.everest-preview+json" \
|
||||
-H "Content-Type: application/json" \
|
||||
https://api.github.com/repos/zigbee2mqtt/hassio-zigbee2mqtt/dispatches \
|
||||
--data "{\"event_type\": \"release\", \"client_payload\": { \"version\": \"$TAG-1\"}}"
|
||||
|
||||
- name: 'release: Trigger zigbee2mqtt-chart image update'
|
||||
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/*/}
|
||||
echo "Triggering with tag '$TAG'"
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/Koenkk/zigbee2mqtt-chart/actions/workflows/on_zigbee2mqtt_release.yaml/dispatches \
|
||||
--data "{\"ref\": \"main\", \"inputs\": { \"zigbee2mqtt_version\": \"$TAG\"}}"
|
||||
|
||||
- name: 'release: merge dev -> master and promote dev'
|
||||
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/*/}
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git fetch --unshallow
|
||||
git fetch origin
|
||||
git checkout master
|
||||
git merge --ff-only origin/dev
|
||||
git push origin master
|
||||
git checkout dev
|
||||
jq --indent 4 ".version = \"$TAG-dev\"" package.json > package.json.tmp
|
||||
mv package.json.tmp package.json
|
||||
git add -A
|
||||
git commit -m "chore: promote to dev"
|
||||
git push origin dev
|
||||
|
||||
tests:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: [22, 24, 26]
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
# --ignore-scripts prevents build on Windows (only for unix-dgram, so doesn't matter, others have pre-builds)
|
||||
run: pnpm i --frozen-lockfile ${{ matrix.os == 'windows-latest' && '--ignore-scripts' || '' }}
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
|
||||
- name: Test
|
||||
run: pnpm run test:coverage
|
||||
@@ -1,15 +0,0 @@
|
||||
name: Dependency review
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout repository'
|
||||
uses: actions/checkout@v7
|
||||
- name: 'Dependency review'
|
||||
uses: actions/dependency-review-action@v5
|
||||
@@ -1,21 +0,0 @@
|
||||
name: Fail PR to master
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
fail-pr-to-master:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fail PR to master
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
run: |
|
||||
if [[ "$PR_TITLE" == "chore(dev): release"* ]]; then
|
||||
echo "PR title starts with 'chore(dev): release', allowing PR"
|
||||
else
|
||||
echo "Pull requests to the master branch are not allowed, target dev branch"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,34 +0,0 @@
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
name: GHCR cleanup
|
||||
|
||||
permissions: {}
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Delete untagged images
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN }}
|
||||
script: |
|
||||
const response = await github.request("GET /${{ env.OWNER }}/packages/container/${{ env.PACKAGE_NAME }}/versions",
|
||||
{ per_page: ${{ env.PER_PAGE }}
|
||||
});
|
||||
for(version of response.data) {
|
||||
if (version.metadata.container.tags.length == 0) {
|
||||
try {
|
||||
console.log("delete " + version.id)
|
||||
const deleteResponse = await github.request("DELETE /${{ env.OWNER }}/packages/container/${{ env.PACKAGE_NAME }}/versions/" + version.id, { });
|
||||
console.log("status " + deleteResponse.status)
|
||||
} catch (e) {
|
||||
console.log("failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
env:
|
||||
OWNER: user
|
||||
PACKAGE_NAME: zigbee2mqtt
|
||||
PER_PAGE: 2000
|
||||
@@ -1,38 +0,0 @@
|
||||
name: Issue Bot
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
contains(github.event.issue.labels.*.name, 'new device support') ||
|
||||
contains(github.event.issue.labels.*.name, 'external converter') ||
|
||||
startsWith(github.event.issue.title, '[New device support]') ||
|
||||
startsWith(github.event.issue.title, '[External Converter]')
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
sparse-checkout: |
|
||||
scripts
|
||||
path: z2m
|
||||
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
repository: Koenkk/zigbee-herdsman-converters
|
||||
ref: master
|
||||
fetch-depth: 1
|
||||
path: zhc
|
||||
|
||||
- name: Comment on new device support/external converter issue
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
const {newDeviceSupport} = await import("${{ github.workspace }}/z2m/scripts/issueBot.mjs")
|
||||
await newDeviceSupport(github, core, context, "${{ github.workspace }}/zhc")
|
||||
@@ -1,19 +0,0 @@
|
||||
name: Merge master to dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
merge-master-to-dev:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: devmasx/merge-branch@master
|
||||
with:
|
||||
type: now
|
||||
head_to_merge: master
|
||||
target_branch: dev
|
||||
message: 'chore: merge master to dev'
|
||||
github_token: ${{ secrets.GH_TOKEN }}
|
||||
@@ -1,74 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
name: Release Please
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_created: ${{ steps.release.outputs.release_created }}
|
||||
version: '${{steps.release.outputs.major}}.${{steps.release.outputs.minor}}.${{steps.release.outputs.patch}}'
|
||||
steps:
|
||||
- uses: pnpm/action-setup@v6
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- uses: googleapis/release-please-action@v5
|
||||
id: release
|
||||
with:
|
||||
target-branch: dev
|
||||
token: ${{secrets.GH_TOKEN}}
|
||||
|
||||
# Checkout repos
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
repository: koenkk/zigbee2mqtt
|
||||
path: ./z2m
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
repository: koenkk/zigbee2mqtt
|
||||
path: ./z2m-master
|
||||
ref: master
|
||||
|
||||
- name: Restore cache commit-user-lookup.json
|
||||
uses: actions/cache/restore@v6
|
||||
with:
|
||||
path: z2m/scripts/commit-user-lookup.json
|
||||
key: commit-user-lookup-dummy
|
||||
restore-keys: |
|
||||
commit-user-lookup-
|
||||
- name: Generate changelog
|
||||
run: |
|
||||
MASTER_Z2M_VERSION=$(cat z2m-master/package.json | jq -r '.version')
|
||||
MASTER_ZHC_VERSION=$(cat z2m-master/package.json | jq -r '.dependencies."zigbee-herdsman-converters"')
|
||||
MASTER_ZH_VERSION=$(cat z2m-master/package.json | jq -r '.dependencies."zigbee-herdsman"')
|
||||
MASTER_FRONTEND_VERSION=$(cat z2m-master/package.json | jq -r '.dependencies."zigbee2mqtt-frontend"')
|
||||
MASTER_WINDFRONT_VERSION=$(cat z2m-master/package.json | jq -r '.dependencies."zigbee2mqtt-windfront"')
|
||||
wget -q -O - https://raw.githubusercontent.com/Koenkk/zigbee2mqtt/release-please--branches--dev--components--zigbee2mqtt/CHANGELOG.md > z2m/CHANGELOG.md
|
||||
cd z2m
|
||||
pnpm i --frozen-lockfile
|
||||
node scripts/generateChangelog.mjs $MASTER_Z2M_VERSION $MASTER_ZHC_VERSION $MASTER_ZH_VERSION $MASTER_FRONTEND_VERSION $MASTER_WINDFRONT_VERSION >> ../changelog.md
|
||||
env:
|
||||
GH_TOKEN: ${{secrets.GH_TOKEN}}
|
||||
- name: Update changelog gist
|
||||
run: |
|
||||
gh gist edit bfd4c3d1725a2cccacc11d6ba51008ba -a changelog.md
|
||||
env:
|
||||
GH_TOKEN: ${{secrets.GH_TOKEN}}
|
||||
- name: Save cache commit-user-lookup.json
|
||||
uses: actions/cache/save@v6
|
||||
if: always()
|
||||
with:
|
||||
path: z2m/scripts/commit-user-lookup.json
|
||||
key: commit-user-lookup-${{ hashFiles('z2m/scripts/commit-user-lookup.json') }}
|
||||
@@ -1,20 +0,0 @@
|
||||
name: Stale
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v11
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
|
||||
stale-pr-message: 'This pull request is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
|
||||
days-before-stale: 60
|
||||
days-before-close: 7
|
||||
exempt-issue-labels: dont-stale,feature-request
|
||||
operations-per-run: 500
|
||||
@@ -1,39 +0,0 @@
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: update_dep
|
||||
|
||||
name: Update dependency
|
||||
|
||||
permissions: {}
|
||||
jobs:
|
||||
update-dependency:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: dev
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: pnpm/action-setup@v6
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
- run: |
|
||||
pnpm install ${{ github.event.client_payload.package }}@${{ github.event.client_payload.version }} --save-exact
|
||||
pnpm install --no-frozen-lockfile
|
||||
- uses: peter-evans/create-pull-request@v8
|
||||
id: cpr
|
||||
with:
|
||||
commit-message: 'fix(ignore): update ${{ github.event.client_payload.package }} to ${{ github.event.client_payload.version }}'
|
||||
branch: 'deps/${{ github.event.client_payload.package }}'
|
||||
title: 'fix(ignore): update ${{ github.event.client_payload.package }} to ${{ github.event.client_payload.version }}'
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
- run: sleep 5 # Otherwise pull request may not exist yet causing automerge to fail
|
||||
- run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}"
|
||||
if: steps.cpr.outputs.pull-request-operation == 'created'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Compiled source
|
||||
dist/*
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional pnpm cache directory
|
||||
.pnpm-store
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Build cache
|
||||
tsconfig.tsbuildinfo
|
||||
tsconfig.types.tsbuildinfo
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# MacOS indexing file
|
||||
.DS_Store
|
||||
|
||||
# IDE specific folders
|
||||
.idea
|
||||
.*.swp
|
||||
|
||||
# Ignore config
|
||||
data/*
|
||||
!data/configuration.example.yaml
|
||||
data-bench
|
||||
|
||||
# commit-user-lookup.json
|
||||
scripts/commit-user-lookup.json
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
#tests
|
||||
test
|
||||
coverage
|
||||
|
||||
#build tools
|
||||
.travis.yml
|
||||
.jenkins.yml
|
||||
.codeclimate.yml
|
||||
.github
|
||||
babel.config.js
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
#linters
|
||||
.jscsrc
|
||||
.jshintrc
|
||||
.eslintrc*
|
||||
.dockerignore
|
||||
.eslintignore
|
||||
.gitignore
|
||||
|
||||
#editor settings
|
||||
.vscode
|
||||
|
||||
#src
|
||||
lib
|
||||
docs
|
||||
docker
|
||||
images
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
".": "2.13.0"
|
||||
}
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"recommendations": ["biomejs.biome", "vitest.explorer"]
|
||||
}
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"editor.defaultFormatter": "biomejs.biome",
|
||||
"notebook.defaultFormatter": "biomejs.biome",
|
||||
"editor.tabSize": 4,
|
||||
"editor.insertSpaces": true,
|
||||
"files.defaultLanguage": "typescript",
|
||||
"files.eol": "\n",
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
}
|
||||
}
|
||||
@@ -1,386 +0,0 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Project Overview
|
||||
|
||||
Zigbee2MQTT is a Zigbee to MQTT bridge that allows you to use your Zigbee devices without the vendor's bridge or gateway. It bridges events and allows you to control Zigbee devices via MQTT, integrating them with any smart home infrastructure.
|
||||
|
||||
### Architecture
|
||||
|
||||
- **Language**: TypeScript 5.9.3 compiled to JavaScript (ES modules with NodeNext resolution)
|
||||
- **Runtime**: Node.js (versions 20, 22, or 24)
|
||||
- **Package Manager**: pnpm 10.12.1 (strictly enforced via `packageManager` field)
|
||||
- **Core Dependencies**:
|
||||
- `zigbee-herdsman` (6.2.0 - exact version, handles Zigbee adapter communication)
|
||||
- `zigbee-herdsman-converters` (25.42.0 - exact version, device definitions)
|
||||
- `mqtt` (5.14.1 - MQTT client)
|
||||
- `winston` (3.18.3 - logging)
|
||||
|
||||
### Project Structure
|
||||
|
||||
```
|
||||
lib/ # TypeScript source code
|
||||
├── controller.ts # Main controller orchestrating components
|
||||
├── mqtt.ts # MQTT client management
|
||||
├── zigbee.ts # Zigbee network management
|
||||
├── state.ts # State management
|
||||
├── eventBus.ts # Event-driven communication
|
||||
├── extension/ # Extension system (plugins)
|
||||
│ └── extension.ts # Abstract base class
|
||||
├── model/ # Domain models (Device, Group)
|
||||
├── util/ # Utility functions
|
||||
└── types/ # TypeScript type definitions
|
||||
test/ # Vitest test files with mocks
|
||||
data/ # Runtime configuration and database
|
||||
dist/ # Compiled JavaScript output
|
||||
```
|
||||
|
||||
## Setup Commands
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Node.js version 20, 22, or 24
|
||||
- pnpm 10.12.1 (will be auto-installed via corepack if not present)
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
# Install dependencies (uses pnpm lockfile)
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
# For development without lockfile restrictions
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Initial Build
|
||||
|
||||
```bash
|
||||
# Full build (TypeScript compilation + hash generation)
|
||||
pnpm run build
|
||||
|
||||
# Build type definitions only
|
||||
pnpm run build:types
|
||||
```
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Starting Development
|
||||
|
||||
```bash
|
||||
# Watch mode - recompile on file changes
|
||||
pnpm run build:watch
|
||||
|
||||
# In another terminal, start Zigbee2MQTT
|
||||
pnpm start
|
||||
```
|
||||
|
||||
### Code Quality Checks
|
||||
|
||||
```bash
|
||||
# Run Biome linter and formatter (check only)
|
||||
pnpm run check
|
||||
|
||||
# Auto-fix linting and formatting issues
|
||||
pnpm run check:w
|
||||
|
||||
# The check runs with --error-on-warnings flag
|
||||
# Configuration: biome.json (4-space indent, 150 line width, no bracket spacing)
|
||||
```
|
||||
|
||||
### Clean Build
|
||||
|
||||
```bash
|
||||
# Remove build artifacts
|
||||
pnpm run clean
|
||||
|
||||
# Removes: coverage/, dist/, tsconfig.tsbuildinfo
|
||||
```
|
||||
|
||||
## Testing Instructions
|
||||
|
||||
### Running Tests
|
||||
|
||||
```bash
|
||||
# Run all tests once
|
||||
pnpm test
|
||||
|
||||
# Run tests with coverage report
|
||||
pnpm run test:coverage
|
||||
|
||||
# Watch mode - re-run tests on changes
|
||||
pnpm run test:watch
|
||||
|
||||
# Run benchmarks
|
||||
pnpm run bench
|
||||
```
|
||||
|
||||
### Test Requirements
|
||||
|
||||
- **Coverage**: 100% code coverage is enforced (configured in `test/vitest.config.mts`)
|
||||
- **Framework**: Vitest 3.1.1 with @vitest/coverage-v8
|
||||
- **Test Files**: Located in `test/` directory with `.test.ts` extension
|
||||
- **Mocks**: Centralized in `test/mocks/` directory
|
||||
- **Coverage Report**: Generated in `coverage/` directory (HTML report at `coverage/index.html`)
|
||||
|
||||
### Running Specific Tests
|
||||
|
||||
```bash
|
||||
# Run tests matching a pattern
|
||||
pnpm vitest run -t "test name pattern" --config ./test/vitest.config.mts
|
||||
|
||||
# Run specific test file
|
||||
pnpm vitest run test/controller.test.ts --config ./test/vitest.config.mts
|
||||
|
||||
# Focus on one test area in watch mode
|
||||
pnpm vitest watch -t "Extension" --config ./test/vitest.config.mts
|
||||
```
|
||||
|
||||
## Code Style Guidelines
|
||||
|
||||
### TypeScript Conventions
|
||||
|
||||
- **Module System**: ES modules with NodeNext resolution
|
||||
- **Target**: ESNext
|
||||
- **Strict Mode**: Enabled (`noImplicitAny`, `noImplicitThis`)
|
||||
- **Decorators**: Experimental decorators enabled (used for `@bind` from `bind-decorator`)
|
||||
|
||||
### Import Order
|
||||
|
||||
1. Node.js built-in modules (with `node:` prefix)
|
||||
2. Third-party libraries
|
||||
3. Type-only imports from external packages (using `type` keyword)
|
||||
4. Internal absolute imports
|
||||
5. Type-only imports from internal modules
|
||||
|
||||
Example:
|
||||
```typescript
|
||||
import fs from "node:fs";
|
||||
import bind from "bind-decorator";
|
||||
import type {IClientOptions} from "mqtt";
|
||||
import {connectAsync} from "mqtt";
|
||||
import type {Zigbee2MQTTAPI} from "./types/api";
|
||||
import logger from "./util/logger";
|
||||
```
|
||||
|
||||
### Naming Conventions
|
||||
|
||||
- **Classes**: PascalCase (e.g., `Extension`, `Device`)
|
||||
- **Functions/Methods**: camelCase (e.g., `publishEntityState`)
|
||||
- **Constants**: SCREAMING_SNAKE_CASE (e.g., `CURRENT_VERSION`)
|
||||
- **Interfaces/Types**: PascalCase (e.g., `MqttPublishOptions`)
|
||||
- **Files**: camelCase for TypeScript (e.g., `eventBus.ts`)
|
||||
|
||||
### Code Patterns
|
||||
|
||||
- **Async/Await**: Always use async/await, explicitly type return as `Promise<Type>`
|
||||
- **Error Handling**: Use `throw new Error("message")`, log with winston logger
|
||||
- **Event Handlers**: Use `@bind` decorator to preserve `this` context
|
||||
- **Logging**: Use `logger.info()`, `logger.warning()`, `logger.error()`, `logger.debug()`
|
||||
|
||||
### Formatting Rules (Biome)
|
||||
|
||||
- 4-space indentation
|
||||
- 150 character line width
|
||||
- No bracket spacing in objects
|
||||
- Run `pnpm run check:w` to auto-format
|
||||
|
||||
## Build and Deployment
|
||||
|
||||
### Build Process
|
||||
|
||||
```bash
|
||||
# Production build
|
||||
pnpm run build
|
||||
|
||||
# Outputs:
|
||||
# - Compiled JavaScript in dist/
|
||||
# - Type definitions in dist/types/
|
||||
# - Includes hash generation for version tracking
|
||||
```
|
||||
|
||||
### Pre-publish
|
||||
|
||||
```bash
|
||||
# Automatically runs before publishing
|
||||
pnpm run prepack
|
||||
|
||||
# Performs: clean + build
|
||||
```
|
||||
|
||||
### Environment Setup
|
||||
|
||||
- Configuration stored in `data/configuration.yaml`
|
||||
- Database in `data/database.db`
|
||||
- Logs in `data/log/`
|
||||
- External extensions in `data/external_extensions/`
|
||||
- External converters in `data/external_converters/`
|
||||
|
||||
## Architecture Patterns
|
||||
|
||||
### Extension System
|
||||
|
||||
All features are implemented as extensions that inherit from the abstract `Extension` base class:
|
||||
|
||||
```typescript
|
||||
abstract class Extension {
|
||||
protected zigbee: Zigbee;
|
||||
protected mqtt: Mqtt;
|
||||
protected state: State;
|
||||
protected publishEntityState: PublishEntityState;
|
||||
protected eventBus: EventBus;
|
||||
|
||||
async start(): Promise<void> {} // Initialize extension
|
||||
async stop(): Promise<void> {} // Cleanup extension
|
||||
}
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- Constructor should only assign properties (no side effects)
|
||||
- Initialization happens in `start()` method
|
||||
- Use EventBus for inter-component communication
|
||||
- Extensions are loaded and managed by the Controller
|
||||
|
||||
### Event-Driven Communication
|
||||
|
||||
Components communicate via the strongly-typed EventBus:
|
||||
|
||||
```typescript
|
||||
// Emit events
|
||||
this.eventBus.emit('deviceMessage', {device, message});
|
||||
|
||||
// Listen to events
|
||||
this.eventBus.on('deviceMessage', this.onDeviceMessage, this);
|
||||
```
|
||||
|
||||
### Dependency Injection
|
||||
|
||||
The Controller instantiates and injects dependencies into all extensions. Follow this pattern when creating new extensions.
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
### Target Branch
|
||||
|
||||
- **Always create PRs against the `dev` branch**
|
||||
- The `master` branch is for production releases only
|
||||
|
||||
### Before Submitting
|
||||
|
||||
```bash
|
||||
# Run all checks
|
||||
pnpm run check
|
||||
pnpm test
|
||||
|
||||
# Ensure 100% code coverage
|
||||
pnpm run test:coverage
|
||||
|
||||
# Build successfully
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
### PR Requirements
|
||||
|
||||
- All CI checks must pass (linting, tests, build)
|
||||
- 100% test coverage maintained
|
||||
- Code follows Biome formatting rules
|
||||
- Commit messages should be descriptive
|
||||
- Reference related issues when applicable
|
||||
|
||||
### CI Pipeline
|
||||
|
||||
The GitHub Actions CI workflow (`.github/workflows/ci.yml`) runs:
|
||||
1. Biome code quality checks (`pnpm run check`)
|
||||
2. TypeScript compilation (`pnpm run build`)
|
||||
3. Full test suite with coverage (`pnpm run test:coverage`)
|
||||
4. Benchmarks (on dev branch and PRs)
|
||||
5. Docker image builds (on dev branch and tags)
|
||||
|
||||
## Working with Device Support
|
||||
|
||||
### Adding New Devices
|
||||
|
||||
**Important**: Device support is NOT added to this repository. All device definitions live in `zigbee-herdsman-converters`.
|
||||
|
||||
- Follow the guide at: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
|
||||
- No changes to zigbee2mqtt codebase are needed for new devices
|
||||
- Device definitions are automatically picked up from `zigbee-herdsman-converters`
|
||||
|
||||
## Debugging and Troubleshooting
|
||||
|
||||
### Development Setup
|
||||
|
||||
For the easiest development experience, set up a bare-metal installation following:
|
||||
https://www.zigbee2mqtt.io/guide/installation/01_linux.html
|
||||
|
||||
### Logging
|
||||
|
||||
- Winston logger is initialized in `lib/util/logger.ts`
|
||||
- Log levels: `error`, `warning`, `info`, `debug`
|
||||
- Logs are written to console and/or file based on configuration
|
||||
- Use structured logging with context (device names, IEEE addresses)
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Import errors after file moves**: Run `pnpm run check` to verify TypeScript and ESLint
|
||||
2. **Test failures**: Check if mocks in `test/mocks/` need updates
|
||||
3. **Build errors**: Ensure Node.js version is 20, 22, or 24
|
||||
4. **Coverage issues**: View HTML report at `coverage/index.html` to identify uncovered code
|
||||
|
||||
### Performance Considerations
|
||||
|
||||
- Use `fs.rmSync(path, {recursive: true, force: true})` for synchronous file operations
|
||||
- Leverage async/await to avoid blocking
|
||||
- Cache computed values in getters when appropriate
|
||||
- EventBus provides loose coupling between components
|
||||
|
||||
## Critical Version Requirements
|
||||
|
||||
### Exact Versions
|
||||
|
||||
These dependencies use **exact versions** (no semver ranges) - do not upgrade without thorough testing:
|
||||
|
||||
- `zigbee-herdsman@6.2.0` - Critical for Zigbee protocol compatibility
|
||||
- `zigbee-herdsman-converters@25.42.0` - Device definitions must match herdsman version
|
||||
|
||||
### Node.js Compatibility
|
||||
|
||||
Only these Node.js versions are supported:
|
||||
- Node.js 20.x
|
||||
- Node.js 22.x
|
||||
- Node.js 24.x
|
||||
|
||||
Using other versions may cause runtime errors or incompatibilities.
|
||||
|
||||
## Additional Notes
|
||||
|
||||
### Package Manager
|
||||
|
||||
This project **requires pnpm 10.12.1**. The `packageManager` field in package.json enforces this via Corepack.
|
||||
|
||||
Do not use npm or yarn - they will not respect the pnpm-specific configuration.
|
||||
|
||||
### TypeScript Compilation
|
||||
|
||||
- Source files in `lib/` are compiled to `dist/`
|
||||
- Type definitions exported from `dist/types/api.d.ts`
|
||||
- Source maps are inlined for debugging
|
||||
- Uses composite project references for faster incremental builds
|
||||
|
||||
### External Extensions
|
||||
|
||||
To load external extensions:
|
||||
1. Place JavaScript files in `data/external_extensions/`
|
||||
2. They will be automatically loaded on startup
|
||||
3. No configuration changes needed
|
||||
|
||||
### Code Quality Tools
|
||||
|
||||
- **Linting/Formatting**: Biome 2.2.5 (replaces ESLint + Prettier)
|
||||
- **Type Checking**: TypeScript 5.9.3
|
||||
- **Testing**: Vitest 3.1.1
|
||||
- **Coverage**: @vitest/coverage-v8
|
||||
|
||||
### Documentation
|
||||
|
||||
- Main documentation: https://www.zigbee2mqtt.io/
|
||||
- Contributing guide: `CONTRIBUTING.md`
|
||||
- Coding standards: `.github/copilot-instructions.md`
|
||||
- Issue tracker: https://github.com/Koenkk/zigbee2mqtt/issues
|
||||
-2030
File diff suppressed because it is too large
Load Diff
@@ -1,131 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
|
||||
at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
@@ -1,14 +0,0 @@
|
||||
# Contributing to Zigbee2MQTT
|
||||
|
||||
> [!WARNING]
|
||||
> Any AI-driven pull request with more than 500 lines of code will not be considered. If wanting to submit something that requires more, split the work into easily review-able pull requests that can be introduced in increments (e.g. pre-refactor, base feature, additional features).
|
||||
|
||||
Everybody is invited and welcomed to contribute to Zigbee2MQTT.
|
||||
Zigbee2MQTT is written in TypeScript.
|
||||
It uses [zigbee-herdsman](https://github.com/koenkk/zigbee-herdsman) for communication with the adapter/coordinator and [zigbee-herdsman-converters](https://github.com/koenkk/zigbee-herdsman-converters) to provide device-specific definitions.
|
||||
|
||||
- Pull requests are always created against the [**dev**](https://github.com/Koenkk/zigbee2mqtt/tree/dev) branch.
|
||||
- Easiest way to start developing Zigbee2MQTT is by setting up a development environment (a.k.a. bare-metal installation). You can follow this [guide](https://www.zigbee2mqtt.io/guide/installation/01_linux.html) to do this.
|
||||
- You can run the tests locally by executing `pnpm test`. Zigbee2MQTT enforces 100% code coverage, in case you add new code check if your code is covered by running `pnpm run test:coverage`. The coverage report can be found under `coverage/lcov-report/index.html`.
|
||||
- Linting & formatting is also enforced and can be run with `pnpm run check` (can use `pnpm run check:w` to fix small issues automatically).
|
||||
- If you want to add support for a new device no change to Zigbee2MQTT has to be made, only to zigbee-herdsman-converters. You can find a guide for it [here](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html).
|
||||
@@ -1,122 +0,0 @@
|
||||
<div align="center">
|
||||
<a href="https://github.com/koenkk/zigbee2mqtt">
|
||||
<img width="150" height="150" src="images/logo.png">
|
||||
</a>
|
||||
<br>
|
||||
<br>
|
||||
<div style="display: flex;">
|
||||
<a href="https://github.com/Koenkk/zigbee2mqtt/releases">
|
||||
<img src="https://img.shields.io/github/release/koenkk/zigbee2mqtt.svg">
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/zigbee2mqtt">
|
||||
<img src="https://img.shields.io/npm/v/zigbee2mqtt">
|
||||
</a>
|
||||
<a href="https://github.com/Koenkk/zigbee2mqtt/actions/workflows/ci.yml">
|
||||
<img src="https://github.com/Koenkk/zigbee2mqtt/actions/workflows/ci.yml/badge.svg">
|
||||
</a>
|
||||
<a href="https://github.com/Koenkk/zigbee2mqtt/actions/workflows/github-code-scanning/codeql">
|
||||
<img src="https://github.com/Koenkk/zigbee2mqtt/actions/workflows/github-code-scanning/codeql/badge.svg">
|
||||
</a>
|
||||
<a href="https://discord.gg/dadfWYE">
|
||||
<img src="https://img.shields.io/discord/556563650429583360.svg">
|
||||
</a>
|
||||
<a href="https://github.com/Koenkk/zigbee2mqtt/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/koenkk/zigbee2mqtt.svg">
|
||||
</a>
|
||||
<a href="https://www.paypal.me/koenkk">
|
||||
<img src="https://img.shields.io/badge/donate-PayPal-blue.svg">
|
||||
</a>
|
||||
</div>
|
||||
<h1>Zigbee2MQTT 🌉 🐝</h1>
|
||||
<p>
|
||||
Allows you to use your Zigbee devices <b>without</b> the vendor's bridge or gateway.
|
||||
</p>
|
||||
<p>
|
||||
It bridges events and allows you to control your Zigbee devices via MQTT. In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## [Getting started](https://www.zigbee2mqtt.io/guide/getting-started)
|
||||
|
||||
The [documentation](https://www.zigbee2mqtt.io/) provides you all the information needed to get up and running! Make sure you don't skip sections if this is your first visit, as there might be important details in there for you.
|
||||
|
||||
If you aren't familiar with **Zigbee** terminology make sure you [read this](https://www.zigbee2mqtt.io/advanced/zigbee/01_zigbee_network.html) to help you out.
|
||||
|
||||
## [Integrations](https://www.zigbee2mqtt.io/guide/usage/integrations.html)
|
||||
|
||||
Zigbee2MQTT integrates well with (almost) every home automation solution because it uses MQTT. However the following integrations are worth mentioning:
|
||||
|
||||
### [Home Assistant](https://www.home-assistant.io/)
|
||||
|
||||
<a href="https://www.home-assistant.io/"><img align="left" src="https://avatars.githubusercontent.com/u/13844975?s=75" style="padding-right: 20px;" alt="Home Assistant"></a>
|
||||
|
||||
<br clear="right">
|
||||
|
||||
[Home Assistant OS](https://www.home-assistant.io/installation/) using [the official addon](https://github.com/zigbee2mqtt/hassio-zigbee2mqtt) ([other installations](https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html))
|
||||
|
||||
<br clear="both">
|
||||
|
||||
### [Homey](https://homey.app/)
|
||||
|
||||
<a href="https://homey.app/"><img align="left" src="https://avatars.githubusercontent.com/u/8502422?s=75" style="padding-right: 20px;" alt="Homey"></a>
|
||||
|
||||
<br clear="right">
|
||||
|
||||
Integration implemented in the [Homey App](https://homey.app/nl-nl/app/com.gruijter.zigbee2mqtt/) ([documentation & support](https://community.homey.app/t/83214))
|
||||
|
||||
<br clear="both">
|
||||
|
||||
### [Domoticz](https://www.domoticz.com/)
|
||||
|
||||
<a href="https://www.domoticz.com/"><img align="left" src="https://avatars.githubusercontent.com/u/6067010?s=75" style="padding-right: 20px;" alt="Domoticz"></a>
|
||||
|
||||
<br clear="right">
|
||||
|
||||
Integration implemented in Domoticz ([documentation](https://www.domoticz.com/wiki/Zigbee2MQTT)).
|
||||
|
||||
<br clear="both">
|
||||
|
||||
### [Gladys Assistant](https://gladysassistant.com/)
|
||||
|
||||
<a href="https://gladysassistant.com/"><img align="left" src="https://avatars.githubusercontent.com/u/7365162?s=75" style="padding-right: 20px;" alt="Gladys Assistant"></a>
|
||||
|
||||
<br clear="right">
|
||||
|
||||
Integration implemented natively in Gladys Assistant ([documentation](https://gladysassistant.com/docs/integrations/zigbee2mqtt/)).
|
||||
|
||||
<br clear="both">
|
||||
|
||||
### [ioBroker](https://www.iobroker.net/)
|
||||
|
||||
<a href="https://www.iobroker.net/"><img align="left" src="https://avatars.githubusercontent.com/u/7231148?s=75" style="padding-right: 20px;" alt="ioBroker"></a>
|
||||
|
||||
<br clear="right">
|
||||
|
||||
Integration implemented in ioBroker ([documentation](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt)).
|
||||
|
||||
<br clear="both">
|
||||
|
||||
## Architecture
|
||||
|
||||

|
||||
|
||||
### Internal Architecture
|
||||
|
||||
Zigbee2MQTT is made up of three modules, each developed in its own Github project. Starting from the hardware (adapter) and moving up; [zigbee-herdsman](https://github.com/koenkk/zigbee-herdsman) connects to your adapter to handle Zigbee communication and makes an API available to the higher levels of the stack. For e.g. Texas Instruments hardware, zigbee-herdsman uses the [TI zStack monitoring and test API](https://github.com/Koenkk/zigbee-herdsman/wiki/References#texas-instruments-zstack) to communicate with the adapter. The module [zigbee-herdsman-converters](https://github.com/koenkk/zigbee-herdsman-converters) handles the mapping from individual device models to the Zigbee clusters they support. [Zigbee clusters](https://github.com/Koenkk/zigbee-herdsman/wiki/References#csa-zigbee-alliance-spec) are the layers of the Zigbee protocol on top of the base protocol that define things like how lights, sensors and switches talk to each other over the Zigbee network. Finally, the Zigbee2MQTT module drives zigbee-herdsman and maps the zigbee messages to MQTT messages. Zigbee2MQTT also keeps track of the state of the system. It uses a `database.db` file to store this state; a text file with a JSON database of connected devices and their capabilities. Zigbee2MQTT provides several web-based interfaces ([zigbee2mqtt-frontend](https://github.com/nurikk/zigbee2mqtt-frontend), [zigbee2mqtt-windfront](https://github.com/Nerivec/zigbee2mqtt-windfront)) that allows monitoring and configuration.
|
||||
|
||||
### Developing
|
||||
|
||||
Zigbee2MQTT uses TypeScript. Therefore after making changes to files in the `lib/` directory you need to recompile Zigbee2MQTT. This can be done by executing `pnpm run build`. For faster development instead of running `pnpm run build` you can run `pnpm run build:watch` in another terminal session, this will recompile as you change files.
|
||||
|
||||
Before running any of the commands, you'll first need to run `pnpm install --include=dev`.
|
||||
Before submitting changes run `pnpm run check:w` then `pnpm run test:coverage`.
|
||||
|
||||
## Supported devices
|
||||
|
||||
See [Supported devices](https://www.zigbee2mqtt.io/supported-devices) to check whether your device is supported. There is quite an extensive list, including devices from vendors like [Xiaomi](https://www.zigbee2mqtt.io/supported-devices/#v=Xiaomi), [Ikea](https://www.zigbee2mqtt.io/supported-devices/#v=IKEA), [Philips](https://www.zigbee2mqtt.io/supported-devices/#v=Philips), [OSRAM](https://www.zigbee2mqtt.io/supported-devices/#v=OSRAM) and more.
|
||||
|
||||
If it's not listed in [Supported devices](https://www.zigbee2mqtt.io/supported-devices), support can be added (fairly) easily, see [How to support new devices](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html).
|
||||
|
||||
## Support & help
|
||||
|
||||
If you need assistance you can check [opened issues](https://github.com/Koenkk/zigbee2mqtt/issues). Feel free to help with Pull Requests when you were able to fix things or add new devices or just share the love on social media.
|
||||
-99
@@ -1,99 +0,0 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.5.3/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": true
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 4,
|
||||
"lineWidth": 150,
|
||||
"bracketSpacing": false
|
||||
},
|
||||
"files": {
|
||||
"includes": ["**", "!package.json", "!!**/dist", "!!**/coverage", "!images"]
|
||||
},
|
||||
"linter": {
|
||||
"includes": ["**"],
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noUnusedImports": "error"
|
||||
},
|
||||
"style": {
|
||||
"noParameterAssign": "off",
|
||||
"useThrowNewError": "error",
|
||||
"useThrowOnlyError": "error",
|
||||
"useNamingConvention": {
|
||||
"level": "error",
|
||||
"options": {
|
||||
"strictCase": false,
|
||||
"conventions": [
|
||||
{
|
||||
"selector": {
|
||||
"kind": "objectLiteralProperty"
|
||||
},
|
||||
"formats": ["snake_case", "camelCase", "CONSTANT_CASE", "PascalCase"]
|
||||
},
|
||||
{
|
||||
"selector": {
|
||||
"kind": "const"
|
||||
},
|
||||
"formats": ["snake_case", "camelCase", "CONSTANT_CASE", "PascalCase"]
|
||||
},
|
||||
{
|
||||
"selector": {
|
||||
"kind": "typeProperty"
|
||||
},
|
||||
"formats": ["snake_case", "camelCase", "CONSTANT_CASE", "PascalCase"]
|
||||
},
|
||||
{
|
||||
"selector": {
|
||||
"kind": "enumMember"
|
||||
},
|
||||
"formats": ["CONSTANT_CASE", "PascalCase"]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"useAsConstAssertion": "error",
|
||||
"useDefaultParameterLast": "error",
|
||||
"useEnumInitializers": "error",
|
||||
"useSelfClosingElements": "error",
|
||||
"useSingleVarDeclarator": "error",
|
||||
"noUnusedTemplateLiteral": "error",
|
||||
"useNumberNamespace": "error",
|
||||
"noInferrableTypes": "error",
|
||||
"noUselessElse": "error"
|
||||
},
|
||||
"performance": {
|
||||
"noDelete": "off"
|
||||
},
|
||||
"suspicious": {
|
||||
"noConstEnum": "off",
|
||||
"useAwait": "error"
|
||||
},
|
||||
"nursery": {
|
||||
"useExhaustiveSwitchCases": "error",
|
||||
"noFloatingPromises": "error",
|
||||
"noMisusedPromises": "error"
|
||||
}
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"includes": ["test/**"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"style": {
|
||||
"noNonNullAssertion": "off",
|
||||
"useNamingConvention": "off"
|
||||
},
|
||||
"suspicious": {
|
||||
"noImplicitAnyLet": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
const path = require("node:path");
|
||||
process.env.ZIGBEE2MQTT_DATA = process.env.ZIGBEE2MQTT_DATA || path.join(process.env.HOME, ".z2m");
|
||||
require("./index");
|
||||
@@ -1,46 +0,0 @@
|
||||
# Indicates the configuration version (used by configuration migrations)
|
||||
version: 5
|
||||
|
||||
# Home Assistant integration (MQTT discovery)
|
||||
homeassistant:
|
||||
enabled: false
|
||||
|
||||
# Enable the frontend, runs on port 8080 by default
|
||||
frontend:
|
||||
enabled: true
|
||||
# port: 8080
|
||||
|
||||
# MQTT settings
|
||||
mqtt:
|
||||
# MQTT base topic for zigbee2mqtt MQTT messages
|
||||
base_topic: zigbee2mqtt
|
||||
# MQTT server URL
|
||||
server: "mqtt://localhost"
|
||||
# MQTT server authentication, uncomment if required:
|
||||
# user: my_user
|
||||
# password: my_password
|
||||
|
||||
# Serial settings, only required when Zigbee2MQTT fails to start with:
|
||||
# USB adapter discovery error (No valid USB adapter found).
|
||||
# Specify valid 'adapter' and 'port' in your configuration.
|
||||
# serial:
|
||||
# # Location of the adapter
|
||||
# # USB adapters - use format "port: /dev/serial/by-id/XXX"
|
||||
# # Ethernet adapters - use format "port: tcp://192.168.1.12:6638"
|
||||
# port: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0018ED3DDF-if00
|
||||
# # Adapter type, allowed values: `zstack`, `ember`, `deconz`, `zigate` or `zboss`
|
||||
# adapter: zstack
|
||||
|
||||
# Periodically check whether devices are online/offline
|
||||
# availability:
|
||||
# enabled: false
|
||||
|
||||
# Advanced settings
|
||||
advanced:
|
||||
# channel: 11
|
||||
# Let Zigbee2MQTT generate a network key on first start
|
||||
network_key: GENERATE
|
||||
# Let Zigbee2MQTT generate a pan_id on first start
|
||||
pan_id: GENERATE
|
||||
# Let Zigbee2MQTT generate a ext_pan_id on first start
|
||||
ext_pan_id: GENERATE
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
import EventBus from "./eventBus";
|
||||
import type Extension from "./extension/extension";
|
||||
import Mqtt, { type MqttPublishOptions } from "./mqtt";
|
||||
import State from "./state";
|
||||
import Zigbee from "./zigbee";
|
||||
export declare class Controller {
|
||||
#private;
|
||||
readonly eventBus: EventBus;
|
||||
readonly zigbee: Zigbee;
|
||||
readonly state: State;
|
||||
readonly mqtt: Mqtt;
|
||||
private restartCallback;
|
||||
private exitCallback;
|
||||
readonly extensions: Set<Extension>;
|
||||
readonly extensionArgs: ConstructorParameters<typeof Extension>;
|
||||
private sdNotify;
|
||||
constructor(restartCallback: () => Promise<void>, exitCallback: (code: number, restart: boolean) => Promise<void>);
|
||||
start(): Promise<void>;
|
||||
enableDisableExtension(enable: boolean, name: string): Promise<void>;
|
||||
getExtension(name: string): Extension | undefined;
|
||||
addExtension(extension: Extension): Promise<void>;
|
||||
removeExtension(extension: Extension): Promise<void>;
|
||||
private startExtension;
|
||||
private stopExtension;
|
||||
stop(restart?: boolean, code?: number, signal?: NodeJS.Signals | undefined): Promise<void>;
|
||||
exit(code: number, restart?: boolean): Promise<void>;
|
||||
publishEntityState(entity: Group | Device, payload: KeyValue, stateChangeReason?: StateChangeReason): Promise<void>;
|
||||
iteratePayloadAttributeOutput(topicRoot: string, payload: KeyValue, options: Partial<MqttPublishOptions>): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=controller.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../lib/controller.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAMlC,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAUnD,OAAO,IAAI,EAAE,EAAC,KAAK,kBAAkB,EAAC,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,MAAM,SAAS,CAAC;AAO5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,qBAAa,UAAU;;IAGnB,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IACnC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,SAAgB,IAAI,EAAE,IAAI,CAAC;IAC3B,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,YAAY,CAAoD;IACxE,SAAgB,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3C,SAAgB,aAAa,EAAE,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC;IACvE,OAAO,CAAC,QAAQ,CAA2C;IAE3D,YAAY,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,EA4ChH;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CA+H3B;IAEW,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkF/E;IAEM,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAMvD;IAEW,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAS5D;IAEK,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzD;YAEa,cAAc;YAQd,aAAa;IAQrB,IAAI,CAAC,OAAO,UAAQ,EAAE,IAAI,SAAI,EAAE,MAAM,GAAE,MAAM,CAAC,OAAO,GAAG,SAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCnG;IAEK,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvD;IAEW,kBAAkB,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8E9H;IAEK,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B7H;CACJ"}
|
||||
Vendored
+69
@@ -0,0 +1,69 @@
|
||||
type ListenerKey = object;
|
||||
type Stats = {
|
||||
devices: Map<string, // IEEE address
|
||||
{
|
||||
lastSeenChanges?: {
|
||||
messages: number;
|
||||
first: number;
|
||||
};
|
||||
leaveCounts: number;
|
||||
networkAddressChanges: number;
|
||||
}>;
|
||||
mqtt: {
|
||||
published: number;
|
||||
received: number;
|
||||
};
|
||||
};
|
||||
export default class EventBus {
|
||||
private callbacksByExtension;
|
||||
private emitter;
|
||||
readonly stats: Stats;
|
||||
constructor();
|
||||
emitAdapterDisconnected(): void;
|
||||
onAdapterDisconnected(key: ListenerKey, callback: () => Promise<void>): void;
|
||||
emitPermitJoinChanged(data: eventdata.PermitJoinChanged): void;
|
||||
onPermitJoinChanged(key: ListenerKey, callback: (data: eventdata.PermitJoinChanged) => void): void;
|
||||
emitEntityRenamed(data: eventdata.EntityRenamed): void;
|
||||
onEntityRenamed(key: ListenerKey, callback: (data: eventdata.EntityRenamed) => void): void;
|
||||
emitEntityRemoved(data: eventdata.EntityRemoved): void;
|
||||
onEntityRemoved(key: ListenerKey, callback: (data: eventdata.EntityRemoved) => void): void;
|
||||
emitLastSeenChanged(data: eventdata.LastSeenChanged): void;
|
||||
onLastSeenChanged(key: ListenerKey, callback: (data: eventdata.LastSeenChanged) => void): void;
|
||||
emitDeviceNetworkAddressChanged(data: eventdata.DeviceNetworkAddressChanged): void;
|
||||
onDeviceNetworkAddressChanged(key: ListenerKey, callback: (data: eventdata.DeviceNetworkAddressChanged) => void): void;
|
||||
emitDeviceAnnounce(data: eventdata.DeviceAnnounce): void;
|
||||
onDeviceAnnounce(key: ListenerKey, callback: (data: eventdata.DeviceAnnounce) => void): void;
|
||||
emitDeviceInterview(data: eventdata.DeviceInterview): void;
|
||||
onDeviceInterview(key: ListenerKey, callback: (data: eventdata.DeviceInterview) => void): void;
|
||||
emitDeviceJoined(data: eventdata.DeviceJoined): void;
|
||||
onDeviceJoined(key: ListenerKey, callback: (data: eventdata.DeviceJoined) => void): void;
|
||||
emitEntityOptionsChanged(data: eventdata.EntityOptionsChanged): void;
|
||||
onEntityOptionsChanged(key: ListenerKey, callback: (data: eventdata.EntityOptionsChanged) => void): void;
|
||||
emitExposesChanged(data: eventdata.ExposesChanged): void;
|
||||
onExposesChanged(key: ListenerKey, callback: (data: eventdata.ExposesChanged) => void): void;
|
||||
emitDeviceLeave(data: eventdata.DeviceLeave): void;
|
||||
onDeviceLeave(key: ListenerKey, callback: (data: eventdata.DeviceLeave) => void): void;
|
||||
emitDeviceMessage(data: eventdata.DeviceMessage): void;
|
||||
onDeviceMessage(key: ListenerKey, callback: (data: eventdata.DeviceMessage) => void): void;
|
||||
emitMQTTMessage(data: eventdata.MQTTMessage): void;
|
||||
onMQTTMessage(key: ListenerKey, callback: (data: eventdata.MQTTMessage) => void): void;
|
||||
emitMQTTMessagePublished(data: eventdata.MQTTMessagePublished): void;
|
||||
onMQTTMessagePublished(key: ListenerKey, callback: (data: eventdata.MQTTMessagePublished) => void): void;
|
||||
emitPublishEntityState(data: eventdata.PublishEntityState): void;
|
||||
onPublishEntityState(key: ListenerKey, callback: (data: eventdata.PublishEntityState) => void): void;
|
||||
emitGroupMembersChanged(data: eventdata.GroupMembersChanged): void;
|
||||
onGroupMembersChanged(key: ListenerKey, callback: (data: eventdata.GroupMembersChanged) => void): void;
|
||||
emitDevicesChanged(): void;
|
||||
onDevicesChanged(key: ListenerKey, callback: () => void): void;
|
||||
emitScenesChanged(data: eventdata.ScenesChanged): void;
|
||||
onScenesChanged(key: ListenerKey, callback: (data: eventdata.ScenesChanged) => void): void;
|
||||
emitReconfigure(data: eventdata.Reconfigure): void;
|
||||
onReconfigure(key: ListenerKey, callback: (data: eventdata.Reconfigure) => void): void;
|
||||
emitStateChange(data: eventdata.StateChange): void;
|
||||
onStateChange(key: ListenerKey, callback: (data: eventdata.StateChange) => void): void;
|
||||
emitExposesAndDevicesChanged(device: Device): void;
|
||||
private on;
|
||||
removeListeners(key: ListenerKey): void;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=eventBus.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../lib/eventBus.ts"],"names":[],"mappings":"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"}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
import Extension from "./extension";
|
||||
export default class Availability extends Extension {
|
||||
/** Mapped by IEEE address */
|
||||
private readonly timers;
|
||||
/** Mapped by IEEE address or Group ID */
|
||||
private readonly lastPublishedAvailabilities;
|
||||
/** Mapped by IEEE address */
|
||||
private readonly pingBackoffs;
|
||||
/** IEEE addresses, waiting for last seen changes to take them out of "availability sleep" */
|
||||
private readonly backoffPausedDevices;
|
||||
/** Mapped by IEEE address */
|
||||
private readonly retrieveStateDebouncers;
|
||||
private pingQueue;
|
||||
private pingQueueExecuting;
|
||||
private stopped;
|
||||
private getTimeout;
|
||||
private getMaxJitter;
|
||||
private getBackoff;
|
||||
private getPauseOnBackoffGt;
|
||||
private isActiveDevice;
|
||||
private isAvailable;
|
||||
private resetTimer;
|
||||
private clearTimer;
|
||||
private addToPingQueue;
|
||||
private removeFromPingQueue;
|
||||
private pingQueueExecuteNext;
|
||||
start(): Promise<void>;
|
||||
private publishAvailabilityForAllEntities;
|
||||
private publishAvailability;
|
||||
private onLastSeenChanged;
|
||||
stop(): Promise<void>;
|
||||
private retrieveState;
|
||||
}
|
||||
//# sourceMappingURL=availability.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../lib/extension/availability.ts"],"names":[],"mappings":"AASA,OAAO,SAAS,MAAM,aAAa,CAAC;AAcpC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS;IAC/C,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAuC;IACnF,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqB;IAC1D,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAiC;IACzE,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,UAAU;IAqClB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,mBAAmB;YAOb,oBAAoB;IA4DnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CA+BpC;YAEa,iCAAiC;YAQjC,mBAAmB;YAoCb,iBAAiB;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CASnC;IAED,OAAO,CAAC,aAAa;CAoDxB"}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import Extension from "./extension";
|
||||
export default class Bind extends Extension {
|
||||
#private;
|
||||
private pollDebouncers;
|
||||
start(): Promise<void>;
|
||||
private parseMQTTMessage;
|
||||
private onMQTTMessage;
|
||||
private publishResponse;
|
||||
onGroupMembersChanged(data: eventdata.GroupMembersChanged): Promise<void>;
|
||||
getSetupReportingEndpoints(bind: zh.Bind, coordinatorEp: zh.Endpoint): zh.Endpoint[];
|
||||
setupReporting(binds: zh.Bind[]): Promise<void>;
|
||||
disableUnnecessaryReportings(target: zh.Group | zh.Endpoint): Promise<void>;
|
||||
poll(data: eventdata.DeviceMessage): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=bind.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../lib/extension/bind.ts"],"names":[],"mappings":"AAaA,OAAO,SAAS,MAAM,aAAa,CAAC;AA4KpC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAS;;IAEvC,OAAO,CAAC,cAAc,CAAiC;IAGxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAIpC;IAED,OAAO,CAAC,gBAAgB;YAiFJ,aAAa;YA+InB,eAAe;IAcjB,qBAAqB,CAAC,IAAI,EAAE,SAAS,CAAC,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBpF;IAED,0BAA0B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAkBnF;IAEK,cAAc,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpD;IAEK,4BAA4B,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAqDhF;IAEW,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAwE7D;CACJ"}
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
import Device from "../model/device";
|
||||
import type Group from "../model/group";
|
||||
import type { Zigbee2MQTTDevice, Zigbee2MQTTResponse } from "../types/api";
|
||||
import Extension from "./extension";
|
||||
export default class Bridge extends Extension {
|
||||
#private;
|
||||
private zigbee2mqttVersion;
|
||||
private zigbeeHerdsmanVersion;
|
||||
private zigbeeHerdsmanConvertersVersion;
|
||||
private coordinatorVersion;
|
||||
private restartRequired;
|
||||
private lastJoinedDeviceIeeeAddr?;
|
||||
private lastBridgeLoggingPayload?;
|
||||
private logTransport;
|
||||
private requestLookup;
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
/**
|
||||
* Requests
|
||||
*/
|
||||
deviceOptions(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/device/options">>;
|
||||
groupOptions(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/group/options">>;
|
||||
bridgeOptions(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/options">>;
|
||||
deviceRemove(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/remove">>;
|
||||
groupRemove(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/group/remove">>;
|
||||
healthCheck(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/health_check">>;
|
||||
coordinatorCheck(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/coordinator_check">>;
|
||||
groupAdd(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/group/add">>;
|
||||
deviceRename(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/rename">>;
|
||||
groupRename(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/group/rename">>;
|
||||
restart(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/restart">>;
|
||||
backup(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/backup">>;
|
||||
installCodeAdd(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/install_code/add">>;
|
||||
permitJoin(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/permit_join">>;
|
||||
touchlinkIdentify(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/touchlink/identify">>;
|
||||
touchlinkFactoryReset(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/touchlink/factory_reset">>;
|
||||
touchlinkScan(message: KeyValue | string): Promise<Zigbee2MQTTResponse<"bridge/response/touchlink/scan">>;
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
changeEntityOptions<T extends "device" | "group">(entityType: T, message: KeyValue | string): Promise<Zigbee2MQTTResponse<T extends "device" ? "bridge/response/device/options" : "bridge/response/group/options">>;
|
||||
deviceReportingConfigure(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/reporting/configure">>;
|
||||
deviceReportingRead(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/reporting/read">>;
|
||||
deviceInterview(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/interview">>;
|
||||
deviceGenerateExternalDefinition(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/device/generate_external_definition">>;
|
||||
action(message: string | KeyValue): Promise<Zigbee2MQTTResponse<"bridge/response/action">>;
|
||||
renameEntity<T extends "device" | "group">(entityType: T, message: string | KeyValue): Promise<Zigbee2MQTTResponse<T extends "device" ? "bridge/response/device/rename" : "bridge/response/group/rename">>;
|
||||
removeEntity<T extends "device" | "group">(entityType: T, message: string | KeyValue): Promise<Zigbee2MQTTResponse<T extends "device" ? "bridge/response/device/remove" : "bridge/response/group/remove">>;
|
||||
getEntity(type: "group", id: string): Group;
|
||||
getEntity(type: "device", id: string): Device;
|
||||
getEntity(type: "group" | "device", id: string): Device | Group;
|
||||
publishInfo(): Promise<void>;
|
||||
publishDevices(): Promise<void>;
|
||||
publishGroups(): Promise<void>;
|
||||
publishDefinitions(): Promise<void>;
|
||||
getDefinitionPayload(device: Device): Zigbee2MQTTDevice["definition"] | undefined;
|
||||
}
|
||||
//# sourceMappingURL=bridge.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../lib/extension/bridge.ts"],"names":[],"mappings":"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"}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension calls the zigbee-herdsman-converters definition configure() method
|
||||
*/
|
||||
export default class Configure extends Extension {
|
||||
private configuring;
|
||||
private attempts;
|
||||
private topic;
|
||||
private onReconfigure;
|
||||
private onMQTTMessage;
|
||||
start(): Promise<void>;
|
||||
private configure;
|
||||
}
|
||||
//# sourceMappingURL=configure.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../lib/extension/configure.ts"],"names":[],"mappings":"AAOA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAS;IAC5C,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,KAAK,CAAuE;YAEhE,aAAa;YAUb,aAAa;IA8BxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CA0B9B;YAEa,SAAS;CAqE1B"}
|
||||
+6
-32
@@ -1,4 +1,4 @@
|
||||
abstract class Extension {
|
||||
declare abstract class Extension {
|
||||
protected zigbee: Zigbee;
|
||||
protected mqtt: Mqtt;
|
||||
protected state: State;
|
||||
@@ -7,7 +7,6 @@ abstract class Extension {
|
||||
protected enableDisableExtension: (enable: boolean, name: string) => Promise<void>;
|
||||
protected restartCallback: () => Promise<void>;
|
||||
protected addExtension: (extension: Extension) => Promise<void>;
|
||||
|
||||
/**
|
||||
* Besides initializing variables, the constructor should do nothing!
|
||||
*
|
||||
@@ -20,41 +19,16 @@ abstract class Extension {
|
||||
* @param {restartCallback} restartCallback Restart Zigbee2MQTT
|
||||
* @param {addExtension} addExtension Add an extension
|
||||
*/
|
||||
constructor(
|
||||
zigbee: Zigbee,
|
||||
mqtt: Mqtt,
|
||||
state: State,
|
||||
publishEntityState: PublishEntityState,
|
||||
eventBus: EventBus,
|
||||
enableDisableExtension: (enable: boolean, name: string) => Promise<void>,
|
||||
restartCallback: () => Promise<void>,
|
||||
addExtension: (extension: Extension) => Promise<void>,
|
||||
) {
|
||||
this.zigbee = zigbee;
|
||||
this.mqtt = mqtt;
|
||||
this.state = state;
|
||||
this.publishEntityState = publishEntityState;
|
||||
this.eventBus = eventBus;
|
||||
this.enableDisableExtension = enableDisableExtension;
|
||||
this.restartCallback = restartCallback;
|
||||
this.addExtension = addExtension;
|
||||
}
|
||||
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
/**
|
||||
* Is called once the extension has to start
|
||||
*/
|
||||
async start(): Promise<void> {}
|
||||
|
||||
start(): Promise<void>;
|
||||
/**
|
||||
* Is called once the extension has to stop
|
||||
*/
|
||||
|
||||
// biome-ignore lint/suspicious/useAwait: API
|
||||
async stop(): Promise<void> {
|
||||
this.eventBus.removeListeners(this);
|
||||
}
|
||||
|
||||
public adjustMessageBeforePublish(_entity: Group | Device, _message: KeyValue): void {}
|
||||
stop(): Promise<void>;
|
||||
adjustMessageBeforePublish(_entity: Group | Device, _message: KeyValue): void;
|
||||
}
|
||||
|
||||
export default Extension;
|
||||
//# sourceMappingURL=extension.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../lib/extension/extension.ts"],"names":[],"mappings":"AAAA,uBAAe,SAAS;IACpB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACjD,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC7B,SAAS,CAAC,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,SAAS,CAAC,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,SAAS,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE;;;;;;;;;;;OAWG;IACH,YACI,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EAUxD;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IAE/B;;OAEG;IAGG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1B;IAEM,0BAA0B,CAAC,OAAO,EAAE,KAAK,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAG;CAC1F;eAEc,SAAS"}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import type { ExternalDefinitionWithExtend } from "zigbee-herdsman-converters";
|
||||
import ExternalJSExtension from "./externalJS";
|
||||
type TModule = ExternalDefinitionWithExtend | ExternalDefinitionWithExtend[];
|
||||
export default class ExternalConverters extends ExternalJSExtension<TModule> {
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
protected removeJS(name: string, _mod: TModule): Promise<void>;
|
||||
protected loadJS(name: string, mod: TModule, newName?: string): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=externalConverters.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"externalConverters.d.ts","sourceRoot":"","sources":["../../lib/extension/externalConverters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,4BAA4B,CAAC;AAK7E,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAE/C,KAAK,OAAO,GAAG,4BAA4B,GAAG,4BAA4B,EAAE,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,mBAAmB,CAAC,OAAO,CAAC;IACxE,YACI,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EAcxD;IAED,UAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAInE;IAED,UAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBlF;CACJ"}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import type Extension from "./extension";
|
||||
import ExternalJSExtension from "./externalJS";
|
||||
type TModule = new (...args: ConstructorParameters<typeof Extension>) => Extension;
|
||||
export default class ExternalExtensions extends ExternalJSExtension<TModule> {
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
protected removeJS(_name: string, mod: TModule): Promise<void>;
|
||||
protected loadJS(name: string, mod: TModule, newName?: string): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=externalExtensions.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"externalExtensions.d.ts","sourceRoot":"","sources":["../../lib/extension/externalExtensions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,mBAAmB,MAAM,cAAc,CAAC;AAE/C,KAAK,OAAO,GAAG,KAAK,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,SAAS,CAAC,KAAK,SAAS,CAAC;AAEnF,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,mBAAmB,CAAC,OAAO,CAAC;IACxE,YACI,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EAcxD;IAED,UAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;IAED,UAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BlF;CACJ"}
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
import Extension from "./extension";
|
||||
export default abstract class ExternalJSExtension<M> extends Extension {
|
||||
protected folderName: string;
|
||||
protected mqttTopic: string;
|
||||
protected requestRegex: RegExp;
|
||||
protected basePath: string;
|
||||
protected nodeModulesSymlinked: boolean;
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>, mqttTopic: string, folderName: string);
|
||||
/**
|
||||
* In case the external JS is not in the Z2M install dir (e.g. when `ZIGBEE2MQTT_DATA` is used), the external
|
||||
* JS cannot import from `node_modules`.
|
||||
* To workaround this create a symlink to `node_modules` in the external JS dir.
|
||||
* https://nodejs.org/api/esm.html#no-node_path
|
||||
*/
|
||||
private symlinkNodeModulesIfNecessary;
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
private getFilePath;
|
||||
protected getFileCode(name: string): string;
|
||||
protected getFiles(): Generator<{
|
||||
name: string;
|
||||
code: string;
|
||||
}>;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
protected abstract removeJS(name: string, mod: M): Promise<void>;
|
||||
protected abstract loadJS(name: string, mod: M, newName?: string): Promise<void>;
|
||||
private remove;
|
||||
private save;
|
||||
private loadFiles;
|
||||
private publishExternalJS;
|
||||
private importFile;
|
||||
}
|
||||
//# sourceMappingURL=externalJS.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"externalJS.d.ts","sourceRoot":"","sources":["../../lib/extension/externalJS.ts"],"names":[],"mappings":"AAUA,OAAO,SAAS,MAAM,aAAa,CAAC;AAKpC,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,mBAAmB,CAAC,CAAC,CAAE,SAAQ,SAAS;IAClE,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,oBAAoB,UAAS;IAEvC,YACI,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EACrD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAQrB;IAED;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IAuBtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;IAEc,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CASnC;IAED,OAAO,CAAC,WAAW;IAQnB,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1C;IAED,SAAS,CAAE,QAAQ,IAAI,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAQ7D;IAEW,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BpE;IAED,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YAE7D,MAAM;YAwBN,IAAI;YA+BV,SAAS;YAqBT,iBAAiB;YAQjB,UAAU;CAc3B"}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension servers the frontend
|
||||
*/
|
||||
export declare class Frontend extends Extension {
|
||||
private mqttBaseTopic;
|
||||
private server;
|
||||
private wss;
|
||||
private baseUrl;
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
private onUpgrade;
|
||||
private onWebSocketConnection;
|
||||
private onMQTTPublishMessageOrEntityState;
|
||||
}
|
||||
export default Frontend;
|
||||
//# sourceMappingURL=frontend.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../lib/extension/frontend.ts"],"names":[],"mappings":"AAeA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;;GAEG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACnC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,GAAG,CAAoB;IAC/B,OAAO,CAAC,OAAO,CAAS;IAExB,YACI,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,sBAAsB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EAQxD;IAEc,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAqFpC;IAEc,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAanC;IAEK,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,qBAAqB;IAsC7B,OAAO,CAAC,iCAAiC;CA4BlD;eAEc,QAAQ"}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import Extension from "./extension";
|
||||
export default class Groups extends Extension {
|
||||
#private;
|
||||
private lastOptimisticState;
|
||||
start(): Promise<void>;
|
||||
onStateChange(data: eventdata.StateChange): Promise<void>;
|
||||
private shouldPublishPayloadForGroup;
|
||||
private areAllMembersOffOrClosed;
|
||||
private parseMQTTMessage;
|
||||
private onMQTTMessage;
|
||||
private publishResponse;
|
||||
}
|
||||
//# sourceMappingURL=groups.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../lib/extension/groups.ts"],"names":[],"mappings":"AAWA,OAAO,SAAS,MAAM,aAAa,CAAC;AA0BpC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS;;IAEzC,OAAO,CAAC,mBAAmB,CAA+B;IAG3C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpC;IAEW,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAoGpE;IAED,OAAO,CAAC,4BAA4B;IASpC,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,gBAAgB;YAsEJ,aAAa;YA6DnB,eAAe;CAahC"}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
import Extension from "./extension";
|
||||
export default class Health extends Extension {
|
||||
#private;
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
clearStats(): void;
|
||||
}
|
||||
//# sourceMappingURL=health.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../lib/extension/health.ts"],"names":[],"mappings":"AAKA,OAAO,SAAS,MAAM,aAAa,CAAC;AAOpC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS;;IAG1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAIpC;IAEc,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAGnC;IAED,UAAU,IAAI,IAAI,CAIjB;CA+CJ"}
|
||||
Vendored
+86
@@ -0,0 +1,86 @@
|
||||
import type { Zh } from "zigbee-herdsman-converters/lib/types";
|
||||
import Extension from "./extension";
|
||||
interface MockProperty {
|
||||
property: string;
|
||||
value: KeyValue | string | null;
|
||||
}
|
||||
interface DiscoveryEntry {
|
||||
mockProperties: MockProperty[];
|
||||
type: string;
|
||||
object_id: string;
|
||||
discovery_payload: KeyValue;
|
||||
endpoint?: Zh.Endpoint;
|
||||
}
|
||||
interface ActionData {
|
||||
action: string;
|
||||
button?: string;
|
||||
scene?: string;
|
||||
region?: string;
|
||||
}
|
||||
/**
|
||||
* This class handles the bridge entity configuration for Home Assistant Discovery.
|
||||
*/
|
||||
declare class Bridge {
|
||||
private coordinatorIeeeAddress;
|
||||
private coordinatorType;
|
||||
private coordinatorFirmwareVersion;
|
||||
private discoveryEntries;
|
||||
readonly options: {
|
||||
ID?: string;
|
||||
homeassistant?: KeyValue;
|
||||
};
|
||||
get ID(): string;
|
||||
get name(): string;
|
||||
get hardwareVersion(): string;
|
||||
get firmwareVersion(): string;
|
||||
get configs(): DiscoveryEntry[];
|
||||
constructor(ieeeAdress: string, version: zh.CoordinatorVersion, discovery: DiscoveryEntry[]);
|
||||
isDevice(): this is Device;
|
||||
isGroup(): this is Group;
|
||||
}
|
||||
/**
|
||||
* This extensions handles integration with HomeAssistant
|
||||
*/
|
||||
export declare class HomeAssistant extends Extension {
|
||||
private discovered;
|
||||
private discoveryTopic;
|
||||
private discoveryRegex;
|
||||
private discoveryRegexWoTopic;
|
||||
private groupMemberLookup;
|
||||
private statusTopic;
|
||||
private legacyActionSensor;
|
||||
private experimentalEventEntities;
|
||||
private zigbee2MQTTVersion;
|
||||
private discoveryOrigin;
|
||||
private bridge;
|
||||
private bridgeIdentifier;
|
||||
private actionValueTemplate;
|
||||
constructor(zigbee: Zigbee, mqtt: Mqtt, state: State, publishEntityState: PublishEntityState, eventBus: EventBus, enableDisableExtension: (enable: boolean, name: string) => Promise<void>, restartCallback: () => Promise<void>, addExtension: (extension: Extension) => Promise<void>);
|
||||
start(): Promise<void>;
|
||||
private getDiscovered;
|
||||
private exposeToConfig;
|
||||
onEntityRemoved(data: eventdata.EntityRemoved): Promise<void>;
|
||||
onGroupMembersChanged(data: eventdata.GroupMembersChanged): Promise<void>;
|
||||
onPublishEntityState(data: eventdata.PublishEntityState): Promise<void>;
|
||||
onEntityRenamed(data: eventdata.EntityRenamed): Promise<void>;
|
||||
private getConfigs;
|
||||
private discover;
|
||||
private onMQTTMessage;
|
||||
onZigbeeEvent(data: {
|
||||
device: Device;
|
||||
}): Promise<void>;
|
||||
onScenesChanged(data: eventdata.ScenesChanged): Promise<void>;
|
||||
private getDevicePayload;
|
||||
adjustMessageBeforePublish(entity: Device | Group | Bridge, message: KeyValue): void;
|
||||
private getEncodedBaseTopic;
|
||||
private getDiscoveryTopic;
|
||||
private publishDeviceTriggerDiscover;
|
||||
private getBridgeEntity;
|
||||
parseActionValue(action: string): ActionData;
|
||||
private buildAction;
|
||||
private prepareActionEventTypes;
|
||||
private parseGroupsFromRegex;
|
||||
private getActionValueTemplate;
|
||||
}
|
||||
export default HomeAssistant;
|
||||
//# sourceMappingURL=homeassistant.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"homeassistant.d.ts","sourceRoot":"","sources":["../../lib/extension/homeassistant.ts"],"names":[],"mappings":"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"}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import type { Zigbee2MQTTNetworkMap } from "../types/api";
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension creates a network map
|
||||
*/
|
||||
export default class NetworkMap extends Extension {
|
||||
#private;
|
||||
start(): Promise<void>;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
raw(topology: Zigbee2MQTTNetworkMap): Zigbee2MQTTNetworkMap;
|
||||
graphviz(topology: Zigbee2MQTTNetworkMap): string;
|
||||
plantuml(topology: Zigbee2MQTTNetworkMap): string;
|
||||
networkScan(includeRoutes: boolean): Promise<Zigbee2MQTTNetworkMap>;
|
||||
}
|
||||
//# sourceMappingURL=networkMap.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"networkMap.d.ts","sourceRoot":"","sources":["../../lib/extension/networkMap.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAKxE,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS;;IAI9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpC;IAEW,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCpE;IAED,GAAG,CAAC,QAAQ,EAAE,qBAAqB,GAAG,qBAAqB,CAE1D;IAED,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAqEhD;IAED,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAmDhD;IAEK,WAAW,CAAC,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA8IxE;CACJ"}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
import Extension from "./extension";
|
||||
/**
|
||||
* This extension calls the zigbee-herdsman-converters onEvent.
|
||||
*/
|
||||
export default class OnEvent extends Extension {
|
||||
#private;
|
||||
start(): Promise<void>;
|
||||
stop(): Promise<void>;
|
||||
private callOnEvent;
|
||||
}
|
||||
//# sourceMappingURL=onEvent.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"onEvent.d.ts","sourceRoot":"","sources":["../../lib/extension/onEvent.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAS;;IAW3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAuCpC;IAEc,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CASnC;YAEa,WAAW;CAmB5B"}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
import Extension from "./extension";
|
||||
type UpdateState = "updating" | "idle" | "available" | "scheduled";
|
||||
export interface UpdatePayload {
|
||||
update: {
|
||||
progress?: number;
|
||||
remaining?: number;
|
||||
state: UpdateState;
|
||||
installed_version: number | null;
|
||||
latest_version: number | null;
|
||||
latest_source: string | null;
|
||||
latest_release_notes: string | null;
|
||||
};
|
||||
}
|
||||
export default class OTAUpdate extends Extension {
|
||||
#private;
|
||||
start(): Promise<void>;
|
||||
clearState(): void;
|
||||
private onZigbeeEvent;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=otaUpdate.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"otaUpdate.d.ts","sourceRoot":"","sources":["../../lib/extension/otaUpdate.ts"],"names":[],"mappings":"AAaA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,KAAK,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE;QACJ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,WAAW,CAAC;QACnB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;KACvC,CAAC;CACL;AAuBD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAS;;IAS7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAepC;IAGD,UAAU,IAAI,IAAI,CAGjB;YAWmB,aAAa;IAmJrB,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAsPpE;CAwDJ"}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
import Extension from "./extension";
|
||||
export declare const loadTopicGetSetRegex: () => void;
|
||||
interface ParsedTopic {
|
||||
ID: string;
|
||||
endpoint: string | undefined;
|
||||
attribute: string;
|
||||
type: "get" | "set";
|
||||
}
|
||||
export default class Publish extends Extension {
|
||||
start(): Promise<void>;
|
||||
parseTopic(topic: string): ParsedTopic | undefined;
|
||||
parseMessage(parsedTopic: ParsedTopic, data: eventdata.MQTTMessage): KeyValue | undefined;
|
||||
updateMessageHomeAssistant(message: KeyValue, entityState: KeyValue): void;
|
||||
onMQTTMessage(data: eventdata.MQTTMessage): Promise<void>;
|
||||
private getDefinitionConverters;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=publish.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../lib/extension/publish.ts"],"names":[],"mappings":"AAQA,OAAO,SAAS,MAAM,aAAa,CAAC;AAKpC,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC;AAKF,UAAU,WAAW;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAS;IAE3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpC;IAED,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAsBjD;IAED,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,QAAQ,GAAG,SAAS,CAcxF;IAED,0BAA0B,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,GAAG,IAAI,CAezE;IAEW,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAqNpE;IAED,OAAO,CAAC,uBAAuB;CAOlC"}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import Extension from "./extension";
|
||||
export default class Receive extends Extension {
|
||||
private elapsed;
|
||||
private debouncers;
|
||||
private throttlers;
|
||||
start(): Promise<void>;
|
||||
onPublishEntityState(data: eventdata.PublishEntityState): void;
|
||||
publishDebounce(device: Device, payload: KeyValue, time: number, debounceIgnore: string[] | undefined): void;
|
||||
publishThrottle(device: Device, payload: KeyValue, time: number): Promise<void>;
|
||||
isPayloadConflicted(newPayload: KeyValue, oldPayload: KeyValue, debounceIgnore: string[] | undefined): boolean;
|
||||
onDeviceMessage(data: eventdata.DeviceMessage): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=receive.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"receive.d.ts","sourceRoot":"","sources":["../../lib/extension/receive.ts"],"names":[],"mappings":"AASA,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAS;IAE1C,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,UAAU,CAAqE;IACvF,OAAO,CAAC,UAAU,CAAoD;IAGvD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpC;IAEK,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAgBnE;IAED,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CA0B3G;IAEK,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpF;IAMD,mBAAmB,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAU7G;IAEW,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAuFxE;CACJ"}
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
import type { OtaExtraMetas } from "zigbee-herdsman/dist/controller/tstype";
|
||||
import type { CustomClusters } from "zigbee-herdsman/dist/zspec/zcl/definition/tstype";
|
||||
import * as zhc from "zigbee-herdsman-converters";
|
||||
export default class Device {
|
||||
#private;
|
||||
zh: zh.Device;
|
||||
definition?: zhc.Definition;
|
||||
private _definitionModelID?;
|
||||
get ieeeAddr(): string;
|
||||
get ID(): string;
|
||||
get options(): DeviceOptionsWithId;
|
||||
get name(): string;
|
||||
get isSupported(): boolean;
|
||||
get customClusters(): CustomClusters;
|
||||
get otaExtraMetas(): OtaExtraMetas;
|
||||
get interviewed(): boolean;
|
||||
constructor(device: zh.Device);
|
||||
exposes(): zhc.Expose[];
|
||||
resolveDefinition(ignoreCache?: boolean): Promise<void>;
|
||||
reInterview(eventBus: EventBus): Promise<void>;
|
||||
ensureInSettings(): void;
|
||||
endpoint(key?: string | number): zh.Endpoint | undefined;
|
||||
endpointName(endpoint: zh.Endpoint): string | undefined;
|
||||
getEndpointNames(): string[];
|
||||
isDevice(): this is Device;
|
||||
isGroup(): this is Group;
|
||||
}
|
||||
//# sourceMappingURL=device.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../lib/model/device.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kDAAkD,CAAC;AACrF,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAC;AAYlD,MAAM,CAAC,OAAO,OAAO,MAAM;;IAChB,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC;IACnC,OAAO,CAAC,kBAAkB,CAAC,CAAS;IAGpC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IACD,IAAI,OAAO,IAAI,mBAAmB,CAGjC;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,cAAc,IAAI,cAAc,CAEnC;IACD,IAAI,aAAa,IAAI,aAAa,CAEjC;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,YAAY,MAAM,EAAE,EAAE,CAAC,MAAM,EAE5B;IAED,OAAO,IAAI,GAAG,CAAC,MAAM,EAAE,CAWtB;IAEK,iBAAiB,CAAC,WAAW,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1D;IAEK,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAenD;IAED,gBAAgB,IAAI,IAAI,CAIvB;IAED,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,QAAQ,GAAG,SAAS,CAgBvD;IAED,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,GAAG,MAAM,GAAG,SAAS,CAgBtD;IAED,gBAAgB,IAAI,MAAM,EAAE,CAY3B;IAED,QAAQ,IAAI,IAAI,IAAI,MAAM,CAEzB;IAED,OAAO,IAAI,IAAI,IAAI,KAAK,CAEvB;CACJ"}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
import type * as zhc from "zigbee-herdsman-converters";
|
||||
export default class Group {
|
||||
zh: zh.Group;
|
||||
private resolveDevice;
|
||||
get ID(): number;
|
||||
get options(): GroupOptions;
|
||||
get name(): string;
|
||||
constructor(group: zh.Group, resolveDevice: (ieeeAddr: string) => Device | undefined);
|
||||
ensureInSettings(): void;
|
||||
hasMember(device: Device): boolean;
|
||||
membersDevices(): Generator<Device>;
|
||||
membersDefinitions(): zhc.Definition[];
|
||||
isDevice(): this is Device;
|
||||
isGroup(): this is Group;
|
||||
}
|
||||
//# sourceMappingURL=group.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../lib/model/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,4BAA4B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,KAAK;IACf,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;IACpB,OAAO,CAAC,aAAa,CAA2C;IAGhE,IAAI,EAAE,IAAI,MAAM,CAEf;IACD,IAAI,OAAO,IAAI,YAAY,CAG1B;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,YAAY,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,EAGnF;IAED,gBAAgB,IAAI,IAAI,CAIvB;IAED,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjC;IAEA,cAAc,IAAI,SAAS,CAAC,MAAM,CAAC,CAQnC;IAED,kBAAkB,IAAI,GAAG,CAAC,UAAU,EAAE,CAUrC;IAED,QAAQ,IAAI,IAAI,IAAI,MAAM,CAEzB;IACD,OAAO,IAAI,IAAI,IAAI,KAAK,CAEvB;CACJ"}
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
import type { IClientPublishOptions } from "mqtt";
|
||||
export interface MqttPublishOptions {
|
||||
clientOptions: IClientPublishOptions;
|
||||
baseTopic: string;
|
||||
skipLog: boolean;
|
||||
skipReceive: boolean;
|
||||
meta: {
|
||||
isEntityState?: boolean;
|
||||
};
|
||||
}
|
||||
export default class Mqtt {
|
||||
private publishedTopics;
|
||||
private connectionTimer?;
|
||||
private client;
|
||||
private eventBus;
|
||||
private republishRetainedTimer?;
|
||||
private defaultPublishOptions;
|
||||
retainedMessages: {
|
||||
[s: string]: {
|
||||
topic: string;
|
||||
payload: string;
|
||||
options: MqttPublishOptions;
|
||||
};
|
||||
};
|
||||
get info(): {
|
||||
version: 3 | 4 | 5 | undefined;
|
||||
server: string;
|
||||
};
|
||||
get stats(): {
|
||||
connected: boolean;
|
||||
queued: number;
|
||||
};
|
||||
constructor(eventBus: EventBus);
|
||||
connect(): Promise<void>;
|
||||
disconnect(): Promise<void>;
|
||||
subscribe(topic: string): Promise<void>;
|
||||
unsubscribe(topic: string): Promise<void>;
|
||||
private onConnect;
|
||||
onMessage(topic: string, message: Buffer): void;
|
||||
isConnected(): boolean;
|
||||
publish(topic: string, payload: string, options?: Partial<MqttPublishOptions>): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=mqtt.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mqtt.d.ts","sourceRoot":"","sources":["../lib/mqtt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,qBAAqB,EAAa,MAAM,MAAM,CAAC;AAU5E,MAAM,WAAW,kBAAkB;IAC/B,aAAa,EAAE,qBAAqB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAC,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,sBAAsB,CAAC,CAAiB;IAChD,OAAO,CAAC,qBAAqB,CAAqB;IAC3C,gBAAgB,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,kBAAkB,CAAA;SAAC,CAAA;KAAC,CAAM;IAE3G,IAAI,IAAI;QAEA,OAAO;QACP,MAAM;MAEb;IAED,IAAI,KAAK;QAED,SAAS;QACT,MAAM;MAEb;IAED,YAAY,QAAQ,EAAE,QAAQ,EAS7B;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAiG7B;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAchC;IAEK,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5C;IAEK,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9C;YAEmB,SAAS;IAShB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAY3D;IAED,WAAW,IAAI,OAAO,CAErB;IAEK,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDtG;CACJ"}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
declare class State {
|
||||
private readonly eventBus;
|
||||
private readonly zigbee;
|
||||
private readonly state;
|
||||
private readonly file;
|
||||
private timer?;
|
||||
constructor(eventBus: EventBus, zigbee: Zigbee);
|
||||
start(): void;
|
||||
stop(): void;
|
||||
clear(): void;
|
||||
private load;
|
||||
private save;
|
||||
exists(entity: Device | Group): boolean;
|
||||
get(entity: Group | Device): KeyValue;
|
||||
set(entity: Group | Device, update: KeyValue, reason?: string): KeyValue;
|
||||
remove(id: string | number): boolean;
|
||||
}
|
||||
export default State;
|
||||
//# sourceMappingURL=state.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../lib/state.ts"],"names":[],"mappings":"AA8BA,cAAM,KAAK;IAMH,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAN3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;IAC9D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;IACpD,OAAO,CAAC,KAAK,CAAC,CAAiB;IAE/B,YACqB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EAIlC;IAED,KAAK,IAAI,IAAI,CAKZ;IAED,IAAI,IAAI,IAAI,CAcX;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,OAAO,CAAC,IAAI;IAoBZ,OAAO,CAAC,IAAI;IAgBZ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,CAEtC;IAED,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAEpC;IAED,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAWvE;IAED,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAEnC;CACJ;eAEc,KAAK"}
|
||||
+195
-358
File diff suppressed because it is too large
Load Diff
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
declare function joinPath(file: string): string;
|
||||
declare function getPath(): string;
|
||||
declare function _testReload(): void;
|
||||
declare const _default: {
|
||||
joinPath: typeof joinPath;
|
||||
getPath: typeof getPath;
|
||||
_testReload: typeof _testReload;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=data.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../lib/util/data.ts"],"names":[],"mappings":"AAQA,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtC;AAED,iBAAS,OAAO,IAAI,MAAM,CAEzB;AAED,iBAAS,WAAW,IAAI,IAAI,CAE3B"}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
import winston from "winston";
|
||||
import * as settings from "./settings";
|
||||
declare class Logger {
|
||||
private level;
|
||||
private output;
|
||||
private directory;
|
||||
private logger;
|
||||
private fileTransport;
|
||||
private debugNamespaceIgnoreRegex?;
|
||||
private namespacedLevels;
|
||||
private cachedNamespacedLevels;
|
||||
init(): void;
|
||||
get winston(): winston.Logger;
|
||||
addTransport(transport: winston.transport): void;
|
||||
removeTransport(transport: winston.transport): void;
|
||||
getDebugNamespaceIgnore(): string;
|
||||
setDebugNamespaceIgnore(value: string): void;
|
||||
getLevel(): settings.LogLevel;
|
||||
setLevel(level: settings.LogLevel): void;
|
||||
getNamespacedLevels(): Record<string, settings.LogLevel>;
|
||||
setNamespacedLevels(nsLevels: Record<string, settings.LogLevel>): void;
|
||||
private resetCachedNamespacedLevels;
|
||||
private cacheNamespacedLevel;
|
||||
private log;
|
||||
error(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
warning(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
info(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
debug(messageOrLambda: string | (() => string), namespace?: string): void;
|
||||
private cleanup;
|
||||
end(): Promise<void>;
|
||||
}
|
||||
declare const _default: Logger;
|
||||
export default _default;
|
||||
//# sourceMappingURL=logger.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/util/logger.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAIvC,cAAM,MAAM;IACR,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,aAAa,CAAuD;IAC5E,OAAO,CAAC,yBAAyB,CAAC,CAAS;IAC3C,OAAO,CAAC,gBAAgB,CAAqC;IAC7D,OAAO,CAAC,sBAAsB,CAAqC;IAE5D,IAAI,IAAI,IAAI,CA6GlB;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,CAE5B;IAEM,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAEtD;IAEM,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAEzD;IAEM,uBAAuB,IAAI,MAAM,CAEvC;IAEM,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAElD;IAEM,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAEnC;IAEM,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAG9C;IAEM,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAE9D;IAEM,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAG5E;IAED,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,GAAG;IASJ,KAAK,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI,CAE9E;IAEM,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI,CAEhF;IAEM,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI,CAE7E;IAEM,KAAK,CAAC,eAAe,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,EAAE,SAAS,SAAQ,GAAG,IAAI,CAM9E;IAGD,OAAO,CAAC,OAAO;IA0BF,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAoBhC;CAEJ"}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
/** Anything mergeable: a plain-ish object, explicitly not an array or another iterable. */
|
||||
export type UnknownRecord = Record<string | number, unknown> & {
|
||||
[Symbol.iterator]?: never;
|
||||
};
|
||||
/**
|
||||
* Merge all sources into `target` recursively.
|
||||
*
|
||||
* Key behavior:
|
||||
* - ignore properties `__proto__`, `constructor` & `prototype`
|
||||
* - assumes no infinite circular possible (unhandled for perf)
|
||||
*
|
||||
* Pass empty object `{}` as `target` to return a new object without modifying any existing objects.
|
||||
*/
|
||||
export declare function objectAssignDeep<T extends UnknownRecord, S extends readonly UnknownRecord[]>(target: T, ...sources: S): T & UnionToIntersection<S[number]>;
|
||||
//# sourceMappingURL=objectAssignDeep.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"objectAssignDeep.d.ts","sourceRoot":"","sources":["../../lib/util/objectAssignDeep.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GAAG;IAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAA;CAAC,CAAC;AA+B3F;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,SAAS,aAAa,EAAE,EACxF,MAAM,EAAE,CAAC,EACT,GAAG,OAAO,EAAE,CAAC,GACd,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAsBpC"}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare function onboard(): Promise<boolean>;
|
||||
//# sourceMappingURL=onboarding.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../lib/util/onboarding.ts"],"names":[],"mappings":"AAgQA,wBAAsB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAgEhD"}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Handle sd_notify protocol, @see https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html
|
||||
* No-op if running on unsupported platforms or without Type=notify
|
||||
* Soft-fails if improperly setup (this is not necessary for Zigbee2MQTT to function properly)
|
||||
*/
|
||||
export declare function initSdNotify(): Promise<{
|
||||
notifyStopping: () => void;
|
||||
stop: () => void;
|
||||
} | undefined>;
|
||||
//# sourceMappingURL=sd-notify.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sd-notify.d.ts","sourceRoot":"","sources":["../../lib/util/sd-notify.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAC,GAAG,SAAS,CAAC,CA0DxG"}
|
||||
Vendored
+238
@@ -0,0 +1,238 @@
|
||||
import schemaJson from "./settings.schema.json";
|
||||
export { schemaJson };
|
||||
export declare const CURRENT_VERSION = 5;
|
||||
/** NOTE: by order of priority, lower index is lower level (more important) */
|
||||
export declare const LOG_LEVELS: readonly string[];
|
||||
export type LogLevel = "error" | "warning" | "info" | "debug";
|
||||
export declare const defaults: {
|
||||
homeassistant: {
|
||||
enabled: false;
|
||||
discovery_topic: string;
|
||||
status_topic: string;
|
||||
legacy_action_sensor: false;
|
||||
experimental_event_entities: false;
|
||||
};
|
||||
availability: {
|
||||
enabled: false;
|
||||
active: {
|
||||
timeout: number;
|
||||
max_jitter: number;
|
||||
backoff: true;
|
||||
pause_on_backoff_gt: number;
|
||||
};
|
||||
passive: {
|
||||
timeout: number;
|
||||
};
|
||||
};
|
||||
frontend: {
|
||||
enabled: false;
|
||||
package: "zigbee2mqtt-windfront";
|
||||
port: number;
|
||||
base_url: string;
|
||||
};
|
||||
mqtt: {
|
||||
base_topic: string;
|
||||
include_device_information: false;
|
||||
force_disable_retain: false;
|
||||
maximum_packet_size: number;
|
||||
keepalive: number;
|
||||
reject_unauthorized: true;
|
||||
version: 4;
|
||||
};
|
||||
serial: {
|
||||
disable_led: false;
|
||||
};
|
||||
passlist: never[];
|
||||
blocklist: never[];
|
||||
map_options: {
|
||||
graphviz: {
|
||||
colors: {
|
||||
fill: {
|
||||
enddevice: string;
|
||||
coordinator: string;
|
||||
router: string;
|
||||
};
|
||||
font: {
|
||||
coordinator: string;
|
||||
router: string;
|
||||
enddevice: string;
|
||||
};
|
||||
line: {
|
||||
active: string;
|
||||
inactive: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
ota: {
|
||||
update_check_interval: number;
|
||||
disable_automatic_update_check: false;
|
||||
image_block_request_timeout: number;
|
||||
image_block_response_delay: number;
|
||||
default_maximum_data_size: number;
|
||||
};
|
||||
device_options: {};
|
||||
advanced: {
|
||||
log_rotation: true;
|
||||
log_console_json: false;
|
||||
log_symlink_current: false;
|
||||
log_output: ("console" | "file")[];
|
||||
log_directory: string;
|
||||
log_file: string;
|
||||
log_level: "debug" | "info";
|
||||
log_namespaced_levels: {};
|
||||
log_syslog: {};
|
||||
log_debug_to_mqtt_frontend: false;
|
||||
log_debug_namespace_ignore: string;
|
||||
log_directories_to_keep: number;
|
||||
pan_id: number;
|
||||
ext_pan_id: number[];
|
||||
channel: number;
|
||||
adapter_concurrent: undefined;
|
||||
adapter_delay: undefined;
|
||||
cache_state: true;
|
||||
cache_state_persistent: true;
|
||||
cache_state_send_on_startup: true;
|
||||
last_seen: "disable";
|
||||
elapsed: false;
|
||||
network_key: number[];
|
||||
timestamp_format: string;
|
||||
output: "json";
|
||||
enable_external_js: true;
|
||||
};
|
||||
health: {
|
||||
interval: number;
|
||||
reset_on_check: false;
|
||||
};
|
||||
};
|
||||
export declare function writeMinimalDefaults(): void;
|
||||
export declare function setOnboarding(value: boolean): void;
|
||||
export declare function write(): void;
|
||||
export declare function validate(): string[];
|
||||
export declare function validateNonRequired(): string[];
|
||||
/**
|
||||
* Get the settings actually written in the yaml.
|
||||
* Env vars are applied on top.
|
||||
* Defaults merged on startup are not included.
|
||||
*/
|
||||
export declare function getPersistedSettings(): Partial<Settings>;
|
||||
export declare function get(): Settings;
|
||||
export declare function set(path: string[], value: string | number | boolean | KeyValue): void;
|
||||
export declare function apply(settings: Record<string, unknown>, throwOnError?: boolean): boolean;
|
||||
export declare function getGroup(IDorName: string | number): GroupOptions | undefined;
|
||||
export declare function getDevice(IDorName: string): DeviceOptionsWithId | undefined;
|
||||
export declare function addDevice(id: string): DeviceOptionsWithId;
|
||||
export declare function blockDevice(id: string): void;
|
||||
export declare function removeDevice(IDorName: string): void;
|
||||
export declare function addGroup(name: string, id?: string): GroupOptions;
|
||||
export declare function removeGroup(IDorName: string | number): void;
|
||||
export declare function changeEntityOptions(IDorName: string, newOptions: KeyValue): boolean;
|
||||
export declare function changeFriendlyName(IDorName: string, newName: string): void;
|
||||
export declare function reRead(): void;
|
||||
export declare const testing: {
|
||||
write: typeof write;
|
||||
clear: () => void;
|
||||
defaults: {
|
||||
homeassistant: {
|
||||
enabled: false;
|
||||
discovery_topic: string;
|
||||
status_topic: string;
|
||||
legacy_action_sensor: false;
|
||||
experimental_event_entities: false;
|
||||
};
|
||||
availability: {
|
||||
enabled: false;
|
||||
active: {
|
||||
timeout: number;
|
||||
max_jitter: number;
|
||||
backoff: true;
|
||||
pause_on_backoff_gt: number;
|
||||
};
|
||||
passive: {
|
||||
timeout: number;
|
||||
};
|
||||
};
|
||||
frontend: {
|
||||
enabled: false;
|
||||
package: "zigbee2mqtt-windfront";
|
||||
port: number;
|
||||
base_url: string;
|
||||
};
|
||||
mqtt: {
|
||||
base_topic: string;
|
||||
include_device_information: false;
|
||||
force_disable_retain: false;
|
||||
maximum_packet_size: number;
|
||||
keepalive: number;
|
||||
reject_unauthorized: true;
|
||||
version: 4;
|
||||
};
|
||||
serial: {
|
||||
disable_led: false;
|
||||
};
|
||||
passlist: never[];
|
||||
blocklist: never[];
|
||||
map_options: {
|
||||
graphviz: {
|
||||
colors: {
|
||||
fill: {
|
||||
enddevice: string;
|
||||
coordinator: string;
|
||||
router: string;
|
||||
};
|
||||
font: {
|
||||
coordinator: string;
|
||||
router: string;
|
||||
enddevice: string;
|
||||
};
|
||||
line: {
|
||||
active: string;
|
||||
inactive: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
ota: {
|
||||
update_check_interval: number;
|
||||
disable_automatic_update_check: false;
|
||||
image_block_request_timeout: number;
|
||||
image_block_response_delay: number;
|
||||
default_maximum_data_size: number;
|
||||
};
|
||||
device_options: {};
|
||||
advanced: {
|
||||
log_rotation: true;
|
||||
log_console_json: false;
|
||||
log_symlink_current: false;
|
||||
log_output: ("console" | "file")[];
|
||||
log_directory: string;
|
||||
log_file: string;
|
||||
log_level: "debug" | "info";
|
||||
log_namespaced_levels: {};
|
||||
log_syslog: {};
|
||||
log_debug_to_mqtt_frontend: false;
|
||||
log_debug_namespace_ignore: string;
|
||||
log_directories_to_keep: number;
|
||||
pan_id: number;
|
||||
ext_pan_id: number[];
|
||||
channel: number;
|
||||
adapter_concurrent: undefined;
|
||||
adapter_delay: undefined;
|
||||
cache_state: true;
|
||||
cache_state_persistent: true;
|
||||
cache_state_send_on_startup: true;
|
||||
last_seen: "disable";
|
||||
elapsed: false;
|
||||
network_key: number[];
|
||||
timestamp_format: string;
|
||||
output: "json";
|
||||
enable_external_js: true;
|
||||
};
|
||||
health: {
|
||||
interval: number;
|
||||
reset_on_check: false;
|
||||
};
|
||||
};
|
||||
CURRENT_VERSION: number;
|
||||
};
|
||||
//# sourceMappingURL=settings.d.ts.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../lib/util/settings.ts"],"names":[],"mappings":"AAKA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAIhD,OAAO,EAAC,UAAU,EAAC,CAAC;AAGpB,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,8EAA8E;AAC9E,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAmD,CAAC;AAC5F,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAY9D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;YAWH,OAAO;;;;;;;;;;;;;;;;;;;;;;;;QAwBjB,QAAQ;YACJ,MAAM;gBACF,IAAI;oBACA,SAAS;oBACT,WAAW;oBACX,MAAM;;gBAEV,IAAI;oBACA,WAAW;oBACX,MAAM;oBACN,SAAS;;gBAEb,IAAI;oBACA,MAAM;oBACN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CU,CAAC;AAmCvC,wBAAgB,oBAAoB,IAAI,IAAI,CA+B3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAclD;AAED,wBAAgB,KAAK,IAAI,IAAI,CA0D5B;AAED,wBAAgB,QAAQ,IAAI,MAAM,EAAE,CAoDnC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAW9C;AA8GD;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC,CAMxD;AAED,wBAAgB,GAAG,IAAI,QAAQ,CAO9B;AAED,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,CAkBrF;AAED,wBAAgB,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,UAAO,GAAG,OAAO,CAuBrF;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,CAe5E;AAYD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAe3E;AAWD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,CAgBzD;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAQ5C;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAKnD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,CAiChE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAG,OAAO,CAiCnF;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAwB1E;AAED,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,eAAO,MAAM,OAAO;;iBAEL,IAAI;;;;;;;;;;;;;;;;;;gBA/pBD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;YAwBjB,QAAQ;gBACJ,MAAM;oBACF,IAAI;wBACA,SAAS;wBACT,WAAW;wBACX,MAAM;;oBAEV,IAAI;wBACA,WAAW;wBACX,MAAM;wBACN,SAAS;;oBAEb,IAAI;wBACA,MAAM;wBACN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+nB3B,CAAC"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user