@switchbot/homebridge-switchbot 5.0.0-beta.13 → 5.0.0-beta.130
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/.github/ISSUE_TEMPLATE/e2e-verification.md +36 -0
- package/.github/copilot-instructions.md +39 -0
- package/.github/workflows/ci.yml +32 -0
- package/.github/workflows/manual-e2e.yml +115 -0
- package/.github/workflows/release.yml +0 -4
- package/CHANGELOG.md +35 -0
- package/E2E-VERIFICATION.md +121 -0
- package/MIGRATION.md +54 -0
- package/README.md +99 -3
- package/TODO.md +263 -0
- package/config.schema.json +198 -14787
- package/dist/device-types.d.ts +31 -0
- package/dist/device-types.d.ts.map +1 -0
- package/dist/device-types.js +246 -0
- package/dist/device-types.js.map +1 -0
- package/dist/deviceFactory.d.ts +13 -0
- package/dist/deviceFactory.d.ts.map +1 -0
- package/dist/deviceFactory.js +146 -0
- package/dist/deviceFactory.js.map +1 -0
- package/dist/devices/deviceBase.d.ts +50 -0
- package/dist/devices/deviceBase.d.ts.map +1 -0
- package/dist/devices/deviceBase.js +119 -0
- package/dist/devices/deviceBase.js.map +1 -0
- package/dist/devices/genericDevice.d.ts +277 -0
- package/dist/devices/genericDevice.d.ts.map +1 -0
- package/dist/devices/genericDevice.js +1383 -0
- package/dist/devices/genericDevice.js.map +1 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +51 -0
- package/dist/errors.js.map +1 -0
- package/dist/homebridge-ui/endpoints/config.d.ts +3 -0
- package/dist/homebridge-ui/endpoints/config.d.ts.map +1 -0
- package/dist/homebridge-ui/endpoints/config.js +107 -0
- package/dist/homebridge-ui/endpoints/config.js.map +1 -0
- package/dist/homebridge-ui/endpoints/credentials.d.ts +6 -0
- package/dist/homebridge-ui/endpoints/credentials.d.ts.map +1 -0
- package/dist/homebridge-ui/endpoints/credentials.js +65 -0
- package/dist/homebridge-ui/endpoints/credentials.js.map +1 -0
- package/dist/homebridge-ui/endpoints/devices.d.ts +6 -0
- package/dist/homebridge-ui/endpoints/devices.d.ts.map +1 -0
- package/dist/homebridge-ui/endpoints/devices.js +430 -0
- package/dist/homebridge-ui/endpoints/devices.js.map +1 -0
- package/dist/homebridge-ui/endpoints/discovery.d.ts +7 -0
- package/dist/homebridge-ui/endpoints/discovery.d.ts.map +1 -0
- package/dist/homebridge-ui/endpoints/discovery.js +212 -0
- package/dist/homebridge-ui/endpoints/discovery.js.map +1 -0
- package/dist/homebridge-ui/public/css/styles.css +447 -0
- package/dist/homebridge-ui/public/index.html +144 -248
- package/dist/homebridge-ui/public/js/api.d.ts +62 -0
- package/dist/homebridge-ui/public/js/api.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/api.js +225 -0
- package/dist/homebridge-ui/public/js/api.js.map +1 -0
- package/dist/homebridge-ui/public/js/api.ts +279 -0
- package/dist/homebridge-ui/public/js/app.d.ts +2 -0
- package/dist/homebridge-ui/public/js/app.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/app.js +3600 -0
- package/dist/homebridge-ui/public/js/app.js.map +7 -0
- package/dist/homebridge-ui/public/js/app.ts +23 -0
- package/dist/homebridge-ui/public/js/constants.d.ts +2 -0
- package/dist/homebridge-ui/public/js/constants.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/constants.js +2 -0
- package/dist/homebridge-ui/public/js/constants.js.map +1 -0
- package/dist/homebridge-ui/public/js/constants.ts +1 -0
- package/dist/homebridge-ui/public/js/credentials.d.ts +3 -0
- package/dist/homebridge-ui/public/js/credentials.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/credentials.js +96 -0
- package/dist/homebridge-ui/public/js/credentials.js.map +1 -0
- package/dist/homebridge-ui/public/js/credentials.ts +100 -0
- package/dist/homebridge-ui/public/js/devices-delete.d.ts +3 -0
- package/dist/homebridge-ui/public/js/devices-delete.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/devices-delete.js +206 -0
- package/dist/homebridge-ui/public/js/devices-delete.js.map +1 -0
- package/dist/homebridge-ui/public/js/devices-delete.ts +236 -0
- package/dist/homebridge-ui/public/js/devices.d.ts +9 -0
- package/dist/homebridge-ui/public/js/devices.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/devices.js +94 -0
- package/dist/homebridge-ui/public/js/devices.js.map +1 -0
- package/dist/homebridge-ui/public/js/devices.ts +114 -0
- package/dist/homebridge-ui/public/js/discovery.d.ts +4 -0
- package/dist/homebridge-ui/public/js/discovery.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/discovery.js +1364 -0
- package/dist/homebridge-ui/public/js/discovery.js.map +1 -0
- package/dist/homebridge-ui/public/js/discovery.ts +1492 -0
- package/dist/homebridge-ui/public/js/logger.d.ts +6 -0
- package/dist/homebridge-ui/public/js/logger.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/logger.js +12 -0
- package/dist/homebridge-ui/public/js/logger.js.map +1 -0
- package/dist/homebridge-ui/public/js/logger.ts +11 -0
- package/dist/homebridge-ui/public/js/modal.d.ts +5 -0
- package/dist/homebridge-ui/public/js/modal.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/modal.js +26 -0
- package/dist/homebridge-ui/public/js/modal.js.map +1 -0
- package/dist/homebridge-ui/public/js/modal.ts +28 -0
- package/dist/homebridge-ui/public/js/modals.d.ts +7 -0
- package/dist/homebridge-ui/public/js/modals.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/modals.js +494 -0
- package/dist/homebridge-ui/public/js/modals.js.map +1 -0
- package/dist/homebridge-ui/public/js/modals.ts +546 -0
- package/dist/homebridge-ui/public/js/render.d.ts +68 -0
- package/dist/homebridge-ui/public/js/render.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/render.js +914 -0
- package/dist/homebridge-ui/public/js/render.js.map +1 -0
- package/dist/homebridge-ui/public/js/render.ts +1026 -0
- package/dist/homebridge-ui/public/js/toast.d.ts +6 -0
- package/dist/homebridge-ui/public/js/toast.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/toast.js +29 -0
- package/dist/homebridge-ui/public/js/toast.js.map +1 -0
- package/dist/homebridge-ui/public/js/toast.ts +37 -0
- package/dist/homebridge-ui/public/js/types.d.ts +23 -0
- package/dist/homebridge-ui/public/js/types.d.ts.map +1 -0
- package/dist/homebridge-ui/public/js/types.js +2 -0
- package/dist/homebridge-ui/public/js/types.js.map +1 -0
- package/dist/homebridge-ui/public/js/types.ts +26 -0
- package/dist/homebridge-ui/server.js +11 -41
- package/dist/homebridge-ui/server.js.map +1 -1
- package/dist/homebridge-ui/utils/config-parser.d.ts +35 -0
- package/dist/homebridge-ui/utils/config-parser.d.ts.map +1 -0
- package/dist/homebridge-ui/utils/config-parser.js +87 -0
- package/dist/homebridge-ui/utils/config-parser.js.map +1 -0
- package/dist/homebridge-ui/utils/device-migration.d.ts +35 -0
- package/dist/homebridge-ui/utils/device-migration.d.ts.map +1 -0
- package/dist/homebridge-ui/utils/device-migration.js +111 -0
- package/dist/homebridge-ui/utils/device-migration.js.map +1 -0
- package/dist/homebridge-ui/utils/logger.d.ts +7 -0
- package/dist/homebridge-ui/utils/logger.d.ts.map +1 -0
- package/dist/homebridge-ui/utils/logger.js +17 -0
- package/dist/homebridge-ui/utils/logger.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/platform.d.ts +39 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +1570 -0
- package/dist/platform.js.map +1 -0
- package/dist/settings.d.ts +10 -249
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +5 -30
- package/dist/settings.js.map +1 -1
- package/dist/switchbotClient.d.ts +32 -0
- package/dist/switchbotClient.d.ts.map +1 -0
- package/dist/switchbotClient.js +253 -0
- package/dist/switchbotClient.js.map +1 -0
- package/dist/utils.d.ts +36 -82
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +40 -786
- package/dist/utils.js.map +1 -1
- package/docs/assets/highlight.css +21 -0
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/style.css +3 -3
- package/docs/index.html +103 -13
- package/docs/variables/default.html +1 -1
- package/eslint.config.js +7 -8
- package/nodemon.json +2 -2
- package/package.json +36 -32
- package/scripts/build-ui.js +36 -0
- package/scripts/e2e/README.md +25 -0
- package/scripts/e2e/curtain-e2e.sh +70 -0
- package/scripts/e2e/fan-e2e.sh +75 -0
- package/scripts/e2e/light-advanced-e2e.sh +97 -0
- package/scripts/e2e/light-e2e.sh +75 -0
- package/scripts/e2e/list-accessories.sh +19 -0
- package/scripts/e2e/lock-e2e.sh +65 -0
- package/scripts/free-dev-ports.mjs +105 -0
- package/scripts/generate-matter-maps.js +60 -0
- package/scripts/run-e2e-local.sh +14 -0
- package/scripts/sync-device-types.mjs +28 -0
- package/src/device-types.ts +261 -0
- package/src/deviceFactory.ts +190 -0
- package/src/devices/deviceBase.ts +141 -0
- package/src/devices/genericDevice.ts +1333 -0
- package/src/errors.ts +43 -0
- package/src/homebridge-ui/endpoints/config.ts +126 -0
- package/src/homebridge-ui/endpoints/credentials.ts +74 -0
- package/src/homebridge-ui/endpoints/devices.ts +464 -0
- package/src/homebridge-ui/endpoints/discovery.ts +233 -0
- package/src/homebridge-ui/public/css/styles.css +447 -0
- package/src/homebridge-ui/public/index.html +144 -248
- package/src/homebridge-ui/public/js/api.ts +279 -0
- package/src/homebridge-ui/public/js/app.ts +23 -0
- package/src/homebridge-ui/public/js/constants.ts +1 -0
- package/src/homebridge-ui/public/js/credentials.ts +100 -0
- package/src/homebridge-ui/public/js/devices-delete.ts +236 -0
- package/src/homebridge-ui/public/js/devices.ts +114 -0
- package/src/homebridge-ui/public/js/discovery.ts +1492 -0
- package/src/homebridge-ui/public/js/logger.ts +11 -0
- package/src/homebridge-ui/public/js/modal.ts +28 -0
- package/src/homebridge-ui/public/js/modals.ts +546 -0
- package/src/homebridge-ui/public/js/render.ts +1026 -0
- package/src/homebridge-ui/public/js/toast.ts +37 -0
- package/src/homebridge-ui/public/js/types.ts +26 -0
- package/src/homebridge-ui/server.ts +11 -43
- package/src/homebridge-ui/utils/config-parser.ts +108 -0
- package/src/homebridge-ui/utils/device-migration.ts +144 -0
- package/src/homebridge-ui/utils/logger.ts +17 -0
- package/src/index.ts +1 -3
- package/src/platform.ts +1585 -0
- package/src/settings.ts +12 -277
- package/src/switchbotClient.ts +251 -0
- package/src/utils.ts +48 -812
- package/test/accessory-restore.spec.ts +73 -0
- package/test/device-mapping.spec.ts +37 -0
- package/test/deviceFactory.spec.ts +18 -0
- package/test/e2e/run-e2e.spec.ts +52 -0
- package/test/fan-swing.spec.ts +29 -0
- package/test/helpers/matter-harness.ts +53 -0
- package/test/lock-users.spec.ts +44 -0
- package/test/matter-childbridge.spec.ts +59 -0
- package/test/matter-descriptors.spec.ts +97 -0
- package/test/matter-device-state.spec.ts +101 -0
- package/test/matter-integration.spec.ts +136 -0
- package/test/platform.integration.spec.ts +55 -0
- package/test/switchbot-client-debounce.spec.ts +131 -0
- package/test/switchbot-client-openapi.spec.ts +56 -0
- package/test/switchbotClient.spec.ts +10 -0
- package/test/utils.spec.ts +36 -0
- package/todo/COMPLETED.md +542 -0
- package/todo/README.md +59 -0
- package/todo/TODO.md +190 -0
- package/todo/mockups/filtering-sorting.svg +112 -0
- package/todo/mockups/modal-switchbot-theme.svg +66 -0
- package/todo/mockups/signal-strength-visualization.svg +94 -0
- package/vitest.config.ts +7 -0
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -15847
- package/coverage/coverage-final.json +0 -42
- package/coverage/docs/assets/dmt/dmt-component-data.js.html +0 -85
- package/coverage/docs/assets/dmt/dmt-components.js.html +0 -286
- package/coverage/docs/assets/dmt/index.html +0 -131
- package/coverage/docs/assets/hierarchy.js.html +0 -85
- package/coverage/docs/assets/icons.js.html +0 -136
- package/coverage/docs/assets/index.html +0 -146
- package/coverage/docs/assets/main.js.html +0 -265
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -191
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/src/device/blindtilt.ts.html +0 -3238
- package/coverage/src/device/bot.ts.html +0 -2803
- package/coverage/src/device/ceilinglight.ts.html +0 -2338
- package/coverage/src/device/colorbulb.ts.html +0 -2824
- package/coverage/src/device/contact.ts.html +0 -1465
- package/coverage/src/device/curtain.ts.html +0 -2869
- package/coverage/src/device/device.ts.html +0 -2500
- package/coverage/src/device/fan.ts.html +0 -2242
- package/coverage/src/device/hub.ts.html +0 -1408
- package/coverage/src/device/humidifier.ts.html +0 -2116
- package/coverage/src/device/index.html +0 -416
- package/coverage/src/device/iosensor.ts.html +0 -1375
- package/coverage/src/device/lightstrip.ts.html +0 -2617
- package/coverage/src/device/lock.ts.html +0 -1963
- package/coverage/src/device/meter.ts.html +0 -1372
- package/coverage/src/device/meterplus.ts.html +0 -1384
- package/coverage/src/device/meterpro.ts.html +0 -1618
- package/coverage/src/device/motion.ts.html +0 -1264
- package/coverage/src/device/plug.ts.html +0 -1372
- package/coverage/src/device/relayswitch.ts.html +0 -2284
- package/coverage/src/device/robotvacuumcleaner.ts.html +0 -1810
- package/coverage/src/device/waterdetector.ts.html +0 -1294
- package/coverage/src/homebridge-ui/index.html +0 -116
- package/coverage/src/homebridge-ui/server.ts.html +0 -229
- package/coverage/src/index.html +0 -161
- package/coverage/src/index.ts.html +0 -124
- package/coverage/src/irdevice/airconditioner.ts.html +0 -1687
- package/coverage/src/irdevice/airpurifier.ts.html +0 -844
- package/coverage/src/irdevice/camera.ts.html +0 -475
- package/coverage/src/irdevice/fan.ts.html +0 -766
- package/coverage/src/irdevice/index.html +0 -251
- package/coverage/src/irdevice/irdevice.ts.html +0 -1117
- package/coverage/src/irdevice/light.ts.html +0 -826
- package/coverage/src/irdevice/other.ts.html +0 -2458
- package/coverage/src/irdevice/tv.ts.html +0 -1222
- package/coverage/src/irdevice/vacuumcleaner.ts.html +0 -466
- package/coverage/src/irdevice/waterheater.ts.html +0 -469
- package/coverage/src/platform.ts.html +0 -8776
- package/coverage/src/settings.ts.html +0 -934
- package/coverage/src/utils.ts.html +0 -2092
- package/dist/baseMatterAccessory.test.d.ts +0 -2
- package/dist/baseMatterAccessory.test.d.ts.map +0 -1
- package/dist/baseMatterAccessory.test.js +0 -71
- package/dist/baseMatterAccessory.test.js.map +0 -1
- package/dist/devices-hap/airpurifier.d.ts +0 -54
- package/dist/devices-hap/airpurifier.d.ts.map +0 -1
- package/dist/devices-hap/airpurifier.js +0 -527
- package/dist/devices-hap/airpurifier.js.map +0 -1
- package/dist/devices-hap/blindtilt.d.ts +0 -90
- package/dist/devices-hap/blindtilt.d.ts.map +0 -1
- package/dist/devices-hap/blindtilt.js +0 -974
- package/dist/devices-hap/blindtilt.js.map +0 -1
- package/dist/devices-hap/bot.d.ts +0 -102
- package/dist/devices-hap/bot.d.ts.map +0 -1
- package/dist/devices-hap/bot.js +0 -811
- package/dist/devices-hap/bot.js.map +0 -1
- package/dist/devices-hap/ceilinglight.d.ts +0 -85
- package/dist/devices-hap/ceilinglight.d.ts.map +0 -1
- package/dist/devices-hap/ceilinglight.js +0 -701
- package/dist/devices-hap/ceilinglight.js.map +0 -1
- package/dist/devices-hap/colorbulb.d.ts +0 -88
- package/dist/devices-hap/colorbulb.d.ts.map +0 -1
- package/dist/devices-hap/colorbulb.js +0 -881
- package/dist/devices-hap/colorbulb.js.map +0 -1
- package/dist/devices-hap/contact.d.ts +0 -44
- package/dist/devices-hap/contact.d.ts.map +0 -1
- package/dist/devices-hap/contact.js +0 -409
- package/dist/devices-hap/contact.js.map +0 -1
- package/dist/devices-hap/curtain.d.ts +0 -73
- package/dist/devices-hap/curtain.d.ts.map +0 -1
- package/dist/devices-hap/curtain.js +0 -869
- package/dist/devices-hap/curtain.js.map +0 -1
- package/dist/devices-hap/device.d.ts +0 -98
- package/dist/devices-hap/device.d.ts.map +0 -1
- package/dist/devices-hap/device.js +0 -749
- package/dist/devices-hap/device.js.map +0 -1
- package/dist/devices-hap/fan.d.ts +0 -69
- package/dist/devices-hap/fan.d.ts.map +0 -1
- package/dist/devices-hap/fan.js +0 -649
- package/dist/devices-hap/fan.js.map +0 -1
- package/dist/devices-hap/hub.d.ts +0 -37
- package/dist/devices-hap/hub.d.ts.map +0 -1
- package/dist/devices-hap/hub.js +0 -392
- package/dist/devices-hap/hub.js.map +0 -1
- package/dist/devices-hap/humidifier.d.ts +0 -68
- package/dist/devices-hap/humidifier.d.ts.map +0 -1
- package/dist/devices-hap/humidifier.js +0 -628
- package/dist/devices-hap/humidifier.js.map +0 -1
- package/dist/devices-hap/iosensor.d.ts +0 -42
- package/dist/devices-hap/iosensor.d.ts.map +0 -1
- package/dist/devices-hap/iosensor.js +0 -382
- package/dist/devices-hap/iosensor.js.map +0 -1
- package/dist/devices-hap/lightstrip.d.ts +0 -79
- package/dist/devices-hap/lightstrip.d.ts.map +0 -1
- package/dist/devices-hap/lightstrip.js +0 -797
- package/dist/devices-hap/lightstrip.js.map +0 -1
- package/dist/devices-hap/lock.d.ts +0 -53
- package/dist/devices-hap/lock.d.ts.map +0 -1
- package/dist/devices-hap/lock.js +0 -561
- package/dist/devices-hap/lock.js.map +0 -1
- package/dist/devices-hap/meter.d.ts +0 -37
- package/dist/devices-hap/meter.d.ts.map +0 -1
- package/dist/devices-hap/meter.js +0 -379
- package/dist/devices-hap/meter.js.map +0 -1
- package/dist/devices-hap/meterplus.d.ts +0 -42
- package/dist/devices-hap/meterplus.d.ts.map +0 -1
- package/dist/devices-hap/meterplus.js +0 -384
- package/dist/devices-hap/meterplus.js.map +0 -1
- package/dist/devices-hap/meterpro.d.ts +0 -43
- package/dist/devices-hap/meterpro.d.ts.map +0 -1
- package/dist/devices-hap/meterpro.js +0 -468
- package/dist/devices-hap/meterpro.js.map +0 -1
- package/dist/devices-hap/motion.d.ts +0 -42
- package/dist/devices-hap/motion.d.ts.map +0 -1
- package/dist/devices-hap/motion.js +0 -345
- package/dist/devices-hap/motion.js.map +0 -1
- package/dist/devices-hap/plug.d.ts +0 -49
- package/dist/devices-hap/plug.d.ts.map +0 -1
- package/dist/devices-hap/plug.js +0 -395
- package/dist/devices-hap/plug.js.map +0 -1
- package/dist/devices-hap/relayswitch.d.ts +0 -96
- package/dist/devices-hap/relayswitch.d.ts.map +0 -1
- package/dist/devices-hap/relayswitch.js +0 -642
- package/dist/devices-hap/relayswitch.js.map +0 -1
- package/dist/devices-hap/robotvacuumcleaner.d.ts +0 -54
- package/dist/devices-hap/robotvacuumcleaner.d.ts.map +0 -1
- package/dist/devices-hap/robotvacuumcleaner.js +0 -523
- package/dist/devices-hap/robotvacuumcleaner.js.map +0 -1
- package/dist/devices-hap/waterdetector.d.ts +0 -41
- package/dist/devices-hap/waterdetector.d.ts.map +0 -1
- package/dist/devices-hap/waterdetector.js +0 -356
- package/dist/devices-hap/waterdetector.js.map +0 -1
- package/dist/devices-matter/BaseMatterAccessory.d.ts +0 -78
- package/dist/devices-matter/BaseMatterAccessory.d.ts.map +0 -1
- package/dist/devices-matter/BaseMatterAccessory.js +0 -220
- package/dist/devices-matter/BaseMatterAccessory.js.map +0 -1
- package/dist/devices-matter/ColorLightAccessory.d.ts +0 -20
- package/dist/devices-matter/ColorLightAccessory.d.ts.map +0 -1
- package/dist/devices-matter/ColorLightAccessory.js +0 -95
- package/dist/devices-matter/ColorLightAccessory.js.map +0 -1
- package/dist/devices-matter/ColorTemperatureLightAccessory.d.ts +0 -18
- package/dist/devices-matter/ColorTemperatureLightAccessory.d.ts.map +0 -1
- package/dist/devices-matter/ColorTemperatureLightAccessory.js +0 -76
- package/dist/devices-matter/ColorTemperatureLightAccessory.js.map +0 -1
- package/dist/devices-matter/ContactSensorAccessory.d.ts +0 -12
- package/dist/devices-matter/ContactSensorAccessory.d.ts.map +0 -1
- package/dist/devices-matter/ContactSensorAccessory.js +0 -34
- package/dist/devices-matter/ContactSensorAccessory.js.map +0 -1
- package/dist/devices-matter/DimmableLightAccessory.d.ts +0 -58
- package/dist/devices-matter/DimmableLightAccessory.d.ts.map +0 -1
- package/dist/devices-matter/DimmableLightAccessory.js +0 -167
- package/dist/devices-matter/DimmableLightAccessory.js.map +0 -1
- package/dist/devices-matter/DoorLockAccessory.d.ts +0 -14
- package/dist/devices-matter/DoorLockAccessory.d.ts.map +0 -1
- package/dist/devices-matter/DoorLockAccessory.js +0 -50
- package/dist/devices-matter/DoorLockAccessory.js.map +0 -1
- package/dist/devices-matter/ExtendedColorLightAccessory.d.ts +0 -21
- package/dist/devices-matter/ExtendedColorLightAccessory.d.ts.map +0 -1
- package/dist/devices-matter/ExtendedColorLightAccessory.js +0 -106
- package/dist/devices-matter/ExtendedColorLightAccessory.js.map +0 -1
- package/dist/devices-matter/FanAccessory.d.ts +0 -16
- package/dist/devices-matter/FanAccessory.d.ts.map +0 -1
- package/dist/devices-matter/FanAccessory.js +0 -81
- package/dist/devices-matter/FanAccessory.js.map +0 -1
- package/dist/devices-matter/HumiditySensorAccessory.d.ts +0 -12
- package/dist/devices-matter/HumiditySensorAccessory.d.ts.map +0 -1
- package/dist/devices-matter/HumiditySensorAccessory.js +0 -34
- package/dist/devices-matter/HumiditySensorAccessory.js.map +0 -1
- package/dist/devices-matter/LeakSensorAccessory.d.ts +0 -12
- package/dist/devices-matter/LeakSensorAccessory.d.ts.map +0 -1
- package/dist/devices-matter/LeakSensorAccessory.js +0 -33
- package/dist/devices-matter/LeakSensorAccessory.js.map +0 -1
- package/dist/devices-matter/LightSensorAccessory.d.ts +0 -12
- package/dist/devices-matter/LightSensorAccessory.d.ts.map +0 -1
- package/dist/devices-matter/LightSensorAccessory.js +0 -34
- package/dist/devices-matter/LightSensorAccessory.js.map +0 -1
- package/dist/devices-matter/OccupancySensorAccessory.d.ts +0 -12
- package/dist/devices-matter/OccupancySensorAccessory.d.ts.map +0 -1
- package/dist/devices-matter/OccupancySensorAccessory.js +0 -39
- package/dist/devices-matter/OccupancySensorAccessory.js.map +0 -1
- package/dist/devices-matter/OnOffLightAccessory.d.ts +0 -38
- package/dist/devices-matter/OnOffLightAccessory.d.ts.map +0 -1
- package/dist/devices-matter/OnOffLightAccessory.js +0 -110
- package/dist/devices-matter/OnOffLightAccessory.js.map +0 -1
- package/dist/devices-matter/OnOffOutletAccessory.d.ts +0 -14
- package/dist/devices-matter/OnOffOutletAccessory.d.ts.map +0 -1
- package/dist/devices-matter/OnOffOutletAccessory.js +0 -43
- package/dist/devices-matter/OnOffOutletAccessory.js.map +0 -1
- package/dist/devices-matter/OnOffSwitchAccessory.d.ts +0 -14
- package/dist/devices-matter/OnOffSwitchAccessory.d.ts.map +0 -1
- package/dist/devices-matter/OnOffSwitchAccessory.js +0 -42
- package/dist/devices-matter/OnOffSwitchAccessory.js.map +0 -1
- package/dist/devices-matter/RoboticVacuumAccessory.d.ts +0 -68
- package/dist/devices-matter/RoboticVacuumAccessory.d.ts.map +0 -1
- package/dist/devices-matter/RoboticVacuumAccessory.js +0 -334
- package/dist/devices-matter/RoboticVacuumAccessory.js.map +0 -1
- package/dist/devices-matter/SmokeCOAlarmAccessory.d.ts +0 -11
- package/dist/devices-matter/SmokeCOAlarmAccessory.d.ts.map +0 -1
- package/dist/devices-matter/SmokeCOAlarmAccessory.js +0 -49
- package/dist/devices-matter/SmokeCOAlarmAccessory.js.map +0 -1
- package/dist/devices-matter/TemperatureSensorAccessory.d.ts +0 -12
- package/dist/devices-matter/TemperatureSensorAccessory.d.ts.map +0 -1
- package/dist/devices-matter/TemperatureSensorAccessory.js +0 -36
- package/dist/devices-matter/TemperatureSensorAccessory.js.map +0 -1
- package/dist/devices-matter/ThermostatAccessory.d.ts +0 -19
- package/dist/devices-matter/ThermostatAccessory.d.ts.map +0 -1
- package/dist/devices-matter/ThermostatAccessory.js +0 -95
- package/dist/devices-matter/ThermostatAccessory.js.map +0 -1
- package/dist/devices-matter/VenetianBlindAccessory.d.ts +0 -19
- package/dist/devices-matter/VenetianBlindAccessory.d.ts.map +0 -1
- package/dist/devices-matter/VenetianBlindAccessory.js +0 -99
- package/dist/devices-matter/VenetianBlindAccessory.js.map +0 -1
- package/dist/devices-matter/WindowBlindAccessory.d.ts +0 -17
- package/dist/devices-matter/WindowBlindAccessory.d.ts.map +0 -1
- package/dist/devices-matter/WindowBlindAccessory.js +0 -80
- package/dist/devices-matter/WindowBlindAccessory.js.map +0 -1
- package/dist/devices-matter/custom/PowerStripAccessory.d.ts +0 -97
- package/dist/devices-matter/custom/PowerStripAccessory.d.ts.map +0 -1
- package/dist/devices-matter/custom/PowerStripAccessory.js +0 -265
- package/dist/devices-matter/custom/PowerStripAccessory.js.map +0 -1
- package/dist/devices-matter/custom/index.d.ts +0 -8
- package/dist/devices-matter/custom/index.d.ts.map +0 -1
- package/dist/devices-matter/custom/index.js +0 -8
- package/dist/devices-matter/custom/index.js.map +0 -1
- package/dist/devices-matter/index.d.ts +0 -29
- package/dist/devices-matter/index.d.ts.map +0 -1
- package/dist/devices-matter/index.js +0 -28
- package/dist/devices-matter/index.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -19
- package/dist/index.test.js.map +0 -1
- package/dist/irdevice/airconditioner.d.ts +0 -61
- package/dist/irdevice/airconditioner.d.ts.map +0 -1
- package/dist/irdevice/airconditioner.js +0 -472
- package/dist/irdevice/airconditioner.js.map +0 -1
- package/dist/irdevice/airpurifier.d.ts +0 -50
- package/dist/irdevice/airpurifier.d.ts.map +0 -1
- package/dist/irdevice/airpurifier.js +0 -213
- package/dist/irdevice/airpurifier.js.map +0 -1
- package/dist/irdevice/camera.d.ts +0 -32
- package/dist/irdevice/camera.d.ts.map +0 -1
- package/dist/irdevice/camera.js +0 -107
- package/dist/irdevice/camera.js.map +0 -1
- package/dist/irdevice/fan.d.ts +0 -36
- package/dist/irdevice/fan.d.ts.map +0 -1
- package/dist/irdevice/fan.js +0 -200
- package/dist/irdevice/fan.js.map +0 -1
- package/dist/irdevice/irdevice.d.ts +0 -68
- package/dist/irdevice/irdevice.d.ts.map +0 -1
- package/dist/irdevice/irdevice.js +0 -298
- package/dist/irdevice/irdevice.js.map +0 -1
- package/dist/irdevice/light.d.ts +0 -36
- package/dist/irdevice/light.d.ts.map +0 -1
- package/dist/irdevice/light.js +0 -206
- package/dist/irdevice/light.js.map +0 -1
- package/dist/irdevice/other.d.ts +0 -57
- package/dist/irdevice/other.d.ts.map +0 -1
- package/dist/irdevice/other.js +0 -778
- package/dist/irdevice/other.js.map +0 -1
- package/dist/irdevice/tv.d.ts +0 -45
- package/dist/irdevice/tv.d.ts.map +0 -1
- package/dist/irdevice/tv.js +0 -327
- package/dist/irdevice/tv.js.map +0 -1
- package/dist/irdevice/vacuumcleaner.d.ts +0 -28
- package/dist/irdevice/vacuumcleaner.d.ts.map +0 -1
- package/dist/irdevice/vacuumcleaner.js +0 -104
- package/dist/irdevice/vacuumcleaner.js.map +0 -1
- package/dist/irdevice/waterheater.d.ts +0 -30
- package/dist/irdevice/waterheater.d.ts.map +0 -1
- package/dist/irdevice/waterheater.js +0 -105
- package/dist/irdevice/waterheater.js.map +0 -1
- package/dist/platform-hap.d.ts +0 -149
- package/dist/platform-hap.d.ts.map +0 -1
- package/dist/platform-hap.js +0 -2861
- package/dist/platform-hap.js.map +0 -1
- package/dist/platform-matter.d.ts +0 -120
- package/dist/platform-matter.d.ts.map +0 -1
- package/dist/platform-matter.js +0 -999
- package/dist/platform-matter.js.map +0 -1
- package/dist/utils.test.d.ts +0 -2
- package/dist/utils.test.d.ts.map +0 -1
- package/dist/utils.test.js +0 -95
- package/dist/utils.test.js.map +0 -1
- package/dist/verifyconfig.test.d.ts +0 -2
- package/dist/verifyconfig.test.d.ts.map +0 -1
- package/dist/verifyconfig.test.js +0 -167
- package/dist/verifyconfig.test.js.map +0 -1
- package/src/baseMatterAccessory.test.ts +0 -88
- package/src/custom.d.ts +0 -7
- package/src/devices-hap/airpurifier.ts +0 -563
- package/src/devices-hap/blindtilt.ts +0 -1049
- package/src/devices-hap/bot.ts +0 -900
- package/src/devices-hap/ceilinglight.ts +0 -742
- package/src/devices-hap/colorbulb.ts +0 -904
- package/src/devices-hap/contact.ts +0 -457
- package/src/devices-hap/curtain.ts +0 -944
- package/src/devices-hap/device.ts +0 -811
- package/src/devices-hap/fan.ts +0 -711
- package/src/devices-hap/hub.ts +0 -439
- package/src/devices-hap/humidifier.ts +0 -669
- package/src/devices-hap/iosensor.ts +0 -427
- package/src/devices-hap/lightstrip.ts +0 -836
- package/src/devices-hap/lock.ts +0 -620
- package/src/devices-hap/meter.ts +0 -426
- package/src/devices-hap/meterplus.ts +0 -430
- package/src/devices-hap/meterpro.ts +0 -522
- package/src/devices-hap/motion.ts +0 -390
- package/src/devices-hap/plug.ts +0 -423
- package/src/devices-hap/relayswitch.ts +0 -727
- package/src/devices-hap/robotvacuumcleaner.ts +0 -568
- package/src/devices-hap/waterdetector.ts +0 -400
- package/src/devices-matter/BaseMatterAccessory.ts +0 -249
- package/src/devices-matter/ColorLightAccessory.ts +0 -110
- package/src/devices-matter/ColorTemperatureLightAccessory.ts +0 -90
- package/src/devices-matter/ContactSensorAccessory.ts +0 -41
- package/src/devices-matter/DimmableLightAccessory.ts +0 -192
- package/src/devices-matter/DoorLockAccessory.ts +0 -60
- package/src/devices-matter/ExtendedColorLightAccessory.ts +0 -122
- package/src/devices-matter/FanAccessory.ts +0 -95
- package/src/devices-matter/HumiditySensorAccessory.ts +0 -41
- package/src/devices-matter/LeakSensorAccessory.ts +0 -40
- package/src/devices-matter/LightSensorAccessory.ts +0 -41
- package/src/devices-matter/OccupancySensorAccessory.ts +0 -48
- package/src/devices-matter/OnOffLightAccessory.ts +0 -125
- package/src/devices-matter/OnOffOutletAccessory.ts +0 -51
- package/src/devices-matter/OnOffSwitchAccessory.ts +0 -51
- package/src/devices-matter/RoboticVacuumAccessory.ts +0 -407
- package/src/devices-matter/SmokeCOAlarmAccessory.ts +0 -59
- package/src/devices-matter/TemperatureSensorAccessory.ts +0 -43
- package/src/devices-matter/ThermostatAccessory.ts +0 -110
- package/src/devices-matter/VenetianBlindAccessory.ts +0 -115
- package/src/devices-matter/WindowBlindAccessory.ts +0 -92
- package/src/devices-matter/custom/PowerStripAccessory.ts +0 -309
- package/src/devices-matter/custom/index.ts +0 -8
- package/src/devices-matter/index.ts +0 -29
- package/src/index.test.ts +0 -24
- package/src/irdevice/airconditioner.ts +0 -533
- package/src/irdevice/airpurifier.ts +0 -252
- package/src/irdevice/camera.ts +0 -129
- package/src/irdevice/fan.ts +0 -226
- package/src/irdevice/irdevice.ts +0 -344
- package/src/irdevice/light.ts +0 -246
- package/src/irdevice/other.ts +0 -790
- package/src/irdevice/tv.ts +0 -378
- package/src/irdevice/vacuumcleaner.ts +0 -126
- package/src/irdevice/waterheater.ts +0 -127
- package/src/platform-hap.ts +0 -2997
- package/src/platform-matter.ts +0 -1124
- package/src/utils.test.ts +0 -96
- package/src/verifyconfig.test.ts +0 -197
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modals.js","sourceRoot":"","sources":["../../../../src/homebridge-ui/public/js/modals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,MAAW;IACtD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACzC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAA;QAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAA;QACnB,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAA;QACpB,GAAG,CAAC,KAAK,CAAC,KAAK,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AAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;IACvC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAA;IACxC,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;IACpC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IAE/B,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IACxB,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;IAE7B,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAC9B,SAAS,CAAC,KAAK,EAAE,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import { DEVICE_TYPES } from './constants.js'
|
|
2
|
+
import { uiLog } from './logger.js'
|
|
3
|
+
|
|
4
|
+
export async function importDiscoveredDevice(device: any): Promise<{ configDeviceName: string, configDeviceType: string, address?: string } | null> {
|
|
5
|
+
return new Promise((resolve) => {
|
|
6
|
+
const div = document.createElement('div')
|
|
7
|
+
div.style.position = 'fixed'
|
|
8
|
+
div.style.top = '0'
|
|
9
|
+
div.style.left = '0'
|
|
10
|
+
div.style.width = '100%'
|
|
11
|
+
div.style.height = '100%'
|
|
12
|
+
div.style.background = 'rgba(0,0,0,0.7)'
|
|
13
|
+
div.style.display = 'flex'
|
|
14
|
+
div.style.alignItems = 'center'
|
|
15
|
+
div.style.justifyContent = 'center'
|
|
16
|
+
div.style.zIndex = '9999'
|
|
17
|
+
|
|
18
|
+
const modal = document.createElement('div')
|
|
19
|
+
modal.style.background = getComputedStyle(document.body).backgroundColor
|
|
20
|
+
modal.style.color = getComputedStyle(document.body).color
|
|
21
|
+
modal.style.padding = '0'
|
|
22
|
+
modal.style.borderRadius = '10px'
|
|
23
|
+
modal.style.minWidth = '440px'
|
|
24
|
+
modal.style.maxWidth = '90vw'
|
|
25
|
+
modal.style.boxShadow = '0 8px 32px rgba(0,0,0,0.35)'
|
|
26
|
+
modal.style.overflow = 'hidden'
|
|
27
|
+
modal.style.borderTop = '3px solid var(--switchbot-red, #ef4444)'
|
|
28
|
+
|
|
29
|
+
const title = document.createElement('h3')
|
|
30
|
+
title.textContent = 'Import Discovered Device'
|
|
31
|
+
title.style.marginTop = '0'
|
|
32
|
+
title.style.marginBottom = '16px'
|
|
33
|
+
title.style.padding = '20px 20px 0'
|
|
34
|
+
title.style.fontSize = '18px'
|
|
35
|
+
title.style.fontWeight = '600'
|
|
36
|
+
title.style.color = 'var(--switchbot-red, #ef4444)'
|
|
37
|
+
title.style.letterSpacing = '-0.02em'
|
|
38
|
+
|
|
39
|
+
const contentDiv = document.createElement('div')
|
|
40
|
+
contentDiv.style.padding = '0 20px 20px'
|
|
41
|
+
|
|
42
|
+
const nameLabel = document.createElement('label')
|
|
43
|
+
nameLabel.textContent = 'Device Name'
|
|
44
|
+
nameLabel.style.display = 'block'
|
|
45
|
+
nameLabel.style.marginBottom = '6px'
|
|
46
|
+
nameLabel.style.fontWeight = '500'
|
|
47
|
+
nameLabel.style.fontSize = '12px'
|
|
48
|
+
nameLabel.style.color = '#6b7280'
|
|
49
|
+
|
|
50
|
+
const nameInput = document.createElement('input')
|
|
51
|
+
nameInput.type = 'text'
|
|
52
|
+
nameInput.value = device.name || device.id || ''
|
|
53
|
+
nameInput.style.width = '100%'
|
|
54
|
+
nameInput.style.marginBottom = '12px'
|
|
55
|
+
nameInput.style.padding = '8px 10px'
|
|
56
|
+
nameInput.style.borderRadius = '6px'
|
|
57
|
+
nameInput.style.fontSize = '14px'
|
|
58
|
+
nameInput.style.boxSizing = 'border-box'
|
|
59
|
+
|
|
60
|
+
// --- Device Type Select ---
|
|
61
|
+
const typeLabel = document.createElement('label')
|
|
62
|
+
typeLabel.textContent = 'Config Device Type'
|
|
63
|
+
typeLabel.style.display = 'block'
|
|
64
|
+
typeLabel.style.marginBottom = '6px'
|
|
65
|
+
typeLabel.style.fontWeight = '500'
|
|
66
|
+
typeLabel.style.fontSize = '12px'
|
|
67
|
+
typeLabel.style.color = '#6b7280'
|
|
68
|
+
|
|
69
|
+
const typeSelect = document.createElement('select')
|
|
70
|
+
typeSelect.style.width = '100%'
|
|
71
|
+
typeSelect.style.padding = '8px 10px'
|
|
72
|
+
typeSelect.style.marginBottom = '12px'
|
|
73
|
+
typeSelect.style.borderRadius = '6px'
|
|
74
|
+
typeSelect.style.fontSize = '14px'
|
|
75
|
+
typeSelect.style.background = getComputedStyle(nameInput).background
|
|
76
|
+
typeSelect.style.color = getComputedStyle(nameInput).color
|
|
77
|
+
typeSelect.style.border = getComputedStyle(nameInput).border
|
|
78
|
+
typeSelect.style.boxSizing = 'border-box'
|
|
79
|
+
|
|
80
|
+
Object.keys(DEVICE_TYPES).forEach((categoryName) => {
|
|
81
|
+
const optgroup = document.createElement('optgroup')
|
|
82
|
+
optgroup.label = categoryName
|
|
83
|
+
DEVICE_TYPES[categoryName as keyof typeof DEVICE_TYPES].forEach((deviceType) => {
|
|
84
|
+
const opt = document.createElement('option')
|
|
85
|
+
opt.value = deviceType
|
|
86
|
+
opt.text = deviceType
|
|
87
|
+
const detectedType = (device.type || '').toLowerCase()
|
|
88
|
+
opt.selected = deviceType.toLowerCase() === detectedType
|
|
89
|
+
optgroup.appendChild(opt)
|
|
90
|
+
})
|
|
91
|
+
typeSelect.appendChild(optgroup)
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
// --- Matter Type Advanced Field (only for window covering types) ---
|
|
95
|
+
|
|
96
|
+
// Matter Type advanced field (only for window covering types)
|
|
97
|
+
const windowCoveringTypes = ['Roller Shade', 'Curtain', 'Curtain3', 'Blind Tilt']
|
|
98
|
+
|
|
99
|
+
const matterTypeLabel = document.createElement('label')
|
|
100
|
+
matterTypeLabel.textContent = 'Matter Window Covering Type (Advanced)'
|
|
101
|
+
matterTypeLabel.style.display = 'block'
|
|
102
|
+
matterTypeLabel.style.marginBottom = '6px'
|
|
103
|
+
matterTypeLabel.style.fontWeight = '500'
|
|
104
|
+
matterTypeLabel.style.fontSize = '12px'
|
|
105
|
+
matterTypeLabel.style.color = '#6b7280'
|
|
106
|
+
matterTypeLabel.style.marginTop = '2px'
|
|
107
|
+
|
|
108
|
+
// Table 8.2 from Matter spec (partial, most common types)
|
|
109
|
+
const matterTypes = [
|
|
110
|
+
{ value: '', label: 'Auto-detect (recommended)' },
|
|
111
|
+
{ value: 0, label: 'Roller Shade (0)' },
|
|
112
|
+
{ value: 1, label: 'Roman Shade (1)' },
|
|
113
|
+
{ value: 2, label: 'Balloon Shade (2)' },
|
|
114
|
+
{ value: 3, label: 'Woven Wood (3)' },
|
|
115
|
+
{ value: 4, label: 'Drapery (4)' },
|
|
116
|
+
{ value: 5, label: 'Awning (5)' },
|
|
117
|
+
{ value: 6, label: 'Shutter (6)' },
|
|
118
|
+
{ value: 7, label: 'Tilt Blind (7)' },
|
|
119
|
+
{ value: 8, label: 'Blind Tilt (8)' },
|
|
120
|
+
{ value: 9, label: 'Projector Screen (9)' },
|
|
121
|
+
{ value: 15, label: 'Other (15)' },
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
const matterTypeSelect = document.createElement('select')
|
|
125
|
+
matterTypeSelect.style.width = '100%'
|
|
126
|
+
matterTypeSelect.style.marginBottom = '12px'
|
|
127
|
+
matterTypeSelect.style.padding = '8px 10px'
|
|
128
|
+
matterTypeSelect.style.borderRadius = '6px'
|
|
129
|
+
matterTypeSelect.style.fontSize = '14px'
|
|
130
|
+
matterTypeSelect.style.boxSizing = 'border-box'
|
|
131
|
+
matterTypes.forEach((opt) => {
|
|
132
|
+
const option = document.createElement('option')
|
|
133
|
+
option.value = String(opt.value)
|
|
134
|
+
option.textContent = opt.label
|
|
135
|
+
if (device.matterType != null && String(opt.value) === String(device.matterType)) {
|
|
136
|
+
option.selected = true
|
|
137
|
+
}
|
|
138
|
+
matterTypeSelect.appendChild(option)
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
// Show/hide Matter Type field based on type
|
|
142
|
+
function updateMatterTypeVisibility() {
|
|
143
|
+
if (windowCoveringTypes.includes(typeSelect.value)) {
|
|
144
|
+
matterTypeLabel.style.display = 'block'
|
|
145
|
+
matterTypeSelect.style.display = 'block'
|
|
146
|
+
} else {
|
|
147
|
+
matterTypeLabel.style.display = 'none'
|
|
148
|
+
matterTypeSelect.style.display = 'none'
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
typeSelect.addEventListener('change', updateMatterTypeVisibility)
|
|
152
|
+
updateMatterTypeVisibility()
|
|
153
|
+
|
|
154
|
+
const macLabel = document.createElement('label')
|
|
155
|
+
macLabel.textContent = 'BLE MAC Address (optional)'
|
|
156
|
+
macLabel.style.display = 'block'
|
|
157
|
+
macLabel.style.marginBottom = '6px'
|
|
158
|
+
macLabel.style.fontWeight = '500'
|
|
159
|
+
macLabel.style.fontSize = '12px'
|
|
160
|
+
macLabel.style.color = '#6b7280'
|
|
161
|
+
|
|
162
|
+
const macInput = document.createElement('input')
|
|
163
|
+
macInput.type = 'text'
|
|
164
|
+
macInput.value = device.address || ''
|
|
165
|
+
macInput.placeholder = 'AA:BB:CC:DD:EE:FF'
|
|
166
|
+
macInput.style.width = '100%'
|
|
167
|
+
macInput.style.marginBottom = '12px'
|
|
168
|
+
macInput.style.padding = '8px 10px'
|
|
169
|
+
macInput.style.borderRadius = '6px'
|
|
170
|
+
macInput.style.fontSize = '14px'
|
|
171
|
+
macInput.style.boxSizing = 'border-box'
|
|
172
|
+
|
|
173
|
+
// BLE Encryption Key
|
|
174
|
+
const encryptionKeyLabel = document.createElement('label')
|
|
175
|
+
encryptionKeyLabel.textContent = 'BLE Encryption Key (optional)'
|
|
176
|
+
encryptionKeyLabel.style.display = 'block'
|
|
177
|
+
encryptionKeyLabel.style.marginBottom = '6px'
|
|
178
|
+
encryptionKeyLabel.style.fontWeight = '500'
|
|
179
|
+
encryptionKeyLabel.style.fontSize = '12px'
|
|
180
|
+
encryptionKeyLabel.style.color = '#6b7280'
|
|
181
|
+
|
|
182
|
+
const encryptionKeyInput = document.createElement('input')
|
|
183
|
+
encryptionKeyInput.type = 'password'
|
|
184
|
+
encryptionKeyInput.value = device.encryptionKey || ''
|
|
185
|
+
encryptionKeyInput.placeholder = 'Paste device BLE encryption key'
|
|
186
|
+
encryptionKeyInput.style.width = '100%'
|
|
187
|
+
encryptionKeyInput.style.marginBottom = '12px'
|
|
188
|
+
encryptionKeyInput.style.padding = '8px 10px'
|
|
189
|
+
encryptionKeyInput.style.borderRadius = '6px'
|
|
190
|
+
encryptionKeyInput.style.fontSize = '14px'
|
|
191
|
+
encryptionKeyInput.style.boxSizing = 'border-box'
|
|
192
|
+
|
|
193
|
+
// BLE Key ID
|
|
194
|
+
const keyIdLabel = document.createElement('label')
|
|
195
|
+
keyIdLabel.textContent = 'BLE Key ID (optional)'
|
|
196
|
+
keyIdLabel.style.display = 'block'
|
|
197
|
+
keyIdLabel.style.marginBottom = '6px'
|
|
198
|
+
keyIdLabel.style.fontWeight = '500'
|
|
199
|
+
keyIdLabel.style.fontSize = '12px'
|
|
200
|
+
keyIdLabel.style.color = '#6b7280'
|
|
201
|
+
|
|
202
|
+
const keyIdInput = document.createElement('input')
|
|
203
|
+
keyIdInput.type = 'text'
|
|
204
|
+
keyIdInput.value = device.keyId || ''
|
|
205
|
+
keyIdInput.placeholder = 'e.g. ff'
|
|
206
|
+
keyIdInput.style.width = '100%'
|
|
207
|
+
keyIdInput.style.marginBottom = '12px'
|
|
208
|
+
keyIdInput.style.padding = '8px 10px'
|
|
209
|
+
keyIdInput.style.borderRadius = '6px'
|
|
210
|
+
keyIdInput.style.fontSize = '14px'
|
|
211
|
+
keyIdInput.style.boxSizing = 'border-box'
|
|
212
|
+
|
|
213
|
+
const buttons = document.createElement('div')
|
|
214
|
+
buttons.style.display = 'flex'
|
|
215
|
+
buttons.style.gap = '10px'
|
|
216
|
+
buttons.style.justifyContent = 'flex-end'
|
|
217
|
+
buttons.style.marginTop = '18px'
|
|
218
|
+
buttons.style.paddingTop = '18px'
|
|
219
|
+
buttons.style.borderTop = '1px solid rgba(0, 0, 0, 0.08)'
|
|
220
|
+
|
|
221
|
+
const cancelBtn = document.createElement('button')
|
|
222
|
+
cancelBtn.textContent = 'Cancel'
|
|
223
|
+
cancelBtn.className = 'secondary'
|
|
224
|
+
cancelBtn.style.background = '#6b7280'
|
|
225
|
+
cancelBtn.style.padding = '8px 16px'
|
|
226
|
+
cancelBtn.style.fontSize = '13px'
|
|
227
|
+
|
|
228
|
+
const importBtn = document.createElement('button')
|
|
229
|
+
importBtn.textContent = 'Add to Config'
|
|
230
|
+
importBtn.style.background = 'var(--switchbot-red, #ef4444)'
|
|
231
|
+
importBtn.style.padding = '8px 20px'
|
|
232
|
+
importBtn.style.fontSize = '13px'
|
|
233
|
+
|
|
234
|
+
const cleanup = (result: { configDeviceName: string, configDeviceType: string, address?: string, encryptionKey?: string, keyId?: string } | null) => {
|
|
235
|
+
div.remove()
|
|
236
|
+
resolve(result)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
cancelBtn.onclick = () => cleanup(null)
|
|
240
|
+
importBtn.onclick = () => cleanup({
|
|
241
|
+
configDeviceName: nameInput.value || device.name || device.id,
|
|
242
|
+
configDeviceType: typeSelect.value || device.type,
|
|
243
|
+
address: macInput.value || undefined,
|
|
244
|
+
encryptionKey: encryptionKeyInput.value || undefined,
|
|
245
|
+
keyId: keyIdInput.value || undefined,
|
|
246
|
+
...(windowCoveringTypes.includes(typeSelect.value) && matterTypeSelect.value !== '' ? { matterType: Number(matterTypeSelect.value) } : {}),
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
div.addEventListener('click', (event) => {
|
|
250
|
+
if (event.target === div) {
|
|
251
|
+
cleanup(null)
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
buttons.appendChild(cancelBtn)
|
|
256
|
+
buttons.appendChild(importBtn)
|
|
257
|
+
contentDiv.appendChild(nameLabel)
|
|
258
|
+
contentDiv.appendChild(nameInput)
|
|
259
|
+
contentDiv.appendChild(typeLabel)
|
|
260
|
+
contentDiv.appendChild(typeSelect)
|
|
261
|
+
contentDiv.appendChild(matterTypeLabel)
|
|
262
|
+
contentDiv.appendChild(matterTypeSelect)
|
|
263
|
+
contentDiv.appendChild(macLabel)
|
|
264
|
+
contentDiv.appendChild(macInput)
|
|
265
|
+
contentDiv.appendChild(encryptionKeyLabel)
|
|
266
|
+
contentDiv.appendChild(encryptionKeyInput)
|
|
267
|
+
contentDiv.appendChild(keyIdLabel)
|
|
268
|
+
contentDiv.appendChild(keyIdInput)
|
|
269
|
+
contentDiv.appendChild(buttons)
|
|
270
|
+
|
|
271
|
+
modal.appendChild(title)
|
|
272
|
+
modal.appendChild(contentDiv)
|
|
273
|
+
div.appendChild(modal)
|
|
274
|
+
document.body.appendChild(div)
|
|
275
|
+
nameInput.focus()
|
|
276
|
+
})
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export async function editDevice(device: any): Promise<void> {
|
|
280
|
+
// --- Device Type Select ---
|
|
281
|
+
const typeLabel = document.createElement('label')
|
|
282
|
+
typeLabel.textContent = 'Config Device Type'
|
|
283
|
+
typeLabel.style.display = 'block'
|
|
284
|
+
typeLabel.style.marginBottom = '6px'
|
|
285
|
+
typeLabel.style.fontWeight = '500'
|
|
286
|
+
typeLabel.style.fontSize = '12px'
|
|
287
|
+
typeLabel.style.color = '#6b7280'
|
|
288
|
+
|
|
289
|
+
const typeSelect = document.createElement('select')
|
|
290
|
+
typeSelect.style.width = '100%'
|
|
291
|
+
typeSelect.style.padding = '8px 10px'
|
|
292
|
+
typeSelect.style.marginBottom = '12px'
|
|
293
|
+
typeSelect.style.borderRadius = '6px'
|
|
294
|
+
typeSelect.style.fontSize = '14px'
|
|
295
|
+
typeSelect.style.background = getComputedStyle(document.body).backgroundColor
|
|
296
|
+
typeSelect.style.color = getComputedStyle(document.body).color
|
|
297
|
+
typeSelect.style.border = '1px solid #ccc'
|
|
298
|
+
typeSelect.style.boxSizing = 'border-box'
|
|
299
|
+
|
|
300
|
+
// Add option groups with all API device types
|
|
301
|
+
Object.keys(DEVICE_TYPES).forEach((categoryName) => {
|
|
302
|
+
const optgroup = document.createElement('optgroup')
|
|
303
|
+
optgroup.label = categoryName
|
|
304
|
+
DEVICE_TYPES[categoryName as keyof typeof DEVICE_TYPES].forEach((deviceType) => {
|
|
305
|
+
const opt = document.createElement('option')
|
|
306
|
+
opt.value = deviceType
|
|
307
|
+
opt.text = deviceType
|
|
308
|
+
// Select current configDeviceType if set, otherwise match API deviceType
|
|
309
|
+
const currentType = device.configDeviceType || device.deviceType || device.type || ''
|
|
310
|
+
opt.selected = currentType === deviceType
|
|
311
|
+
optgroup.appendChild(opt)
|
|
312
|
+
})
|
|
313
|
+
typeSelect.appendChild(optgroup)
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
// --- Matter Type Advanced Field (only for window covering types) ---
|
|
317
|
+
const windowCoveringTypes = ['Roller Shade', 'Curtain', 'Curtain3', 'Blind Tilt']
|
|
318
|
+
const showMatterType = windowCoveringTypes.includes(device.configDeviceType || device.deviceType || device.type || '')
|
|
319
|
+
const matterTypeLabel = document.createElement('label')
|
|
320
|
+
matterTypeLabel.textContent = 'Matter Window Covering Type (Advanced)'
|
|
321
|
+
matterTypeLabel.style.display = showMatterType ? 'block' : 'none'
|
|
322
|
+
matterTypeLabel.style.marginBottom = '6px'
|
|
323
|
+
matterTypeLabel.style.fontWeight = '500'
|
|
324
|
+
matterTypeLabel.style.fontSize = '12px'
|
|
325
|
+
matterTypeLabel.style.color = '#6b7280'
|
|
326
|
+
matterTypeLabel.style.marginTop = '2px'
|
|
327
|
+
const matterTypes = [
|
|
328
|
+
{ value: '', label: 'Auto-detect (recommended)' },
|
|
329
|
+
{ value: 0, label: 'Roller Shade (0)' },
|
|
330
|
+
{ value: 1, label: 'Roman Shade (1)' },
|
|
331
|
+
{ value: 2, label: 'Balloon Shade (2)' },
|
|
332
|
+
{ value: 3, label: 'Woven Wood (3)' },
|
|
333
|
+
{ value: 4, label: 'Drapery (4)' },
|
|
334
|
+
{ value: 5, label: 'Awning (5)' },
|
|
335
|
+
{ value: 6, label: 'Shutter (6)' },
|
|
336
|
+
{ value: 7, label: 'Tilt Blind (7)' },
|
|
337
|
+
{ value: 8, label: 'Blind Tilt (8)' },
|
|
338
|
+
{ value: 9, label: 'Projector Screen (9)' },
|
|
339
|
+
{ value: 15, label: 'Other (15)' },
|
|
340
|
+
]
|
|
341
|
+
const matterTypeSelect = document.createElement('select')
|
|
342
|
+
matterTypeSelect.style.width = '100%'
|
|
343
|
+
matterTypeSelect.style.marginBottom = '12px'
|
|
344
|
+
matterTypeSelect.style.padding = '8px 10px'
|
|
345
|
+
matterTypeSelect.style.borderRadius = '6px'
|
|
346
|
+
matterTypeSelect.style.fontSize = '14px'
|
|
347
|
+
matterTypeSelect.style.boxSizing = 'border-box'
|
|
348
|
+
matterTypes.forEach((opt) => {
|
|
349
|
+
const option = document.createElement('option')
|
|
350
|
+
option.value = String(opt.value)
|
|
351
|
+
option.textContent = opt.label
|
|
352
|
+
if (device.matterType != null && String(opt.value) === String(device.matterType)) {
|
|
353
|
+
option.selected = true
|
|
354
|
+
}
|
|
355
|
+
matterTypeSelect.appendChild(option)
|
|
356
|
+
})
|
|
357
|
+
function updateMatterTypeVisibility() {
|
|
358
|
+
if (windowCoveringTypes.includes(typeSelect.value)) {
|
|
359
|
+
matterTypeLabel.style.display = 'block'
|
|
360
|
+
matterTypeSelect.style.display = 'block'
|
|
361
|
+
} else {
|
|
362
|
+
matterTypeLabel.style.display = 'none'
|
|
363
|
+
matterTypeSelect.style.display = 'none'
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
typeSelect.addEventListener('change', updateMatterTypeVisibility)
|
|
367
|
+
updateMatterTypeVisibility()
|
|
368
|
+
// Create modal dialog for editing
|
|
369
|
+
const div = document.createElement('div')
|
|
370
|
+
div.style.position = 'fixed'
|
|
371
|
+
div.style.top = '0'
|
|
372
|
+
div.style.left = '0'
|
|
373
|
+
div.style.width = '100%'
|
|
374
|
+
div.style.height = '100%'
|
|
375
|
+
div.style.background = 'rgba(0,0,0,0.7)'
|
|
376
|
+
div.style.display = 'flex'
|
|
377
|
+
div.style.alignItems = 'center'
|
|
378
|
+
div.style.justifyContent = 'center'
|
|
379
|
+
div.style.zIndex = '9999'
|
|
380
|
+
|
|
381
|
+
const modal = document.createElement('div')
|
|
382
|
+
modal.style.background = getComputedStyle(document.body).backgroundColor
|
|
383
|
+
modal.style.color = getComputedStyle(document.body).color
|
|
384
|
+
modal.style.padding = '0'
|
|
385
|
+
modal.style.borderRadius = '10px'
|
|
386
|
+
modal.style.minWidth = '440px'
|
|
387
|
+
modal.style.maxWidth = '90vw'
|
|
388
|
+
modal.style.boxShadow = '0 8px 32px rgba(0,0,0,0.35)'
|
|
389
|
+
modal.style.overflow = 'hidden'
|
|
390
|
+
modal.style.borderTop = '3px solid var(--switchbot-red, #ef4444)'
|
|
391
|
+
|
|
392
|
+
const title = document.createElement('h3')
|
|
393
|
+
title.textContent = 'Edit Device'
|
|
394
|
+
title.style.marginTop = '0'
|
|
395
|
+
title.style.marginBottom = '16px'
|
|
396
|
+
title.style.padding = '20px 20px 0'
|
|
397
|
+
title.style.fontSize = '18px'
|
|
398
|
+
title.style.fontWeight = '600'
|
|
399
|
+
title.style.color = 'var(--switchbot-red, #ef4444)'
|
|
400
|
+
title.style.letterSpacing = '-0.02em'
|
|
401
|
+
|
|
402
|
+
const contentDiv = document.createElement('div')
|
|
403
|
+
contentDiv.style.padding = '0 20px 20px'
|
|
404
|
+
|
|
405
|
+
const nameLabel = document.createElement('label')
|
|
406
|
+
nameLabel.textContent = 'Device Name'
|
|
407
|
+
nameLabel.style.display = 'block'
|
|
408
|
+
nameLabel.style.marginBottom = '6px'
|
|
409
|
+
nameLabel.style.fontWeight = '500'
|
|
410
|
+
nameLabel.style.fontSize = '12px'
|
|
411
|
+
nameLabel.style.color = '#6b7280'
|
|
412
|
+
|
|
413
|
+
const nameInput = document.createElement('input')
|
|
414
|
+
nameInput.type = 'text'
|
|
415
|
+
nameInput.value = device.name || device.id
|
|
416
|
+
nameInput.style.width = '100%'
|
|
417
|
+
nameInput.style.marginBottom = '12px'
|
|
418
|
+
nameInput.style.padding = '8px 10px'
|
|
419
|
+
nameInput.style.borderRadius = '6px'
|
|
420
|
+
nameInput.style.fontSize = '14px'
|
|
421
|
+
nameInput.style.boxSizing = 'border-box'
|
|
422
|
+
nameInput.style.transition = 'border-color 0.2s ease'
|
|
423
|
+
|
|
424
|
+
// Read-only API device type field
|
|
425
|
+
const apiTypeLabel = document.createElement('label')
|
|
426
|
+
apiTypeLabel.textContent = 'Device Type (API - Read Only)'
|
|
427
|
+
apiTypeLabel.style.display = 'block'
|
|
428
|
+
apiTypeLabel.style.marginBottom = '6px'
|
|
429
|
+
apiTypeLabel.style.fontWeight = '500'
|
|
430
|
+
apiTypeLabel.style.fontSize = '12px'
|
|
431
|
+
apiTypeLabel.style.color = '#6b7280'
|
|
432
|
+
|
|
433
|
+
const apiTypeInput = document.createElement('input')
|
|
434
|
+
apiTypeInput.type = 'text'
|
|
435
|
+
apiTypeInput.value = device.deviceType || device.type || 'Unknown'
|
|
436
|
+
apiTypeInput.readOnly = true
|
|
437
|
+
apiTypeInput.style.width = '100%'
|
|
438
|
+
apiTypeInput.style.marginBottom = '12px'
|
|
439
|
+
apiTypeInput.style.padding = '8px 10px'
|
|
440
|
+
apiTypeInput.style.borderRadius = '6px'
|
|
441
|
+
apiTypeInput.style.fontSize = '13px'
|
|
442
|
+
apiTypeInput.style.opacity = '0.6'
|
|
443
|
+
apiTypeInput.style.cursor = 'not-allowed'
|
|
444
|
+
apiTypeInput.style.boxSizing = 'border-box'
|
|
445
|
+
apiTypeInput.style.backgroundColor = '#f9fafb'
|
|
446
|
+
|
|
447
|
+
// Editable config device type dropdown
|
|
448
|
+
|
|
449
|
+
// Add option groups with all API device types
|
|
450
|
+
Object.keys(DEVICE_TYPES).forEach((categoryName) => {
|
|
451
|
+
const optgroup = document.createElement('optgroup')
|
|
452
|
+
optgroup.label = categoryName
|
|
453
|
+
|
|
454
|
+
DEVICE_TYPES[categoryName as keyof typeof DEVICE_TYPES].forEach((deviceType) => {
|
|
455
|
+
const opt = document.createElement('option')
|
|
456
|
+
opt.value = deviceType
|
|
457
|
+
opt.text = deviceType
|
|
458
|
+
|
|
459
|
+
// Select current configDeviceType if set, otherwise match API deviceType
|
|
460
|
+
const currentType = device.configDeviceType || device.deviceType || device.type || ''
|
|
461
|
+
opt.selected = currentType === deviceType
|
|
462
|
+
optgroup.appendChild(opt)
|
|
463
|
+
})
|
|
464
|
+
|
|
465
|
+
typeSelect.appendChild(optgroup)
|
|
466
|
+
})
|
|
467
|
+
|
|
468
|
+
const errorMessage = document.createElement('div')
|
|
469
|
+
errorMessage.style.color = 'var(--switchbot-red, #ef4444)'
|
|
470
|
+
errorMessage.style.marginBottom = '12px'
|
|
471
|
+
errorMessage.style.fontSize = '12px'
|
|
472
|
+
errorMessage.style.display = 'none'
|
|
473
|
+
errorMessage.style.padding = '8px 10px'
|
|
474
|
+
errorMessage.style.background = 'var(--switchbot-red-light, #fee2e2)'
|
|
475
|
+
errorMessage.style.borderRadius = '6px'
|
|
476
|
+
errorMessage.style.fontWeight = '500'
|
|
477
|
+
|
|
478
|
+
const buttons = document.createElement('div')
|
|
479
|
+
buttons.style.display = 'flex'
|
|
480
|
+
buttons.style.gap = '10px'
|
|
481
|
+
buttons.style.justifyContent = 'flex-end'
|
|
482
|
+
buttons.style.marginTop = '18px'
|
|
483
|
+
buttons.style.paddingTop = '18px'
|
|
484
|
+
buttons.style.borderTop = '1px solid rgba(0, 0, 0, 0.08)'
|
|
485
|
+
|
|
486
|
+
const cancelBtn = document.createElement('button')
|
|
487
|
+
cancelBtn.textContent = 'Cancel'
|
|
488
|
+
cancelBtn.className = 'secondary'
|
|
489
|
+
cancelBtn.style.background = '#6b7280'
|
|
490
|
+
cancelBtn.style.padding = '8px 16px'
|
|
491
|
+
cancelBtn.style.fontSize = '13px'
|
|
492
|
+
cancelBtn.onclick = () => div.remove()
|
|
493
|
+
|
|
494
|
+
const saveBtn = document.createElement('button')
|
|
495
|
+
saveBtn.textContent = 'Save'
|
|
496
|
+
saveBtn.style.background = 'var(--switchbot-red, #ef4444)'
|
|
497
|
+
saveBtn.style.padding = '8px 20px'
|
|
498
|
+
saveBtn.style.fontSize = '13px'
|
|
499
|
+
saveBtn.onclick = async () => {
|
|
500
|
+
try {
|
|
501
|
+
const { updateDevice, syncParentPluginConfigFromDisk, fetchDevices } = await import('./api.js')
|
|
502
|
+
const { renderDeviceList } = await import('./render.js')
|
|
503
|
+
|
|
504
|
+
const params = {
|
|
505
|
+
deviceId: device.id,
|
|
506
|
+
configDeviceName: nameInput.value || undefined,
|
|
507
|
+
configDeviceType: typeSelect.value,
|
|
508
|
+
matterType: windowCoveringTypes.includes(typeSelect.value) && matterTypeSelect.value !== '' ? Number(matterTypeSelect.value) : undefined,
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
await updateDevice(params.deviceId, params.configDeviceName, params.configDeviceType, { matterType: params.matterType })
|
|
512
|
+
await syncParentPluginConfigFromDisk()
|
|
513
|
+
|
|
514
|
+
// Refresh device list
|
|
515
|
+
uiLog.info('[Edit Device] Refreshing device list after update')
|
|
516
|
+
const list = await fetchDevices()
|
|
517
|
+
renderDeviceList(list)
|
|
518
|
+
div.remove()
|
|
519
|
+
} catch (e) {
|
|
520
|
+
uiLog.error('Update error:', e)
|
|
521
|
+
errorMessage.textContent = `Error: ${e instanceof Error ? e.message : 'Failed to update device'}`
|
|
522
|
+
errorMessage.style.display = 'block'
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
buttons.appendChild(cancelBtn)
|
|
527
|
+
buttons.appendChild(saveBtn)
|
|
528
|
+
|
|
529
|
+
contentDiv.appendChild(nameLabel)
|
|
530
|
+
contentDiv.appendChild(nameInput)
|
|
531
|
+
contentDiv.appendChild(apiTypeLabel)
|
|
532
|
+
contentDiv.appendChild(apiTypeInput)
|
|
533
|
+
contentDiv.appendChild(typeLabel)
|
|
534
|
+
contentDiv.appendChild(typeSelect)
|
|
535
|
+
contentDiv.appendChild(matterTypeLabel)
|
|
536
|
+
contentDiv.appendChild(matterTypeSelect)
|
|
537
|
+
contentDiv.appendChild(errorMessage)
|
|
538
|
+
contentDiv.appendChild(buttons)
|
|
539
|
+
|
|
540
|
+
modal.appendChild(title)
|
|
541
|
+
modal.appendChild(contentDiv)
|
|
542
|
+
|
|
543
|
+
div.appendChild(modal)
|
|
544
|
+
document.body.appendChild(div)
|
|
545
|
+
nameInput.focus()
|
|
546
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get RSSI signal quality level and color based on dBm value
|
|
3
|
+
* @param rssi Signal strength in dBm (typically -30 to -90)
|
|
4
|
+
* @returns Object with quality level, color, and description
|
|
5
|
+
*/
|
|
6
|
+
export declare function getRssiSignalQuality(rssi: number | undefined): {
|
|
7
|
+
level: 'excellent' | 'good' | 'fair' | 'poor' | 'unknown';
|
|
8
|
+
color: string;
|
|
9
|
+
bgColor: string;
|
|
10
|
+
description: string;
|
|
11
|
+
bars: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Create visual signal strength indicator bars
|
|
15
|
+
* @param rssi Signal strength in dBm
|
|
16
|
+
* @returns HTML element showing filled bars
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderSignalBars(rssi: number | undefined): HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* Create signal quality badge with color
|
|
21
|
+
* @param rssi Signal strength in dBm
|
|
22
|
+
* @returns HTML element showing quality level
|
|
23
|
+
*/
|
|
24
|
+
export declare function renderSignalQualityBadge(rssi: number | undefined): HTMLElement;
|
|
25
|
+
export declare function renderBadge(text: string, style: string): HTMLElement;
|
|
26
|
+
export declare function renderConnectionBadge(connectionType: string): HTMLElement | null;
|
|
27
|
+
export declare function renderIRBadge(): HTMLElement;
|
|
28
|
+
export declare function renderDeviceDetailsPanel(device: any): HTMLElement;
|
|
29
|
+
export declare function renderDiscoveredDevices(devices: any[], options?: {
|
|
30
|
+
configuredIds?: Set<string>;
|
|
31
|
+
selectedIds?: Set<string>;
|
|
32
|
+
onToggleSelect?: (device: any, selected: boolean) => void;
|
|
33
|
+
}): Promise<HTMLElement>;
|
|
34
|
+
/**
|
|
35
|
+
* Filter devices by connection type and search query
|
|
36
|
+
* @param devices Discovered devices array
|
|
37
|
+
* @param connectionType Filter: 'all' | 'ble' | 'api' | 'both' | 'ir'
|
|
38
|
+
* @param searchQuery Search term to match against name/id/type
|
|
39
|
+
* @returns Filtered devices array
|
|
40
|
+
*/
|
|
41
|
+
export declare function filterDevices(devices: any[], connectionType?: 'all' | 'ble' | 'api' | 'both' | 'ir', searchQuery?: string): any[];
|
|
42
|
+
/**
|
|
43
|
+
* Sort devices by specified criteria
|
|
44
|
+
* @param devices Devices array to sort
|
|
45
|
+
* @param sortBy Sort criterion: 'name' | 'signal' | 'type' | 'connection'
|
|
46
|
+
* @returns Sorted devices array
|
|
47
|
+
*/
|
|
48
|
+
export declare function sortDevices(devices: any[], sortBy?: 'name' | 'signal' | 'type' | 'connection'): any[];
|
|
49
|
+
/**
|
|
50
|
+
* Get filter/sort preferences from localStorage
|
|
51
|
+
* @returns Object with current filter and sort preferences
|
|
52
|
+
*/
|
|
53
|
+
export declare function getDiscoveryPreferences(): {
|
|
54
|
+
connectionType: 'all' | 'ble' | 'api' | 'both' | 'ir';
|
|
55
|
+
sortBy: 'name' | 'signal' | 'type' | 'connection';
|
|
56
|
+
searchQuery: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Save filter/sort preferences to localStorage
|
|
60
|
+
* @param preferences Preferences object to save
|
|
61
|
+
*/
|
|
62
|
+
export declare function setDiscoveryPreferences(preferences: {
|
|
63
|
+
connectionType: 'all' | 'ble' | 'api' | 'both' | 'ir';
|
|
64
|
+
sortBy: 'name' | 'signal' | 'type' | 'connection';
|
|
65
|
+
searchQuery: string;
|
|
66
|
+
}): void;
|
|
67
|
+
export declare function renderDeviceList(list: any[]): void;
|
|
68
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/homebridge-ui/public/js/render.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG;IAC9D,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb,CA8CA;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CA+BtE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAiB9E;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAKpE;AAED,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAiBhF;AAED,wBAAgB,aAAa,IAAI,WAAW,CAK3C;AAgGD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,GAAG,GAAG,WAAW,CAoNjE;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,GAAG,EAAE,EACd,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,cAAc,CAAC,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