homebridge-config-ui-x 5.9.1-beta.1 → 5.9.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -3
- package/TODO-MATTER.md +15 -0
- package/dist/app.controller.d.ts +1 -1
- package/dist/app.controller.js +14 -12
- package/dist/app.controller.js.map +1 -1
- package/dist/app.gateway.js +7 -10
- package/dist/app.gateway.js.map +1 -1
- package/dist/app.module.js +42 -43
- package/dist/app.module.js.map +1 -1
- package/dist/app.service.js +4 -7
- package/dist/app.service.js.map +1 -1
- package/dist/bin/base-platform.d.ts +1 -1
- package/dist/bin/base-platform.js +11 -17
- package/dist/bin/base-platform.js.map +1 -1
- package/dist/bin/fork.js +7 -45
- package/dist/bin/fork.js.map +1 -1
- package/dist/bin/hb-service.js +224 -243
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/bin/platforms/darwin.d.ts +1 -1
- package/dist/bin/platforms/darwin.js +61 -65
- package/dist/bin/platforms/darwin.js.map +1 -1
- package/dist/bin/platforms/freebsd.d.ts +1 -1
- package/dist/bin/platforms/freebsd.js +42 -47
- package/dist/bin/platforms/freebsd.js.map +1 -1
- package/dist/bin/platforms/linux.d.ts +1 -1
- package/dist/bin/platforms/linux.js +127 -132
- package/dist/bin/platforms/linux.js.map +1 -1
- package/dist/bin/platforms/win32.d.ts +1 -1
- package/dist/bin/platforms/win32.js +30 -36
- package/dist/bin/platforms/win32.js.map +1 -1
- package/dist/bin/standalone.js +15 -53
- package/dist/bin/standalone.js.map +1 -1
- package/dist/core/auth/auth.controller.d.ts +5 -4
- package/dist/core/auth/auth.controller.js +40 -39
- package/dist/core/auth/auth.controller.js.map +1 -1
- package/dist/core/auth/auth.dto.js +17 -18
- package/dist/core/auth/auth.dto.js.map +1 -1
- package/dist/core/auth/auth.module.js +28 -31
- package/dist/core/auth/auth.module.js.map +1 -1
- package/dist/core/auth/auth.service.d.ts +3 -3
- package/dist/core/auth/auth.service.js +65 -62
- package/dist/core/auth/auth.service.js.map +1 -1
- package/dist/core/auth/guards/admin.guard.js +4 -7
- package/dist/core/auth/guards/admin.guard.js.map +1 -1
- package/dist/core/auth/guards/custom.guard.js +6 -9
- package/dist/core/auth/guards/custom.guard.js.map +1 -1
- package/dist/core/auth/guards/ws-admin-guard.d.ts +2 -2
- package/dist/core/auth/guards/ws-admin-guard.js +13 -11
- package/dist/core/auth/guards/ws-admin-guard.js.map +1 -1
- package/dist/core/auth/guards/ws.guard.d.ts +2 -2
- package/dist/core/auth/guards/ws.guard.js +13 -11
- package/dist/core/auth/guards/ws.guard.js.map +1 -1
- package/dist/core/auth/jwt.strategy.d.ts +3 -2
- package/dist/core/auth/jwt.strategy.js +21 -16
- package/dist/core/auth/jwt.strategy.js.map +1 -1
- package/dist/core/config/config.interfaces.d.ts +8 -1
- package/dist/core/config/config.interfaces.js +1 -2
- package/dist/core/config/config.module.js +8 -10
- package/dist/core/config/config.module.js.map +1 -1
- package/dist/core/config/config.service.d.ts +4 -3
- package/dist/core/config/config.service.js +90 -83
- package/dist/core/config/config.service.js.map +1 -1
- package/dist/core/config/config.startup.d.ts +1 -1
- package/dist/core/config/config.startup.js +23 -28
- package/dist/core/config/config.startup.js.map +1 -1
- package/dist/core/feature-flags/feature-flags.registry.js +2 -5
- package/dist/core/feature-flags/feature-flags.registry.js.map +1 -1
- package/dist/core/homebridge-ipc/homebridge-ipc.module.js +11 -14
- package/dist/core/homebridge-ipc/homebridge-ipc.module.js.map +1 -1
- package/dist/core/homebridge-ipc/homebridge-ipc.service.d.ts +4 -4
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js +25 -19
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js.map +1 -1
- package/dist/core/logger/logger.module.js +8 -10
- package/dist/core/logger/logger.module.js.map +1 -1
- package/dist/core/logger/logger.service.js +13 -23
- package/dist/core/logger/logger.service.js.map +1 -1
- package/dist/core/node-pty/node-pty.module.js +7 -10
- package/dist/core/node-pty/node-pty.module.js.map +1 -1
- package/dist/core/node-pty/node-pty.service.js +6 -11
- package/dist/core/node-pty/node-pty.service.js.map +1 -1
- package/dist/core/node-version.constants.js +4 -11
- package/dist/core/node-version.constants.js.map +1 -1
- package/dist/core/scheduler/scheduler.module.js +15 -10
- package/dist/core/scheduler/scheduler.module.js.map +1 -1
- package/dist/core/scheduler/scheduler.service.d.ts +12 -1
- package/dist/core/scheduler/scheduler.service.js +101 -13
- package/dist/core/scheduler/scheduler.service.js.map +1 -1
- package/dist/core/spa/spa-html.service.js +9 -15
- package/dist/core/spa/spa-html.service.js.map +1 -1
- package/dist/core/spa/spa.filter.d.ts +1 -1
- package/dist/core/spa/spa.filter.js +11 -16
- package/dist/core/spa/spa.filter.js.map +1 -1
- package/dist/core/ssl/ssl-cert-generator.service.js +34 -36
- package/dist/core/ssl/ssl-cert-generator.service.js.map +1 -1
- package/dist/env-setup.d.ts +1 -0
- package/dist/env-setup.js +7 -0
- package/dist/env-setup.js.map +1 -0
- package/dist/globalDefaults.d.ts +1 -0
- package/dist/globalDefaults.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -19
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +5 -3
- package/dist/main.js +44 -51
- package/dist/main.js.map +1 -1
- package/dist/modules/accessories/accessories.controller.d.ts +3 -3
- package/dist/modules/accessories/accessories.controller.js +28 -29
- package/dist/modules/accessories/accessories.controller.js.map +1 -1
- package/dist/modules/accessories/accessories.dto.js +11 -13
- package/dist/modules/accessories/accessories.dto.js.map +1 -1
- package/dist/modules/accessories/accessories.gateway.d.ts +2 -2
- package/dist/modules/accessories/accessories.gateway.js +18 -16
- package/dist/modules/accessories/accessories.gateway.js.map +1 -1
- package/dist/modules/accessories/accessories.interfaces.d.ts +94 -0
- package/dist/modules/accessories/accessories.interfaces.js +2 -0
- package/dist/modules/accessories/accessories.interfaces.js.map +1 -0
- package/dist/modules/accessories/accessories.module.js +19 -20
- package/dist/modules/accessories/accessories.module.js.map +1 -1
- package/dist/modules/accessories/accessories.service.d.ts +23 -5
- package/dist/modules/accessories/accessories.service.js +316 -51
- package/dist/modules/accessories/accessories.service.js.map +1 -1
- package/dist/modules/backup/backup.controller.d.ts +4 -4
- package/dist/modules/backup/backup.controller.js +68 -67
- package/dist/modules/backup/backup.controller.js.map +1 -1
- package/dist/modules/backup/backup.gateway.d.ts +4 -4
- package/dist/modules/backup/backup.gateway.js +25 -21
- package/dist/modules/backup/backup.gateway.js.map +1 -1
- package/dist/modules/backup/backup.module.js +22 -25
- package/dist/modules/backup/backup.module.js.map +1 -1
- package/dist/modules/backup/backup.service.d.ts +5 -5
- package/dist/modules/backup/backup.service.js +143 -133
- package/dist/modules/backup/backup.service.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.gateway.d.ts +3 -3
- package/dist/modules/child-bridges/child-bridges.gateway.js +23 -21
- package/dist/modules/child-bridges/child-bridges.gateway.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.interfaces.js +1 -2
- package/dist/modules/child-bridges/child-bridges.module.js +19 -22
- package/dist/modules/child-bridges/child-bridges.module.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.service.d.ts +3 -3
- package/dist/modules/child-bridges/child-bridges.service.js +15 -11
- package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +13 -11
- package/dist/modules/config-editor/config-editor.controller.js +168 -103
- package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
- package/dist/modules/config-editor/config-editor.dto.d.ts +6 -0
- package/dist/modules/config-editor/config-editor.dto.js +40 -0
- package/dist/modules/config-editor/config-editor.dto.js.map +1 -0
- package/dist/modules/config-editor/config-editor.module.js +21 -24
- package/dist/modules/config-editor/config-editor.module.js.map +1 -1
- package/dist/modules/config-editor/config-editor.service.d.ts +11 -8
- package/dist/modules/config-editor/config-editor.service.js +123 -66
- package/dist/modules/config-editor/config-editor.service.js.map +1 -1
- package/dist/modules/custom-plugins/custom-plugins.module.js +10 -13
- package/dist/modules/custom-plugins/custom-plugins.module.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js +21 -19
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js +14 -17
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js +18 -15
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js +21 -19
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js +14 -17
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js +18 -15
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.d.ts +2 -2
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js +18 -19
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.d.ts +2 -2
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js +15 -13
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js +18 -21
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +8 -8
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +47 -41
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
- package/dist/modules/log/log.gateway.d.ts +3 -3
- package/dist/modules/log/log.gateway.js +15 -13
- package/dist/modules/log/log.gateway.js.map +1 -1
- package/dist/modules/log/log.interfaces.js +1 -2
- package/dist/modules/log/log.module.js +14 -17
- package/dist/modules/log/log.module.js.map +1 -1
- package/dist/modules/log/log.service.d.ts +5 -5
- package/dist/modules/log/log.service.js +47 -43
- package/dist/modules/log/log.service.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.controller.d.ts +1 -1
- package/dist/modules/platform-tools/docker/docker.controller.js +24 -25
- package/dist/modules/platform-tools/docker/docker.controller.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.module.js +14 -17
- package/dist/modules/platform-tools/docker/docker.module.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.service.d.ts +2 -2
- package/dist/modules/platform-tools/docker/docker.service.js +20 -16
- package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.controller.d.ts +2 -2
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js +35 -36
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.dto.js +20 -19
- package/dist/modules/platform-tools/hb-service/hb-service.dto.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.module.js +14 -17
- package/dist/modules/platform-tools/hb-service/hb-service.module.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.service.d.ts +3 -3
- package/dist/modules/platform-tools/hb-service/hb-service.service.js +37 -30
- package/dist/modules/platform-tools/hb-service/hb-service.service.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.controller.d.ts +1 -1
- package/dist/modules/platform-tools/linux/linux.controller.js +23 -21
- package/dist/modules/platform-tools/linux/linux.controller.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.module.js +14 -17
- package/dist/modules/platform-tools/linux/linux.module.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.service.d.ts +2 -2
- package/dist/modules/platform-tools/linux/linux.service.js +18 -14
- package/dist/modules/platform-tools/linux/linux.service.js.map +1 -1
- package/dist/modules/platform-tools/platform-tools.module.js +12 -15
- package/dist/modules/platform-tools/platform-tools.module.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.controller.d.ts +1 -1
- package/dist/modules/platform-tools/terminal/terminal.controller.js +15 -13
- package/dist/modules/platform-tools/terminal/terminal.controller.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +2 -2
- package/dist/modules/platform-tools/terminal/terminal.gateway.js +17 -15
- package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.interfaces.js +1 -2
- package/dist/modules/platform-tools/terminal/terminal.module.js +18 -21
- package/dist/modules/platform-tools/terminal/terminal.module.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.service.d.ts +7 -7
- package/dist/modules/platform-tools/terminal/terminal.service.js +33 -28
- package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
- package/dist/modules/plugins/plugins.controller.d.ts +12 -7
- package/dist/modules/plugins/plugins.controller.js +100 -52
- package/dist/modules/plugins/plugins.controller.js.map +1 -1
- package/dist/modules/plugins/plugins.dto.js +26 -24
- package/dist/modules/plugins/plugins.dto.js.map +1 -1
- package/dist/modules/plugins/plugins.gateway.d.ts +5 -5
- package/dist/modules/plugins/plugins.gateway.js +38 -34
- package/dist/modules/plugins/plugins.gateway.js.map +1 -1
- package/dist/modules/plugins/plugins.interfaces.js +1 -2
- package/dist/modules/plugins/plugins.module.js +27 -26
- package/dist/modules/plugins/plugins.module.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +26 -13
- package/dist/modules/plugins/plugins.service.js +365 -203
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/server/server.controller.d.ts +7 -7
- package/dist/modules/server/server.controller.js +208 -205
- package/dist/modules/server/server.controller.js.map +1 -1
- package/dist/modules/server/server.dto.js +13 -16
- package/dist/modules/server/server.dto.js.map +1 -1
- package/dist/modules/server/server.module.js +23 -26
- package/dist/modules/server/server.module.js.map +1 -1
- package/dist/modules/server/server.service.d.ts +6 -6
- package/dist/modules/server/server.service.js +202 -224
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.controller.d.ts +3 -3
- package/dist/modules/setup-wizard/setup-wizard.controller.js +19 -20
- package/dist/modules/setup-wizard/setup-wizard.controller.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.gateway.d.ts +4 -4
- package/dist/modules/setup-wizard/setup-wizard.gateway.js +25 -21
- package/dist/modules/setup-wizard/setup-wizard.gateway.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.guard.d.ts +2 -2
- package/dist/modules/setup-wizard/setup-wizard.guard.js +11 -9
- package/dist/modules/setup-wizard/setup-wizard.guard.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.module.js +12 -15
- package/dist/modules/setup-wizard/setup-wizard.module.js.map +1 -1
- package/dist/modules/status/status.controller.d.ts +5 -5
- package/dist/modules/status/status.controller.js +40 -36
- package/dist/modules/status/status.controller.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +11 -11
- package/dist/modules/status/status.gateway.js +51 -47
- package/dist/modules/status/status.gateway.js.map +1 -1
- package/dist/modules/status/status.interfaces.js +2 -5
- package/dist/modules/status/status.interfaces.js.map +1 -1
- package/dist/modules/status/status.module.js +26 -29
- package/dist/modules/status/status.module.js.map +1 -1
- package/dist/modules/status/status.service.d.ts +13 -13
- package/dist/modules/status/status.service.js +100 -88
- package/dist/modules/status/status.service.js.map +1 -1
- package/dist/modules/users/users.controller.d.ts +3 -3
- package/dist/modules/users/users.controller.js +59 -60
- package/dist/modules/users/users.controller.js.map +1 -1
- package/dist/modules/users/users.dto.js +51 -45
- package/dist/modules/users/users.dto.js.map +1 -1
- package/dist/modules/users/users.module.js +14 -17
- package/dist/modules/users/users.module.js.map +1 -1
- package/dist/self-check.js +25 -25
- package/dist/self-check.js.map +1 -1
- package/package.json +14 -12
- package/public/3rdpartylicenses.txt +26 -26
- package/public/{chunk-6KT3BYU6.js → chunk-2UCXG3TD.js} +1 -1
- package/public/{chunk-5T4JHJYL.js → chunk-2VYE34OE.js} +1 -1
- package/public/{chunk-TOYVIOBH.js → chunk-4AG5CIDJ.js} +1 -1
- package/public/{chunk-RMZRXORR.js → chunk-4H57TZAE.js} +1 -1
- package/public/{chunk-73TX7DHV.js → chunk-5CCE4FIL.js} +1 -1
- package/public/{chunk-2CNQY2E7.js → chunk-5RBSMCFS.js} +1 -1
- package/public/{chunk-LZOHFRHN.js → chunk-6O32KEYY.js} +1 -1
- package/public/{chunk-EAGKQ5OJ.js → chunk-7K67C3PU.js} +1 -1
- package/public/{chunk-732XLY23.js → chunk-7PEOCUE2.js} +3 -3
- package/public/{chunk-W3SNJ7TC.js → chunk-7RXQUWCY.js} +1 -1
- package/public/{chunk-EVND2DL5.js → chunk-7SZF43OV.js} +1 -1
- package/public/chunk-AEYQANK4.js +68 -0
- package/public/{chunk-2KEG7SYT.js → chunk-AU2Q4PYM.js} +1 -1
- package/public/chunk-AZIULTML.js +1 -0
- package/public/chunk-B63E4PTS.js +19 -0
- package/public/{chunk-X5AKILHJ.js → chunk-CT6TS63V.js} +1 -1
- package/public/{chunk-LWAL5JUG.js → chunk-DGS32J2V.js} +1 -1
- package/public/{chunk-D5RKKI2A.js → chunk-DWAKEAKY.js} +1 -1
- package/public/chunk-DZVJNQPQ.js +1 -0
- package/public/chunk-E26RJWMZ.js +4 -0
- package/public/{chunk-7UDDRMZZ.js → chunk-H22EEHWT.js} +1 -1
- package/public/{chunk-2FNQEOXF.js → chunk-HZFYCQBZ.js} +1 -1
- package/public/{chunk-OS2SEJZU.js → chunk-I24Z7SXB.js} +1 -1
- package/public/{chunk-7IYTG6GP.js → chunk-IA43FDJ7.js} +1 -1
- package/public/{chunk-WLGXJQPD.js → chunk-IHMVNP7Y.js} +1 -1
- package/public/{chunk-TSFGO3MA.js → chunk-IJNJ3FHH.js} +1 -1
- package/public/{chunk-ZJJ3EOBP.js → chunk-IM4LXJ36.js} +1 -1
- package/public/chunk-J4AYRIB4.js +1 -0
- package/public/{chunk-NKNWXFAK.js → chunk-JXJXX7ID.js} +1 -1
- package/public/chunk-K73OEMZP.js +1 -0
- package/public/chunk-KAZYWBPX.js +1 -0
- package/public/chunk-KGXF4YD5.js +1 -0
- package/public/chunk-KN2SQNGB.js +1 -0
- package/public/chunk-LN3BMCV4.js +1 -0
- package/public/{chunk-5ETJWAIW.js → chunk-LOQEG2RD.js} +1 -1
- package/public/chunk-M3HVG4RQ.js +1 -0
- package/public/{chunk-CYBDQV2B.js → chunk-MNT5ZGV3.js} +1 -1
- package/public/{chunk-UF2IM5BE.js → chunk-NTFDKV64.js} +1 -1
- package/public/chunk-PF7M52WR.js +1 -0
- package/public/chunk-PFWD43QS.js +2 -0
- package/public/{chunk-4QXLJX7D.js → chunk-PHND6FV5.js} +1 -1
- package/public/chunk-PSYU6RB3.js +1 -0
- package/public/{chunk-3E2NZ5JW.js → chunk-Q7T3F2Y7.js} +1 -1
- package/public/chunk-QKKTMQUU.js +1 -0
- package/public/chunk-QT6XPFQS.js +1 -0
- package/public/{chunk-3IZSIVEA.js → chunk-R2WI5YTX.js} +1 -1
- package/public/chunk-R44T3ZI7.js +50 -0
- package/public/{chunk-YNONXMOG.js → chunk-R6KWC4OQ.js} +1 -1
- package/public/{chunk-SY4VNLXW.js → chunk-RDOYYGV5.js} +1 -1
- package/public/chunk-RERUZJD4.js +5 -0
- package/public/chunk-S5IG2PNV.js +1 -0
- package/public/{chunk-AI6E5JVH.js → chunk-SVVZYE76.js} +1 -1
- package/public/{chunk-325LPX6W.js → chunk-T3SFHTRG.js} +1 -1
- package/public/{chunk-ADW6BF5G.js → chunk-TJ6P7UCH.js} +1 -1
- package/public/{chunk-ASKB5DLO.js → chunk-U3NNN7U4.js} +1 -1
- package/public/{chunk-BLT2YCDN.js → chunk-UBLR5WZR.js} +1 -1
- package/public/{chunk-YH6MRXGX.js → chunk-UZHUIPNT.js} +1 -1
- package/public/{chunk-BTBGWLKK.js → chunk-VNXIDOPC.js} +1 -1
- package/public/{chunk-WWSLIQVD.js → chunk-W6VJMRO6.js} +1 -1
- package/public/{chunk-3IJXQMYZ.js → chunk-WFVVY4KI.js} +1 -1
- package/public/{chunk-QK4V5DVW.js → chunk-WHSTHY5K.js} +1 -1
- package/public/chunk-XMBCOKOA.js +1 -0
- package/public/{chunk-OAHDGV32.js → chunk-XQACD65E.js} +1 -1
- package/public/{chunk-ZEI3HZ6P.js → chunk-XQCLQKCG.js} +2 -2
- package/public/{chunk-2UOYBCTN.js → chunk-XS55KH6X.js} +1 -1
- package/public/{chunk-VYC5JLE6.js → chunk-YFMEPI62.js} +1 -1
- package/public/chunk-Z4E6BJST.js +1 -0
- package/public/{chunk-OK5EJ7US.js → chunk-ZSWIXPXA.js} +1 -1
- package/public/index.html +2 -2
- package/public/{main-27RPBS22.js → main-WFXBCXTF.js} +1 -1
- package/public/{styles-CSF457UW.css → styles-WNHDEKE4.css} +1 -1
- package/scripts/extract-plugin-alias.js +8 -4
- package/public/chunk-2LXNPXT5.js +0 -1
- package/public/chunk-3XDYZNNE.js +0 -1
- package/public/chunk-57DUDNZJ.js +0 -1
- package/public/chunk-FM6ZYPKR.js +0 -4
- package/public/chunk-JJ7TVAIH.js +0 -5
- package/public/chunk-L43N56JA.js +0 -1
- package/public/chunk-L5I3DZ23.js +0 -1
- package/public/chunk-LH2LMHIZ.js +0 -1
- package/public/chunk-N2TWGDNX.js +0 -1
- package/public/chunk-O4SS7KVP.js +0 -40
- package/public/chunk-ONTEIYY3.js +0 -19
- package/public/chunk-P7TZIGJS.js +0 -50
- package/public/chunk-Q2IS3QQY.js +0 -1
- package/public/chunk-QQ5VZZQG.js +0 -1
- package/public/chunk-RYTGW6B7.js +0 -1
- package/public/chunk-SOT54YHI.js +0 -1
- package/public/chunk-TGZNYEGN.js +0 -1
- package/public/chunk-U5JF2ZOK.js +0 -1
- package/public/chunk-UNGEHXRN.js +0 -1
- package/public/chunk-VEGMNMLG.js +0 -1
- package/public/chunk-Y5FP6C55.js +0 -2
- package/public/chunk-YYJG2ENF.js +0 -1
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const accessories_service_1 = require("./accessories.service");
|
|
7
|
+
import { Module } from '@nestjs/common';
|
|
8
|
+
import { PassportModule } from '@nestjs/passport';
|
|
9
|
+
import { ConfigModule } from '../../core/config/config.module.js';
|
|
10
|
+
import { HomebridgeIpcModule } from '../../core/homebridge-ipc/homebridge-ipc.module.js';
|
|
11
|
+
import { LoggerModule } from '../../core/logger/logger.module.js';
|
|
12
|
+
import { AccessoriesController } from './accessories.controller.js';
|
|
13
|
+
import { AccessoriesGateway } from './accessories.gateway.js';
|
|
14
|
+
import { AccessoriesService } from './accessories.service.js';
|
|
17
15
|
let AccessoriesModule = class AccessoriesModule {
|
|
18
16
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(0, common_1.Module)({
|
|
17
|
+
AccessoriesModule = __decorate([
|
|
18
|
+
Module({
|
|
22
19
|
imports: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
PassportModule.register({ defaultStrategy: 'jwt' }),
|
|
21
|
+
ConfigModule,
|
|
22
|
+
LoggerModule,
|
|
23
|
+
HomebridgeIpcModule,
|
|
26
24
|
],
|
|
27
25
|
providers: [
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
AccessoriesService,
|
|
27
|
+
AccessoriesGateway,
|
|
30
28
|
],
|
|
31
29
|
exports: [
|
|
32
|
-
|
|
30
|
+
AccessoriesService,
|
|
33
31
|
],
|
|
34
32
|
controllers: [
|
|
35
|
-
|
|
33
|
+
AccessoriesController,
|
|
36
34
|
],
|
|
37
35
|
})
|
|
38
36
|
], AccessoriesModule);
|
|
37
|
+
export { AccessoriesModule };
|
|
39
38
|
//# sourceMappingURL=accessories.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessories.module.js","sourceRoot":"","sources":["../../../src/modules/accessories/accessories.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accessories.module.js","sourceRoot":"","sources":["../../../src/modules/accessories/accessories.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAoBtD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,iBAAiB;IAlB7B,MAAM,CAAC;QACN,OAAO,EAAE;YACP,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;YACnD,YAAY;YACZ,YAAY;YACZ,mBAAmB;SACpB;QACD,SAAS,EAAE;YACT,kBAAkB;YAClB,kBAAkB;SACnB;QACD,OAAO,EAAE;YACP,kBAAkB;SACnB;QACD,WAAW,EAAE;YACX,qBAAqB;SACtB;KACF,CAAC;GACW,iBAAiB,CAAG"}
|
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
import type { ServiceType } from '@homebridge/hap-client';
|
|
2
|
+
import type { Socket } from 'socket.io';
|
|
3
|
+
import type { MatterService } from './accessories.interfaces.js';
|
|
2
4
|
import { HapClient } from '@homebridge/hap-client';
|
|
3
5
|
import NodeCache from 'node-cache';
|
|
4
|
-
import { ConfigService } from '../../core/config/config.service';
|
|
5
|
-
import {
|
|
6
|
+
import { ConfigService } from '../../core/config/config.service.js';
|
|
7
|
+
import { HomebridgeIpcService } from '../../core/homebridge-ipc/homebridge-ipc.service.js';
|
|
8
|
+
import { Logger } from '../../core/logger/logger.service.js';
|
|
6
9
|
export declare class AccessoriesService {
|
|
7
10
|
private readonly configService;
|
|
8
11
|
private readonly logger;
|
|
12
|
+
private readonly homebridgeIpcService;
|
|
9
13
|
hapClient: HapClient;
|
|
10
14
|
accessoriesCache: NodeCache;
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
private matterMonitoringActive;
|
|
16
|
+
private matterUpdateListener;
|
|
17
|
+
private activeClients;
|
|
18
|
+
private matterAccessories;
|
|
19
|
+
constructor(configService: ConfigService, logger: Logger, homebridgeIpcService: HomebridgeIpcService);
|
|
20
|
+
connect(client: Socket): Promise<void>;
|
|
13
21
|
private refreshCharacteristics;
|
|
14
22
|
loadAccessories(): Promise<ServiceType[]>;
|
|
15
|
-
getAccessory(uniqueId: string): Promise<ServiceType>;
|
|
23
|
+
getAccessory(uniqueId: string): Promise<MatterService | ServiceType>;
|
|
24
|
+
private getMatterAccessory;
|
|
16
25
|
setAccessoryCharacteristic(uniqueId: string, characteristicType: string, value: number | boolean | string): Promise<ServiceType>;
|
|
17
26
|
getAccessoryLayout(username: string): Promise<any>;
|
|
18
27
|
saveAccessoryLayout(user: string, layout: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
19
28
|
resetInstancePool(): void;
|
|
29
|
+
private parseMatterUniqueId;
|
|
30
|
+
private buildMatterUniqueId;
|
|
31
|
+
private waitForMatterEvent;
|
|
32
|
+
private startMatterMonitoring;
|
|
33
|
+
private stopMatterMonitoring;
|
|
34
|
+
private loadMatterAccessories;
|
|
35
|
+
private transformMatterAccessory;
|
|
36
|
+
private handleMatterStateUpdate;
|
|
37
|
+
private handleMatterControl;
|
|
20
38
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,25 +7,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
var
|
|
12
|
-
return (
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const logger_service_1 = require("../../core/logger/logger.service");
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { HapClient } from '@homebridge/hap-client';
|
|
15
|
+
import { BadRequestException, Inject, Injectable } from '@nestjs/common';
|
|
16
|
+
import { mkdirp, pathExists, readJson, writeJsonSync } from 'fs-extra/esm';
|
|
17
|
+
import NodeCache from 'node-cache';
|
|
18
|
+
import { ConfigService } from '../../core/config/config.service.js';
|
|
19
|
+
import { HomebridgeIpcService } from '../../core/homebridge-ipc/homebridge-ipc.service.js';
|
|
20
|
+
import { Logger } from '../../core/logger/logger.service.js';
|
|
23
21
|
let AccessoriesService = class AccessoriesService {
|
|
24
|
-
|
|
22
|
+
configService;
|
|
23
|
+
logger;
|
|
24
|
+
homebridgeIpcService;
|
|
25
|
+
hapClient;
|
|
26
|
+
accessoriesCache = new NodeCache({ stdTTL: 0 });
|
|
27
|
+
matterMonitoringActive = false;
|
|
28
|
+
matterUpdateListener = null;
|
|
29
|
+
activeClients = new Set();
|
|
30
|
+
matterAccessories = [];
|
|
31
|
+
constructor(configService, logger, homebridgeIpcService) {
|
|
25
32
|
this.configService = configService;
|
|
26
33
|
this.logger = logger;
|
|
27
|
-
this.
|
|
34
|
+
this.homebridgeIpcService = homebridgeIpcService;
|
|
28
35
|
if (this.configService.homebridgeInsecureMode) {
|
|
29
|
-
this.hapClient = new
|
|
36
|
+
this.hapClient = new HapClient({
|
|
30
37
|
pin: this.configService.homebridgeConfig.bridge.pin,
|
|
31
38
|
logger: this.logger,
|
|
32
39
|
config: this.configService.ui.accessoryControl || {},
|
|
@@ -38,6 +45,10 @@ let AccessoriesService = class AccessoriesService {
|
|
|
38
45
|
this.logger.error('Homebridge must be running in insecure mode to control accessories.');
|
|
39
46
|
return;
|
|
40
47
|
}
|
|
48
|
+
this.activeClients.add(client);
|
|
49
|
+
if (this.activeClients.size === 1) {
|
|
50
|
+
await this.startMatterMonitoring();
|
|
51
|
+
}
|
|
41
52
|
let services;
|
|
42
53
|
const loadAllAccessories = async (refresh) => {
|
|
43
54
|
if (!refresh) {
|
|
@@ -46,26 +57,48 @@ let AccessoriesService = class AccessoriesService {
|
|
|
46
57
|
client.emit('accessories-data', cached);
|
|
47
58
|
}
|
|
48
59
|
}
|
|
49
|
-
|
|
50
|
-
this.refreshCharacteristics(
|
|
60
|
+
const hapServices = await this.loadAccessories();
|
|
61
|
+
this.refreshCharacteristics(hapServices);
|
|
62
|
+
client.emit('hap-accessories-ready-for-control');
|
|
63
|
+
client.emit('accessories-data', hapServices);
|
|
64
|
+
const matterServices = await this.loadMatterAccessories();
|
|
65
|
+
client.emit('matter-accessories-ready-for-control');
|
|
66
|
+
if (matterServices.length > 0) {
|
|
67
|
+
client.emit('accessories-data', matterServices);
|
|
68
|
+
}
|
|
69
|
+
services = [...hapServices, ...matterServices];
|
|
51
70
|
client.emit('accessories-ready-for-control');
|
|
52
|
-
client.emit('accessories-data', services);
|
|
53
71
|
this.accessoriesCache.set('services', services);
|
|
54
72
|
};
|
|
55
73
|
await loadAllAccessories(false);
|
|
56
74
|
const requestHandler = async (msg) => {
|
|
57
|
-
if (msg.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
if (msg.refresh) {
|
|
76
|
+
await loadAllAccessories(true);
|
|
77
|
+
}
|
|
78
|
+
else if (msg.set) {
|
|
79
|
+
if (msg.set.uniqueId && msg.set.uniqueId.startsWith('matter:')) {
|
|
80
|
+
if (msg.set.cluster && msg.set.attributes) {
|
|
81
|
+
await this.handleMatterControl(client, {
|
|
82
|
+
uniqueId: msg.set.uniqueId,
|
|
83
|
+
cluster: msg.set.cluster,
|
|
84
|
+
attributes: msg.set.attributes,
|
|
85
|
+
});
|
|
66
86
|
}
|
|
67
|
-
|
|
68
|
-
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const service = services.find(x => x.uniqueId === msg.set.uniqueId);
|
|
90
|
+
if (service && 'serviceCharacteristics' in service) {
|
|
91
|
+
try {
|
|
92
|
+
await service.setCharacteristic(msg.set.iid, msg.set.value);
|
|
93
|
+
const hapServices = await this.loadAccessories();
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
this.refreshCharacteristics(hapServices);
|
|
96
|
+
}, 1500);
|
|
97
|
+
services = [...hapServices, ...this.matterAccessories];
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
client.emit('accessory-control-failure', e.message);
|
|
101
|
+
}
|
|
69
102
|
}
|
|
70
103
|
}
|
|
71
104
|
}
|
|
@@ -76,7 +109,7 @@ let AccessoriesService = class AccessoriesService {
|
|
|
76
109
|
client.emit('accessories-data', data);
|
|
77
110
|
};
|
|
78
111
|
monitor.on('service-update', updateHandler);
|
|
79
|
-
const instanceUpdateHandler = async (
|
|
112
|
+
const instanceUpdateHandler = async () => {
|
|
80
113
|
client.emit('accessories-reload-required', services);
|
|
81
114
|
};
|
|
82
115
|
this.hapClient.on('instance-discovered', instanceUpdateHandler);
|
|
@@ -91,6 +124,10 @@ let AccessoriesService = class AccessoriesService {
|
|
|
91
124
|
monitor.removeAllListeners('service-update');
|
|
92
125
|
monitor.finish();
|
|
93
126
|
this.hapClient.removeListener('instance-discovered', instanceUpdateHandler);
|
|
127
|
+
this.activeClients.delete(client);
|
|
128
|
+
if (this.activeClients.size === 0) {
|
|
129
|
+
this.stopMatterMonitoring();
|
|
130
|
+
}
|
|
94
131
|
};
|
|
95
132
|
client.on('disconnect', onEnd.bind(this));
|
|
96
133
|
client.on('end', onEnd.bind(this));
|
|
@@ -105,7 +142,7 @@ let AccessoriesService = class AccessoriesService {
|
|
|
105
142
|
}
|
|
106
143
|
async loadAccessories() {
|
|
107
144
|
if (!this.configService.homebridgeInsecureMode) {
|
|
108
|
-
throw new
|
|
145
|
+
throw new BadRequestException('Homebridge must be running in insecure mode to access accessories.');
|
|
109
146
|
}
|
|
110
147
|
try {
|
|
111
148
|
return await this.hapClient.getAllServices();
|
|
@@ -121,46 +158,72 @@ let AccessoriesService = class AccessoriesService {
|
|
|
121
158
|
}
|
|
122
159
|
}
|
|
123
160
|
async getAccessory(uniqueId) {
|
|
161
|
+
if (uniqueId.startsWith('matter:')) {
|
|
162
|
+
return this.getMatterAccessory(uniqueId);
|
|
163
|
+
}
|
|
124
164
|
const services = await this.loadAccessories();
|
|
125
165
|
const service = services.find(x => x.uniqueId === uniqueId);
|
|
126
166
|
if (!service) {
|
|
127
|
-
throw new
|
|
167
|
+
throw new BadRequestException(`Service with uniqueId of '${uniqueId}' not found.`);
|
|
128
168
|
}
|
|
129
169
|
try {
|
|
130
170
|
await service.refreshCharacteristics();
|
|
131
171
|
return service;
|
|
132
172
|
}
|
|
133
173
|
catch (e) {
|
|
134
|
-
throw new
|
|
174
|
+
throw new BadRequestException(e.message);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async getMatterAccessory(uniqueId) {
|
|
178
|
+
try {
|
|
179
|
+
const { uuid, partId } = this.parseMatterUniqueId(uniqueId);
|
|
180
|
+
const response = await this.waitForMatterEvent('accessoryInfo', () => {
|
|
181
|
+
this.homebridgeIpcService.sendMessage('getMatterAccessoryInfo', { uuid });
|
|
182
|
+
});
|
|
183
|
+
if (response.error) {
|
|
184
|
+
throw new BadRequestException(response.error);
|
|
185
|
+
}
|
|
186
|
+
if (partId) {
|
|
187
|
+
const part = response.parts?.find((p) => p.id === partId);
|
|
188
|
+
if (part) {
|
|
189
|
+
return this.transformMatterAccessory(response, part);
|
|
190
|
+
}
|
|
191
|
+
throw new BadRequestException(`Part '${partId}' not found in accessory`);
|
|
192
|
+
}
|
|
193
|
+
return this.transformMatterAccessory(response);
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
this.logger.error(`Failed to get Matter accessory info for ${uniqueId}:`, error);
|
|
197
|
+
throw new BadRequestException(error.message || 'Failed to get Matter accessory info');
|
|
135
198
|
}
|
|
136
199
|
}
|
|
137
200
|
async setAccessoryCharacteristic(uniqueId, characteristicType, value) {
|
|
138
201
|
const services = await this.loadAccessories();
|
|
139
202
|
const service = services.find(x => x.uniqueId === uniqueId);
|
|
140
203
|
if (!service) {
|
|
141
|
-
throw new
|
|
204
|
+
throw new BadRequestException(`Service with uniqueId of '${uniqueId}' not found.`);
|
|
142
205
|
}
|
|
143
206
|
const characteristic = service.getCharacteristic(characteristicType);
|
|
144
207
|
if (!characteristic || !characteristic.canWrite) {
|
|
145
208
|
const types = service.serviceCharacteristics.filter(x => x.canWrite).map(x => `'${x.type}'`).join(', ');
|
|
146
|
-
throw new
|
|
209
|
+
throw new BadRequestException(`Invalid characteristicType. Valid types are: ${types}.`);
|
|
147
210
|
}
|
|
148
211
|
if (['uint8', 'uint16', 'uint32', 'uint64'].includes(characteristic.format)) {
|
|
149
212
|
value = Number.parseInt(value, 10);
|
|
150
213
|
if (characteristic.minValue !== undefined && value < characteristic.minValue) {
|
|
151
|
-
throw new
|
|
214
|
+
throw new BadRequestException(`Invalid value. The value must be between ${characteristic.minValue} and ${characteristic.maxValue}.`);
|
|
152
215
|
}
|
|
153
216
|
if (characteristic.maxValue !== undefined && value > characteristic.maxValue) {
|
|
154
|
-
throw new
|
|
217
|
+
throw new BadRequestException(`Invalid value. The value must be between ${characteristic.minValue} and ${characteristic.maxValue}.`);
|
|
155
218
|
}
|
|
156
219
|
}
|
|
157
220
|
if (characteristic.format === 'float') {
|
|
158
221
|
value = Number.parseFloat(value);
|
|
159
222
|
if (characteristic.minValue !== undefined && value < characteristic.minValue) {
|
|
160
|
-
throw new
|
|
223
|
+
throw new BadRequestException(`Invalid value. The value must be between ${characteristic.minValue} and ${characteristic.maxValue}.`);
|
|
161
224
|
}
|
|
162
225
|
if (characteristic.maxValue !== undefined && value > characteristic.maxValue) {
|
|
163
|
-
throw new
|
|
226
|
+
throw new BadRequestException(`Invalid value. The value must be between ${characteristic.minValue} and ${characteristic.maxValue}.`);
|
|
164
227
|
}
|
|
165
228
|
}
|
|
166
229
|
if (characteristic.format === 'bool') {
|
|
@@ -176,7 +239,7 @@ let AccessoriesService = class AccessoriesService {
|
|
|
176
239
|
value = value === 1;
|
|
177
240
|
}
|
|
178
241
|
if (typeof value !== 'boolean') {
|
|
179
|
-
throw new
|
|
242
|
+
throw new BadRequestException('Invalid value. The value must be a boolean (true or false).');
|
|
180
243
|
}
|
|
181
244
|
}
|
|
182
245
|
try {
|
|
@@ -185,12 +248,12 @@ let AccessoriesService = class AccessoriesService {
|
|
|
185
248
|
return service;
|
|
186
249
|
}
|
|
187
250
|
catch (e) {
|
|
188
|
-
throw new
|
|
251
|
+
throw new BadRequestException(e.message);
|
|
189
252
|
}
|
|
190
253
|
}
|
|
191
254
|
async getAccessoryLayout(username) {
|
|
192
255
|
try {
|
|
193
|
-
const accessoryLayout = await
|
|
256
|
+
const accessoryLayout = await readJson(this.configService.accessoryLayoutPath);
|
|
194
257
|
if (username in accessoryLayout) {
|
|
195
258
|
return accessoryLayout[username];
|
|
196
259
|
}
|
|
@@ -210,16 +273,16 @@ let AccessoriesService = class AccessoriesService {
|
|
|
210
273
|
async saveAccessoryLayout(user, layout) {
|
|
211
274
|
let accessoryLayout;
|
|
212
275
|
try {
|
|
213
|
-
accessoryLayout = await
|
|
276
|
+
accessoryLayout = await readJson(this.configService.accessoryLayoutPath);
|
|
214
277
|
}
|
|
215
278
|
catch (e) {
|
|
216
279
|
accessoryLayout = {};
|
|
217
280
|
}
|
|
218
|
-
if (!await
|
|
219
|
-
await
|
|
281
|
+
if (!await pathExists(join(this.configService.storagePath, 'accessories'))) {
|
|
282
|
+
await mkdirp(join(this.configService.storagePath, 'accessories'));
|
|
220
283
|
}
|
|
221
284
|
accessoryLayout[user] = layout;
|
|
222
|
-
|
|
285
|
+
writeJsonSync(this.configService.accessoryLayoutPath, accessoryLayout);
|
|
223
286
|
this.logger.log(`Accessory layout changes saved for ${user}.`);
|
|
224
287
|
return layout;
|
|
225
288
|
}
|
|
@@ -228,11 +291,213 @@ let AccessoriesService = class AccessoriesService {
|
|
|
228
291
|
this.hapClient.resetInstancePool();
|
|
229
292
|
}
|
|
230
293
|
}
|
|
294
|
+
parseMatterUniqueId(uniqueId) {
|
|
295
|
+
const parts = uniqueId.replace('matter:', '').split(':');
|
|
296
|
+
return {
|
|
297
|
+
uuid: parts[0],
|
|
298
|
+
partId: parts[1],
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
buildMatterUniqueId(uuid, partId) {
|
|
302
|
+
return partId ? `matter:${uuid}:${partId}` : `matter:${uuid}`;
|
|
303
|
+
}
|
|
304
|
+
async waitForMatterEvent(eventType, sendRequest) {
|
|
305
|
+
return new Promise((resolve, reject) => {
|
|
306
|
+
const actionTimeout = setTimeout(() => {
|
|
307
|
+
this.homebridgeIpcService.removeListener('matterEvent', listener);
|
|
308
|
+
reject(new Error('The Homebridge service did not respond'));
|
|
309
|
+
}, 3000);
|
|
310
|
+
const listener = (event) => {
|
|
311
|
+
if (event.type === eventType) {
|
|
312
|
+
clearTimeout(actionTimeout);
|
|
313
|
+
this.homebridgeIpcService.removeListener('matterEvent', listener);
|
|
314
|
+
resolve(event.data);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
this.homebridgeIpcService.on('matterEvent', listener);
|
|
318
|
+
sendRequest();
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
async startMatterMonitoring() {
|
|
322
|
+
if (this.matterMonitoringActive) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
try {
|
|
326
|
+
this.logger.debug('Starting Matter accessory monitoring');
|
|
327
|
+
this.homebridgeIpcService.sendMessage('startMatterMonitoring');
|
|
328
|
+
this.matterMonitoringActive = true;
|
|
329
|
+
this.matterUpdateListener = (event) => {
|
|
330
|
+
switch (event.type) {
|
|
331
|
+
case 'accessoryUpdate':
|
|
332
|
+
if (event.data && 'uuid' in event.data && 'cluster' in event.data) {
|
|
333
|
+
this.handleMatterStateUpdate(event.data);
|
|
334
|
+
}
|
|
335
|
+
break;
|
|
336
|
+
case 'accessoryAdded':
|
|
337
|
+
case 'accessoryRemoved':
|
|
338
|
+
if (event.data && 'uuid' in event.data) {
|
|
339
|
+
this.logger.debug(`Matter accessory ${event.type}: ${event.data.uuid} - triggering reload`);
|
|
340
|
+
}
|
|
341
|
+
for (const client of this.activeClients) {
|
|
342
|
+
client.emit('matter-accessories-reload-required');
|
|
343
|
+
}
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
this.homebridgeIpcService.on('matterEvent', this.matterUpdateListener);
|
|
348
|
+
this.logger.debug('Matter monitoring started successfully');
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
this.logger.error('Failed to start Matter monitoring:', error);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
async stopMatterMonitoring() {
|
|
355
|
+
if (!this.matterMonitoringActive) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
this.logger.debug('Stopping Matter accessory monitoring');
|
|
360
|
+
if (this.matterUpdateListener) {
|
|
361
|
+
this.homebridgeIpcService.removeListener('matterEvent', this.matterUpdateListener);
|
|
362
|
+
this.matterUpdateListener = null;
|
|
363
|
+
}
|
|
364
|
+
this.homebridgeIpcService.sendMessage('stopMatterMonitoring');
|
|
365
|
+
this.matterMonitoringActive = false;
|
|
366
|
+
this.matterAccessories = [];
|
|
367
|
+
this.logger.debug('Matter monitoring stopped');
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
this.logger.error('Failed to stop Matter monitoring:', error);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
async loadMatterAccessories() {
|
|
374
|
+
if (!this.matterMonitoringActive) {
|
|
375
|
+
this.logger.warn('Matter monitoring not active, skipping accessory load');
|
|
376
|
+
return [];
|
|
377
|
+
}
|
|
378
|
+
try {
|
|
379
|
+
const response = await this.waitForMatterEvent('accessoriesData', () => {
|
|
380
|
+
this.homebridgeIpcService.sendMessage('getMatterAccessories', {});
|
|
381
|
+
});
|
|
382
|
+
if (response.error) {
|
|
383
|
+
throw new Error(response.error);
|
|
384
|
+
}
|
|
385
|
+
const accessories = response.accessories || [];
|
|
386
|
+
this.logger.debug(`Loaded ${accessories.length} Matter accessories from IPC`);
|
|
387
|
+
const matterServices = accessories.flatMap((accessory) => {
|
|
388
|
+
const services = [];
|
|
389
|
+
services.push({
|
|
390
|
+
...this.transformMatterAccessory(accessory),
|
|
391
|
+
protocol: 'matter',
|
|
392
|
+
});
|
|
393
|
+
if (accessory.parts) {
|
|
394
|
+
for (const part of accessory.parts) {
|
|
395
|
+
services.push({
|
|
396
|
+
...this.transformMatterAccessory(accessory, part),
|
|
397
|
+
protocol: 'matter',
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return services;
|
|
402
|
+
});
|
|
403
|
+
this.logger.debug(`Transformed ${matterServices.length} Matter services (including parts)`);
|
|
404
|
+
this.matterAccessories = matterServices;
|
|
405
|
+
return matterServices;
|
|
406
|
+
}
|
|
407
|
+
catch (error) {
|
|
408
|
+
this.logger.error('Failed to load Matter accessories:', error);
|
|
409
|
+
return [];
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
transformMatterAccessory(accessory, part) {
|
|
413
|
+
const targetClusters = part?.clusters || accessory.clusters;
|
|
414
|
+
const displayName = part
|
|
415
|
+
? `${accessory.displayName} - ${part.displayName}`
|
|
416
|
+
: accessory.displayName;
|
|
417
|
+
const uniqueId = part
|
|
418
|
+
? `matter:${accessory.uuid}:${part.id}`
|
|
419
|
+
: `matter:${accessory.uuid}`;
|
|
420
|
+
const deviceType = part?.deviceType || accessory.deviceType;
|
|
421
|
+
const bridgeUsername = accessory.bridge?.username || 'unknown';
|
|
422
|
+
if (bridgeUsername === 'unknown') {
|
|
423
|
+
this.logger.warn(`Matter accessory '${displayName}' (${uniqueId}) has no bridge.username - layout may not persist correctly`);
|
|
424
|
+
}
|
|
425
|
+
return {
|
|
426
|
+
uniqueId,
|
|
427
|
+
uuid: accessory.uuid,
|
|
428
|
+
serviceName: displayName,
|
|
429
|
+
displayName,
|
|
430
|
+
deviceType,
|
|
431
|
+
clusters: targetClusters,
|
|
432
|
+
partId: part?.id,
|
|
433
|
+
protocol: 'matter',
|
|
434
|
+
instance: {
|
|
435
|
+
name: accessory.bridge?.name || 'Matter Bridge',
|
|
436
|
+
username: bridgeUsername,
|
|
437
|
+
},
|
|
438
|
+
accessoryInformation: {
|
|
439
|
+
'Name': displayName,
|
|
440
|
+
'Manufacturer': accessory.manufacturer || 'Unknown',
|
|
441
|
+
'Model': accessory.model || deviceType,
|
|
442
|
+
'Serial Number': accessory.serialNumber || accessory.uuid,
|
|
443
|
+
'Firmware Revision': accessory.firmwareRevision || '1.0.0',
|
|
444
|
+
},
|
|
445
|
+
bridge: accessory.bridge,
|
|
446
|
+
plugin: accessory.plugin,
|
|
447
|
+
platform: accessory.platform,
|
|
448
|
+
commissioned: accessory.commissioned,
|
|
449
|
+
fabricCount: accessory.fabricCount,
|
|
450
|
+
fabrics: accessory.fabrics,
|
|
451
|
+
aid: 0,
|
|
452
|
+
iid: 0,
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
handleMatterStateUpdate(data) {
|
|
456
|
+
const uniqueId = this.buildMatterUniqueId(data.uuid, data.partId);
|
|
457
|
+
const service = this.matterAccessories.find(s => s.uniqueId === uniqueId);
|
|
458
|
+
if (!service) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
service.clusters[data.cluster] = {
|
|
462
|
+
...service.clusters[data.cluster],
|
|
463
|
+
...data.state,
|
|
464
|
+
};
|
|
465
|
+
for (const client of this.activeClients) {
|
|
466
|
+
client.emit('accessories-data', [service]);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
async handleMatterControl(client, control) {
|
|
470
|
+
try {
|
|
471
|
+
const { uuid, partId } = this.parseMatterUniqueId(control.uniqueId);
|
|
472
|
+
const accessory = this.matterAccessories.find(acc => acc.uuid === uuid);
|
|
473
|
+
const bridgeUsername = accessory?.bridge?.username;
|
|
474
|
+
const response = await this.waitForMatterEvent('accessoryControlResponse', () => {
|
|
475
|
+
this.homebridgeIpcService.sendMessage('matterAccessoryControl', {
|
|
476
|
+
uuid,
|
|
477
|
+
cluster: control.cluster,
|
|
478
|
+
attributes: control.attributes,
|
|
479
|
+
bridgeUsername,
|
|
480
|
+
partId,
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
if (!response.success) {
|
|
484
|
+
client.emit('accessory-control-failure', response.error || 'Matter control failed');
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
catch (error) {
|
|
488
|
+
this.logger.error('Matter control failed:', error);
|
|
489
|
+
client.emit('accessory-control-failure', error.message || 'Matter control failed');
|
|
490
|
+
}
|
|
491
|
+
}
|
|
231
492
|
};
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
(0,
|
|
235
|
-
|
|
236
|
-
|
|
493
|
+
AccessoriesService = __decorate([
|
|
494
|
+
Injectable(),
|
|
495
|
+
__param(0, Inject(ConfigService)),
|
|
496
|
+
__param(1, Inject(Logger)),
|
|
497
|
+
__param(2, Inject(HomebridgeIpcService)),
|
|
498
|
+
__metadata("design:paramtypes", [ConfigService,
|
|
499
|
+
Logger,
|
|
500
|
+
HomebridgeIpcService])
|
|
237
501
|
], AccessoriesService);
|
|
502
|
+
export { AccessoriesService };
|
|
238
503
|
//# sourceMappingURL=accessories.service.js.map
|