diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a5e48a39522a5..c5a4be4a84a11 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "21.11.0" + ".": "21.22.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d4fefc5b1cc..27addf66d3050 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,214 @@ # Changelog +## [21.22.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.21.1...v21.22.0) (2025-01-20) + + +### Features + +* **add:** 3RSP02065Z, 3RSP02064Z ([#8654](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8654)) ([a3c7bda](https://github.com/Koenkk/zigbee-herdsman-converters/commit/a3c7bda5d37d104c7f9a3eb63193e5cbaff71dbc)) +* **add:** SR-ZG9030F-PS ([#8652](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8652)) ([701acf4](https://github.com/Koenkk/zigbee-herdsman-converters/commit/701acf41d9562243684431e5d76f473f24025fa9)) + + +### Bug Fixes + +* **detect:** Detect `_TZE284_iwn0gpzz` as Tuya SPM01V2.5 https://github.com/Koenkk/zigbee2mqtt/discussions/25891 ([15f15aa](https://github.com/Koenkk/zigbee-herdsman-converters/commit/15f15aa151239c1d5af5d776449a6f8077d59da6)) +* Fix CO2 value interpretation ([#8644](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8644)) ([8a70e68](https://github.com/Koenkk/zigbee-herdsman-converters/commit/8a70e68fdcd3717a0acf66987ada4960fce4cb1f)) +* **ignore:** Refactor Tuya fingerprint ([#8648](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8648)) ([f42aa50](https://github.com/Koenkk/zigbee-herdsman-converters/commit/f42aa5080ee933e8cde9fc08c67a88bf886d71ff)) +* **ignore:** update dependencies ([#8641](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8641)) ([5c0b54b](https://github.com/Koenkk/zigbee-herdsman-converters/commit/5c0b54b0b237c78bdc32f34bb6745a9ca5946c59)) + +## [21.21.1](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.21.0...v21.21.1) (2025-01-19) + + +### Bug Fixes + +* Add missing actions for Philips Hue Tap (8718696743133) ([#8633](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8633)) ([7643376](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7643376580da97cdd31e2c4deee7672f402b2f99)) +* **detect:** Detect `_TZE200_jkfbph7l` as AVATTO ME167 ([#8638](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8638)) ([6e09825](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6e098258b3879e4f0956171262294ca4ed0cc359)) +* **detect:** Detect `_TZE204_g5xqosu7` as Tuya TS0601_cover_8 ([#8634](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8634)) ([ce1827e](https://github.com/Koenkk/zigbee-herdsman-converters/commit/ce1827ed29f2eafdf81f7187514051a0d2fab98d)) +* **detect:** Detect `_TZE204_tgdnh7pw` as AVATTO ZDMS16-1 https://github.com/Koenkk/zigbee-herdsman-converters/issues/8639 ([db5c39b](https://github.com/Koenkk/zigbee-herdsman-converters/commit/db5c39b459058d903ac6f96b47729c496f580250)) +* **detect:** Detect `_TZE284_dhke3p9w` as FORIA F00YK04-18-1 https://github.com/Koenkk/zigbee-herdsman-converters/issues/8632 ([cdb1b50](https://github.com/Koenkk/zigbee-herdsman-converters/commit/cdb1b50df2552594cd554dcd3226b8ed3a506d77)) +* **ignore:** fix external definition generator ([dc858cf](https://github.com/Koenkk/zigbee-herdsman-converters/commit/dc858cf578174d24f3a97010c3eaecbc41e9fa09)) + +## [21.21.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.20.0...v21.21.0) (2025-01-17) + + +### Features + +* **add:** AE-940K, AE-669K ([#8618](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8618)) ([357445c](https://github.com/Koenkk/zigbee-herdsman-converters/commit/357445cdd2ccbddd3f5de6eefd16736a76ead65a)) +* **add:** SR-ZG9060A-GS, SR-ZG9060B-CS, SR-ZG9050C-WS, SR-ZG9050B-WS ([#8620](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8620)) ([e15957a](https://github.com/Koenkk/zigbee-herdsman-converters/commit/e15957a49e383284a7d5565f467b5bbb47c74c76)) + + +### Bug Fixes + +* Add custom cluster for Wirenboard ([#8624](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8624)) ([058443c](https://github.com/Koenkk/zigbee-herdsman-converters/commit/058443c48fd9d402fed9448f7257568a8fb653a8)) +* **detect:** Detect `_TZE204_xalsoe3m` as Moes BHT-002-GCLZB ([#8628](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8628)) ([2196eba](https://github.com/Koenkk/zigbee-herdsman-converters/commit/2196eba66b25b0c7d536ba4a420d7897a36c5a9b)) +* Fix `data.substr is not a function` for Xiaomi A6121 https://github.com/Koenkk/zigbee2mqtt/issues/25491 ([58b4a87](https://github.com/Koenkk/zigbee-herdsman-converters/commit/58b4a87052ab38af6ef3f83e347aa374168bfb52)) +* Fix no state reported for GL-SD-001P https://github.com/Koenkk/zigbee2mqtt/issues/23661 ([7b45348](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7b453485011f2e0c4a0cf2c59f9cfbc37d389bf9)) +* **ignore:** Refactor modern extend imports ([#8613](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8613)) ([7fe7490](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7fe7490f637d405432853504f5901dd25a1c8230)) +* **ignore:** Update ZG-205Z/A motion state values https://github.com/Koenkk/zigbee2mqtt/issues/25682 ([b9ab59d](https://github.com/Koenkk/zigbee-herdsman-converters/commit/b9ab59d6c447d9f18e6a6749301e6b456b1bd88c)) +* Improve Imhotep Creation E-Ctrl integration ([#8625](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8625)) ([cce4d94](https://github.com/Koenkk/zigbee-herdsman-converters/commit/cce4d94d9877783bc34d4a5da29fa55a77b44776)) + +## [21.20.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.19.0...v21.20.0) (2025-01-15) + + +### Features + +* **add:** C-ZB-DM204 ([#8609](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8609)) ([ef7ac30](https://github.com/Koenkk/zigbee-herdsman-converters/commit/ef7ac30befdfa980f139249ea62c8db7a985d9a5)) +* Expose `uart_connection` and `uart_baud_rate` for WB-MSW-ZIGBEE v.4 ([#8616](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8616)) ([b33bc18](https://github.com/Koenkk/zigbee-herdsman-converters/commit/b33bc18a0c9061f24edda3047e55d5775116ea4e)) + + +### Bug Fixes + +* Configure state reporting for Gledopto GL-SD-001 https://github.com/Koenkk/zigbee2mqtt/issues/23661 ([a5088d9](https://github.com/Koenkk/zigbee-herdsman-converters/commit/a5088d982f4705aefcf710c4b0fcb81e2563c0ef)) +* **detect:** Detect `_TZE204_57hjqelq` as Roximo CRTZ01 ([#8607](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8607)) ([341f3ef](https://github.com/Koenkk/zigbee-herdsman-converters/commit/341f3efd3f0f03e88d032cf98e3321b146c477d7)) +* **detect:** Detect `_TZE284_ne4pikwm` as Nedis ZBHTR20WT ([#8619](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8619)) ([502b3c3](https://github.com/Koenkk/zigbee-herdsman-converters/commit/502b3c32863d2774c9a6e223a8f06012dbf8e22f)) +* **detect:** Detect `_TZE284_ny94onlb` as Tuya SPM02V2.5 ([#8617](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8617)) ([7ce4846](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7ce48463f368b5102037e192238799072290b377)) +* **detect:** Detect `_TZE284_xnbkhhdr` as Tuya ZWT198/ZWT100-BH ([#8614](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8614)) ([6ae4e45](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6ae4e4588a35c0af61bdedbe1f5df200a2664035)) + +## [21.19.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.18.0...v21.19.0) (2025-01-13) + + +### Features + +* **add:** GWA1201_TWO_WAY_SWITCH ([#8601](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8601)) ([26b2a0e](https://github.com/Koenkk/zigbee-herdsman-converters/commit/26b2a0ef4015686d255a123a1abd2750ad2c3aa1)) +* **add:** SR-ZG2835RAC-UK ([#8602](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8602)) ([bae1461](https://github.com/Koenkk/zigbee-herdsman-converters/commit/bae1461cbd3878f78a48d0fbe76ad54adbdf8645)) + + +### Bug Fixes + +* **detect:** Detect `_TZE204_2cyb66xl` as AVATTO ZDMS16-1 https://github.com/Koenkk/zigbee-herdsman-converters/pull/8436 ([50f1453](https://github.com/Koenkk/zigbee-herdsman-converters/commit/50f14531cb149cfe63eabe485eb4026a3415798c)) +* Fix duplicate publish for some Tuya devics https://github.com/Koenkk/zigbee2mqtt/issues/25605 ([d7f9a3c](https://github.com/Koenkk/zigbee-herdsman-converters/commit/d7f9a3c1aeccd1cd3e912ebe07fa8b337fbcda3d)) +* Fix Tuya ZG-227ZL batterty % https://github.com/Koenkk/zigbee2mqtt/issues/25581 ([ab83fc5](https://github.com/Koenkk/zigbee-herdsman-converters/commit/ab83fc5c791dc59f78b1fa596bb1fbf65ffbf8c4)) + +## [21.18.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.17.0...v21.18.0) (2025-01-12) + + +### Features + +* Add `illuminance_raw` ([#8592](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8592)) ([3d98d3f](https://github.com/Koenkk/zigbee-herdsman-converters/commit/3d98d3f54bc63a720111f58194269250f5fb324a)) +* **add:** 929003151601, 929003151701 ([#8598](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8598)) ([9193662](https://github.com/Koenkk/zigbee-herdsman-converters/commit/9193662502a3eb32a56bf78ad6f0a5a41bf304b9)) + + +### Bug Fixes + +* Fix inverted `position` for Tuya TS0601_cover_3 ([#8595](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8595)) ([0b74e57](https://github.com/Koenkk/zigbee-herdsman-converters/commit/0b74e5798955a52c9dbbbed84b1262825471cd70)) +* **ignore:** Remove linkquality expose ([#8599](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8599)) ([f913273](https://github.com/Koenkk/zigbee-herdsman-converters/commit/f913273750f220c680c1d66d4b64971443a7d161)) + +## [21.17.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.16.0...v21.17.0) (2025-01-12) + + +### Features + +* **add:** Add thermostat endpoints to Ubisys H10 ([#8589](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8589)) ([05865e9](https://github.com/Koenkk/zigbee-herdsman-converters/commit/05865e983e39ce03578a6bfdb40099dffe041537)) + + +### Bug Fixes + +* Add additional `motion_state` to Tuya ZG-205Z/A https://github.com/Koenkk/zigbee2mqtt/issues/25682 ([8b0ccfe](https://github.com/Koenkk/zigbee-herdsman-converters/commit/8b0ccfe23ef88569e0d6edaf6941193f2e540c3b)) +* **detect:** Detect `_TZ3000_v1w2k9dd` as Tuya ZY-ZTH02 ([#8591](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8591)) ([b2316dc](https://github.com/Koenkk/zigbee-herdsman-converters/commit/b2316dc792a0e8511cbc396c903ff165580d947f)) +* **detect:** Detect `_TZE204_jygvp6fk` as Tuya TS0601_temperature_humidity_sensor_2 https://github.com/Koenkk/zigbee2mqtt/issues/25753 ([9605278](https://github.com/Koenkk/zigbee-herdsman-converters/commit/9605278fd0603f744373bc5f56d6a015e5a320d2)) +* **ignore:** update dependencies ([#8594](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8594)) ([38d3c7d](https://github.com/Koenkk/zigbee-herdsman-converters/commit/38d3c7d66630dcba3aab1f76ecc248925445a2a1)) +* MAZDA TR-M2Z Remove 'temperature' exposes ([#8593](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8593)) ([1875596](https://github.com/Koenkk/zigbee-herdsman-converters/commit/187559687cd8046417125806453319ac5605c18c)) +* PRO-900Z: Removed `valve_state` and added climate `running_state` ([#8588](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8588)) ([e8b0a37](https://github.com/Koenkk/zigbee-herdsman-converters/commit/e8b0a37195c2b330b5e531b7a7ffd55a3fa2bc0b)) +* Rename `Avatto` to `AVATTO` https://github.com/Koenkk/zigbee2mqtt/discussions/25763 ([3e1ddcd](https://github.com/Koenkk/zigbee-herdsman-converters/commit/3e1ddcd94db6c72ee9370666398ddb08511c7e72)) + +## [21.16.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.15.0...v21.16.0) (2025-01-10) + + +### Features + +* **add:** 2CT @JBLSteeve https://github.com/Koenkk/zigbee2mqtt/issues/25328 ([31d460e](https://github.com/Koenkk/zigbee-herdsman-converters/commit/31d460ef9e527b2983602ee783479e50658a81c9)) +* **add:** 501.39 ([#8582](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8582)) ([ace4a44](https://github.com/Koenkk/zigbee-herdsman-converters/commit/ace4a44257d25a300f7a73185a14c4ca075eaf1e)) +* **add:** RF 274 T ([#8585](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8585)) ([7b2fc3e](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7b2fc3eb14cfe94c0e79cce54187b1446cd52683)) + + +### Bug Fixes + +* **detect:** Detect `_TZ3000_do6txrcw` as Tuya TS0222 ([#8584](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8584)) ([3cf6397](https://github.com/Koenkk/zigbee-herdsman-converters/commit/3cf639703d4ff0e7e6a1e5f41019882d78692db4)) +* **detect:** Detect `_TZE200_127x7wnl` as Moes ZTS-EUR-C ([#8586](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8586)) ([fb5bd37](https://github.com/Koenkk/zigbee-herdsman-converters/commit/fb5bd372ccb8ed93391fdfb4a64fbf2ffb524bd7)) +* **detect:** Detect `_TZE200_7shyddj3` as Tuya TS0601_cover_1 ([#8587](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8587)) ([72a6b9d](https://github.com/Koenkk/zigbee-herdsman-converters/commit/72a6b9db3420df1d69f844019b4a4a8dc7506a3b)) +* **detect:** Detect `_TZE200_clrdrnya` as Wenzhi WZ-M100 https://github.com/Koenkk/zigbee2mqtt/discussions/25712 ([a7ad848](https://github.com/Koenkk/zigbee-herdsman-converters/commit/a7ad848859b9e98122b0bde5d45a7a1a7848327f)) +* **detect:** Detect `_TZE204_a2jcoyuk` as Tuya TS0601_cover_1 https://github.com/Koenkk/zigbee2mqtt/issues/25429 ([52bd7f6](https://github.com/Koenkk/zigbee-herdsman-converters/commit/52bd7f6e514b47b391eea33f50ed29bb0b37ff3b)) +* Fix configure reporting failing for QBKG20LM https://github.com/Koenkk/zigbee2mqtt/issues/25674 ([c324f74](https://github.com/Koenkk/zigbee-herdsman-converters/commit/c324f749ea3298fd7dc69c16c255a974b4b9022b)) + +## [21.15.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.14.0...v21.15.0) (2025-01-08) + + +### Features + +* **add:** 929003667001 ([#8576](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8576)) ([5009796](https://github.com/Koenkk/zigbee-herdsman-converters/commit/5009796f1c240de3ac2d59ff9302cb0577a5280b)) +* **add:** ID200W-ZIGB ([#8564](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8564)) ([42a7417](https://github.com/Koenkk/zigbee-herdsman-converters/commit/42a7417b722a794bc49bb201d38ba21c87120da9)) + + +### Bug Fixes + +* **detect:** Detect `_TZE200_h2rctifa` as Tuya ZS-TYG3-SM-61Z ([#8573](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8573)) ([8f2e68a](https://github.com/Koenkk/zigbee-herdsman-converters/commit/8f2e68a427aa7b45e60d7b4b7bc8bf6182656cbf)) +* **detect:** Detect `_TZE200_ybsqljjg` as AVATTO ME168 ([#8580](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8580)) ([6d6c058](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6d6c058f8f26b26114d00f09e943ba05d19573ba)) +* **detect:** Detect `_TZE204_81yrt3lo` as Tuya PJ-1203A ([#8578](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8578)) ([234d683](https://github.com/Koenkk/zigbee-herdsman-converters/commit/234d683f23c4e69da8af6004e5260be76558d83f)) +* **detect:** Detect `_TZE204_uo8qcagcn` as Tuya TS0601_gas_sensor_4 ([#8579](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8579)) ([7d90392](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7d90392060c4c6fda76088cea9824992425f2c81)) +* Fix `Value: '4' not found in: [0, 1]` error for Aqara SRTS-A01 https://github.com/Koenkk/zigbee2mqtt/issues/25020 ([af9a81d](https://github.com/Koenkk/zigbee-herdsman-converters/commit/af9a81dfb5a0a4014c1cfd0dd127275384eab284)) +* Fix Aqara SRTS-A01 child lock https://github.com/Koenkk/zigbee2mqtt/issues/25561 ([a91d4e2](https://github.com/Koenkk/zigbee-herdsman-converters/commit/a91d4e25356e75920162af5440214322d65a7031)) +* Fix Centralite 4257050-ZHAC to ignore 'transition' ([#8571](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8571)) ([86483ed](https://github.com/Koenkk/zigbee-herdsman-converters/commit/86483ed8a49b007d5eb78874b1c4009ddfe25ea4)) +* Fix detect `TH01` as temperature sensor https://github.com/Koenkk/zigbee2mqtt/issues/25365 ([cc3956a](https://github.com/Koenkk/zigbee-herdsman-converters/commit/cc3956a9890930241ac4938e680f77ad936d047b)) +* Fix missing `commandMoveHue` converter for OSRAM AC0251100NJ/AC0251600NJ/AC0251700NJ https://github.com/Koenkk/zigbee2mqtt/issues/25652 ([1a9cd8c](https://github.com/Koenkk/zigbee-herdsman-converters/commit/1a9cd8cccb1176ae26fb3dbe92f40f3f55375034)) +* Fix Salus FC600 OTA ([#8572](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8572)) ([eccc950](https://github.com/Koenkk/zigbee-herdsman-converters/commit/eccc950f3154aa0edcaacfb0ff579597b4c52843)) + +## [21.14.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.13.0...v21.14.0) (2025-01-06) + + +### Features + +* **add:** 511.020 ([#8567](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8567)) ([72f75b6](https://github.com/Koenkk/zigbee-herdsman-converters/commit/72f75b61ab65242b70e3247cdf0bea09c59b6c1f)) +* **add:** 929003823201 ([#8568](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8568)) ([ff52cc1](https://github.com/Koenkk/zigbee-herdsman-converters/commit/ff52cc16fc976d4570a78436b51a87bce3b9d399)) + + +### Bug Fixes + +* Add 550B1012 whitelabel ([#8569](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8569)) ([bec15f2](https://github.com/Koenkk/zigbee-herdsman-converters/commit/bec15f2c43241bf10f71765c3a271ba9e0562a1f)) +* **detect:** Detect `_TZ3000_x3ewpzyr` as Tuya XSH01A https://github.com/Koenkk/zigbee2mqtt/issues/23155 ([633b76c](https://github.com/Koenkk/zigbee-herdsman-converters/commit/633b76c68ff1b68b96cd577f980bdda03a0ba0ca)) +* Fix configure of some IKEA remotes failing https://github.com/Koenkk/zigbee2mqtt/discussions/25613 ([2e97241](https://github.com/Koenkk/zigbee-herdsman-converters/commit/2e972417d72407a5a936ae4abd4864a47601a7bd)) +* Fix no state reported for GL-SD-003P https://github.com/Koenkk/zigbee2mqtt/issues/23661 ([4560ac5](https://github.com/Koenkk/zigbee-herdsman-converters/commit/4560ac5adab11cc78b02ad092e9ff133d8a1e981)) +* Fix ZWT198/ZWT100-BH preset modes ([#8565](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8565)) ([33b785a](https://github.com/Koenkk/zigbee-herdsman-converters/commit/33b785a628589e07a42a9b8cfa3254cf56c20b3f)) + +## [21.13.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.12.0...v21.13.0) (2025-01-05) + + +### Features + +* **add:** TS0726_3_gang ([#8563](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8563)) ([fcb6184](https://github.com/Koenkk/zigbee-herdsman-converters/commit/fcb6184bffecffbd26713388a1a8b5c444a46d79)) +* Expose battery % for Lutron Z3-1BRL https://github.com/Koenkk/zigbee2mqtt/issues/25361 ([4d72d7b](https://github.com/Koenkk/zigbee-herdsman-converters/commit/4d72d7bf1b984e8d3781748cd1893efe9d8f240f)) + + +### Bug Fixes + +* **detect:** Detect `_TZ3000_3ias4w4oz` as Nedis ZBPO130FWT ([#8552](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8552)) ([7e7e28a](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7e7e28affbbd423bd5c6b1a20372c27cfc1066cc)) +* **detect:** Detect `_TZ3000_jsfzkftc` as Tuya TS0001_power https://github.com/Koenkk/zigbee2mqtt/issues/25426 ([9ee4e02](https://github.com/Koenkk/zigbee-herdsman-converters/commit/9ee4e02bb23fe60e731d1d1fd7e243c57466084f)) +* **detect:** Detect `_TZE204_7bztmfm1` as Tuya TS0601_smart_CO_air_box ([#8559](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8559)) ([07a87da](https://github.com/Koenkk/zigbee-herdsman-converters/commit/07a87da72e71b6fe3327ff01318944296235b947)) +* **detect:** Detect `_TZE204_tzreobvu` as Tuya TOQCB2-80 ([#8562](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8562)) ([18a95b7](https://github.com/Koenkk/zigbee-herdsman-converters/commit/18a95b73f166670618d2680adc29a870cd484546)) +* **detect:** Detect `_TZE284_rccxox8pz` as Tuya PA-44Z ([#8558](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8558)) ([6f44769](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6f4476944b3c3a252cbb4771fa89b6e789d3223f)) +* **detect:** Detect `TH01` as Zbeacon TH01 https://github.com/Koenkk/zigbee2mqtt/issues/25365 ([576ec47](https://github.com/Koenkk/zigbee-herdsman-converters/commit/576ec476a91f96884fe7d05ec8b240e1d9354c07)) +* Fix duplicated Tuya vendor ([#8557](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8557)) ([d031c2b](https://github.com/Koenkk/zigbee-herdsman-converters/commit/d031c2b49d27d450e37e830eef82dd55be08842b)) +* Increase BRT-100-TRV step accuracy ([#8561](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8561)) ([bdbd922](https://github.com/Koenkk/zigbee-herdsman-converters/commit/bdbd922e39f19e4103b210ea46ed522d5cac42ea)) + +## [21.12.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.11.0...v21.12.0) (2025-01-03) + + +### Features + +* Add preset for Salus FC600 ([#8551](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8551)) ([c45179c](https://github.com/Koenkk/zigbee-herdsman-converters/commit/c45179c1e7c82731f46c33f84c340f03522130fe)) +* **add:** 050-0511558F ([#8549](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8549)) ([897380f](https://github.com/Koenkk/zigbee-herdsman-converters/commit/897380fca445f24a1716795cbcf8e3529a6407f0)) +* **add:** D692-ZG ([#8534](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8534)) ([d65fcf7](https://github.com/Koenkk/zigbee-herdsman-converters/commit/d65fcf7963e2dec53fb507f8d75cae3c5ea0855d)) +* **add:** MTD085-ZB ([#8490](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8490)) ([35f89fb](https://github.com/Koenkk/zigbee-herdsman-converters/commit/35f89fb594c4d12ca7ec058e009346a4ac7d8301)) +* **add:** MTR500E-UP, MTR1300E-UP, MTR2000E-UP, MTV300E-UP, MVR500E-UP, E2BP-UP, E4BP-UP, TLC1-UP, TLC2-UP, TLC4-UP, TLC8-UP, TLM1-UP, TLM2-UP, TLM4-UP, GALET4-UP ([#8537](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8537)) ([099eb66](https://github.com/Koenkk/zigbee-herdsman-converters/commit/099eb666505c4f8796c3ba0d4e5277201610c3b6)) +* Implement PowerOnBehaviour for Aqara T1M lamp (CL-L02D) ([#8550](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8550)) ([e2ae7d6](https://github.com/Koenkk/zigbee-herdsman-converters/commit/e2ae7d685ced88b7a1cfa42a785175e49a71f37c)) + + +### Bug Fixes + +* Add endpoint capability to lock type ([#8529](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8529)) ([8f0f023](https://github.com/Koenkk/zigbee-herdsman-converters/commit/8f0f023df4d10477aed23e1b16c335a2d3c9d38a)) +* **detect:** Detect `FLS-PP3\u0000` as Mega23M12 https://github.com/Koenkk/zigbee2mqtt/issues/25382 ([5be3337](https://github.com/Koenkk/zigbee-herdsman-converters/commit/5be3337374c8ee4120966e8cb30b8a80f624391f)) +* Fix configure failure for Datek HSE2905E ([#8546](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8546)) ([979ac52](https://github.com/Koenkk/zigbee-herdsman-converters/commit/979ac527def1e8a5e443004dd2bbffd80aebc019)) +* **ignore:** update dependencies ([#8555](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8555)) ([6214cc0](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6214cc084e5137528ec328b23205e2b2d9b0f0e0)) + ## [21.11.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.10.0...v21.11.0) (2024-12-30) diff --git a/package.json b/package.json index 4ab6d2cd076fb..b068d83d29bdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-herdsman-converters", - "version": "21.11.0", + "version": "21.22.0", "description": "Collection of device converters to be used with zigbee-herdsman", "main": "index.js", "types": "index.d.ts", @@ -49,26 +49,26 @@ "buffer-crc32": "^1.0.0", "iconv-lite": "^0.6.3", "semver": "^7.6.3", - "zigbee-herdsman": "^3.2.0" + "zigbee-herdsman": "^3.2.2" }, "devDependencies": { - "@eslint/core": "^0.9.1", - "@eslint/js": "^9.17.0", - "@ianvs/prettier-plugin-sort-imports": "^4.4.0", + "@eslint/core": "^0.10.0", + "@eslint/js": "^9.18.0", + "@ianvs/prettier-plugin-sort-imports": "^4.4.1", "@types/buffer-crc32": "^0.2.4", "@types/eslint__js": "^8.42.3", - "@types/node": "^22.10.2", + "@types/node": "^22.10.7", "@types/semver": "^7.5.8", - "@vitest/coverage-v8": "2.1.8", - "eslint": "^9.17.0", - "eslint-config-prettier": "^9.1.0", + "@vitest/coverage-v8": "3.0.2", + "eslint": "^9.18.0", + "eslint-config-prettier": "^10.0.1", "fast-deep-equal": "^3.1.3", "husky": "^9.1.7", "prettier": "^3.4.2", "rimraf": "^6.0.1", - "ts-morph": "^24.0.0", - "typescript": "^5.7.2", - "typescript-eslint": "^8.18.2", - "vitest": "^2.1.8" + "ts-morph": "^25.0.0", + "typescript": "^5.7.3", + "typescript-eslint": "^8.20.0", + "vitest": "^3.0.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d02b1d5d94ee1..cc285ac2d1466 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,18 +18,18 @@ importers: specifier: ^7.6.3 version: 7.6.3 zigbee-herdsman: - specifier: ^3.2.0 - version: 3.2.0 + specifier: ^3.2.2 + version: 3.2.2 devDependencies: '@eslint/core': - specifier: ^0.9.1 - version: 0.9.1 + specifier: ^0.10.0 + version: 0.10.0 '@eslint/js': - specifier: ^9.17.0 - version: 9.17.0 + specifier: ^9.18.0 + version: 9.18.0 '@ianvs/prettier-plugin-sort-imports': - specifier: ^4.4.0 - version: 4.4.0(prettier@3.4.2) + specifier: ^4.4.1 + version: 4.4.1(prettier@3.4.2) '@types/buffer-crc32': specifier: ^0.2.4 version: 0.2.4 @@ -37,20 +37,20 @@ importers: specifier: ^8.42.3 version: 8.42.3 '@types/node': - specifier: ^22.10.2 - version: 22.10.2 + specifier: ^22.10.7 + version: 22.10.7 '@types/semver': specifier: ^7.5.8 version: 7.5.8 '@vitest/coverage-v8': - specifier: 2.1.8 - version: 2.1.8(vitest@2.1.8(@types/node@22.10.2)) + specifier: 3.0.2 + version: 3.0.2(vitest@3.0.2(@types/node@22.10.7)) eslint: - specifier: ^9.17.0 - version: 9.17.0 + specifier: ^9.18.0 + version: 9.18.0 eslint-config-prettier: - specifier: ^9.1.0 - version: 9.1.0(eslint@9.17.0) + specifier: ^10.0.1 + version: 10.0.1(eslint@9.18.0) fast-deep-equal: specifier: ^3.1.3 version: 3.1.3 @@ -64,17 +64,17 @@ importers: specifier: ^6.0.1 version: 6.0.1 ts-morph: - specifier: ^24.0.0 - version: 24.0.0 + specifier: ^25.0.0 + version: 25.0.0 typescript: - specifier: ^5.7.2 - version: 5.7.2 + specifier: ^5.7.3 + version: 5.7.3 typescript-eslint: - specifier: ^8.18.2 - version: 8.18.2(eslint@9.17.0)(typescript@5.7.2) + specifier: ^8.20.0 + version: 8.20.0(eslint@9.18.0)(typescript@5.7.3) vitest: - specifier: ^2.1.8 - version: 2.1.8(@types/node@22.10.2) + specifier: ^3.0.2 + version: 3.0.2(@types/node@22.10.7) packages: @@ -86,8 +86,8 @@ packages: resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} - '@babel/generator@7.26.3': - resolution: {integrity: sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==} + '@babel/generator@7.26.5': + resolution: {integrity: sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==} engines: {node: '>=6.9.0'} '@babel/helper-string-parser@7.25.9': @@ -98,8 +98,8 @@ packages: resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/parser@7.26.3': - resolution: {integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==} + '@babel/parser@7.26.5': + resolution: {integrity: sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw==} engines: {node: '>=6.0.0'} hasBin: true @@ -107,152 +107,165 @@ packages: resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.26.4': - resolution: {integrity: sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==} + '@babel/traverse@7.26.5': + resolution: {integrity: sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ==} engines: {node: '>=6.9.0'} - '@babel/types@7.26.3': - resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==} + '@babel/types@7.26.5': + resolution: {integrity: sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==} engines: {node: '>=6.9.0'} - '@bcoe/v8-coverage@0.2.3': - resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@bcoe/v8-coverage@1.0.2': + resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} + engines: {node: '>=18'} - '@esbuild/aix-ppc64@0.21.5': - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} - engines: {node: '>=12'} + '@esbuild/aix-ppc64@0.24.2': + resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} + engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.21.5': - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} - engines: {node: '>=12'} + '@esbuild/android-arm64@0.24.2': + resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} + engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.21.5': - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} - engines: {node: '>=12'} + '@esbuild/android-arm@0.24.2': + resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} + engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.21.5': - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} - engines: {node: '>=12'} + '@esbuild/android-x64@0.24.2': + resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} + engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.21.5': - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} - engines: {node: '>=12'} + '@esbuild/darwin-arm64@0.24.2': + resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} + engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.21.5': - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} - engines: {node: '>=12'} + '@esbuild/darwin-x64@0.24.2': + resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} + engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.21.5': - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} - engines: {node: '>=12'} + '@esbuild/freebsd-arm64@0.24.2': + resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} + engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} - engines: {node: '>=12'} + '@esbuild/freebsd-x64@0.24.2': + resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} + engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.21.5': - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} - engines: {node: '>=12'} + '@esbuild/linux-arm64@0.24.2': + resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} + engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} + '@esbuild/linux-arm@0.24.2': + resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} + engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.21.5': - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} - engines: {node: '>=12'} + '@esbuild/linux-ia32@0.24.2': + resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} + engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.21.5': - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} - engines: {node: '>=12'} + '@esbuild/linux-loong64@0.24.2': + resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} + engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.21.5': - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} - engines: {node: '>=12'} + '@esbuild/linux-mips64el@0.24.2': + resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} + engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.21.5': - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} - engines: {node: '>=12'} + '@esbuild/linux-ppc64@0.24.2': + resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} + engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.21.5': - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} - engines: {node: '>=12'} + '@esbuild/linux-riscv64@0.24.2': + resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} + engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.21.5': - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} - engines: {node: '>=12'} + '@esbuild/linux-s390x@0.24.2': + resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} + engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.21.5': - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} - engines: {node: '>=12'} + '@esbuild/linux-x64@0.24.2': + resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} + engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-x64@0.21.5': - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} - engines: {node: '>=12'} + '@esbuild/netbsd-arm64@0.24.2': + resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.24.2': + resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} + engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-x64@0.21.5': - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} - engines: {node: '>=12'} + '@esbuild/openbsd-arm64@0.24.2': + resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.24.2': + resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} + engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.21.5': - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} - engines: {node: '>=12'} + '@esbuild/sunos-x64@0.24.2': + resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} + engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.21.5': - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} - engines: {node: '>=12'} + '@esbuild/win32-arm64@0.24.2': + resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} + engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.21.5': - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} - engines: {node: '>=12'} + '@esbuild/win32-ia32@0.24.2': + resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} + engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.21.5': - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} - engines: {node: '>=12'} + '@esbuild/win32-x64@0.24.2': + resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} + engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -270,24 +283,24 @@ packages: resolution: {integrity: sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.9.1': - resolution: {integrity: sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==} + '@eslint/core@0.10.0': + resolution: {integrity: sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.2.0': resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.17.0': - resolution: {integrity: sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==} + '@eslint/js@9.18.0': + resolution: {integrity: sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.5': resolution: {integrity: sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.4': - resolution: {integrity: sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==} + '@eslint/plugin-kit@0.2.5': + resolution: {integrity: sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@humanfs/core@0.19.1': @@ -310,8 +323,8 @@ packages: resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} engines: {node: '>=18.18'} - '@ianvs/prettier-plugin-sort-imports@4.4.0': - resolution: {integrity: sha512-f4/e+/ANGk3tHuwRW0uh2YuBR50I4h1ZjGQ+5uD8sWfinHTivQsnieR5cz24t8M6Vx4rYvZ5v/IEKZhYpzQm9Q==} + '@ianvs/prettier-plugin-sort-imports@4.4.1': + resolution: {integrity: sha512-F0/Hrcfpy8WuxlQyAWJTEren/uxKhYonOGY4OyWmwRdeTvkh9mMSCxowZLjNkhwi/2ipqCgtXwwOk7tW0mWXkA==} peerDependencies: '@vue/compiler-sfc': 2.7.x || 3.x prettier: 2 || 3 @@ -364,98 +377,98 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@rollup/rollup-android-arm-eabi@4.29.1': - resolution: {integrity: sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==} + '@rollup/rollup-android-arm-eabi@4.30.1': + resolution: {integrity: sha512-pSWY+EVt3rJ9fQ3IqlrEUtXh3cGqGtPDH1FQlNZehO2yYxCHEX1SPsz1M//NXwYfbTlcKr9WObLnJX9FsS9K1Q==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.29.1': - resolution: {integrity: sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew==} + '@rollup/rollup-android-arm64@4.30.1': + resolution: {integrity: sha512-/NA2qXxE3D/BRjOJM8wQblmArQq1YoBVJjrjoTSBS09jgUisq7bqxNHJ8kjCHeV21W/9WDGwJEWSN0KQ2mtD/w==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.29.1': - resolution: {integrity: sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw==} + '@rollup/rollup-darwin-arm64@4.30.1': + resolution: {integrity: sha512-r7FQIXD7gB0WJ5mokTUgUWPl0eYIH0wnxqeSAhuIwvnnpjdVB8cRRClyKLQr7lgzjctkbp5KmswWszlwYln03Q==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.29.1': - resolution: {integrity: sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng==} + '@rollup/rollup-darwin-x64@4.30.1': + resolution: {integrity: sha512-x78BavIwSH6sqfP2xeI1hd1GpHL8J4W2BXcVM/5KYKoAD3nNsfitQhvWSw+TFtQTLZ9OmlF+FEInEHyubut2OA==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.29.1': - resolution: {integrity: sha512-91C//G6Dm/cv724tpt7nTyP+JdN12iqeXGFM1SqnljCmi5yTXriH7B1r8AD9dAZByHpKAumqP1Qy2vVNIdLZqw==} + '@rollup/rollup-freebsd-arm64@4.30.1': + resolution: {integrity: sha512-HYTlUAjbO1z8ywxsDFWADfTRfTIIy/oUlfIDmlHYmjUP2QRDTzBuWXc9O4CXM+bo9qfiCclmHk1x4ogBjOUpUQ==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.29.1': - resolution: {integrity: sha512-hEioiEQ9Dec2nIRoeHUP6hr1PSkXzQaCUyqBDQ9I9ik4gCXQZjJMIVzoNLBRGet+hIUb3CISMh9KXuCcWVW/8w==} + '@rollup/rollup-freebsd-x64@4.30.1': + resolution: {integrity: sha512-1MEdGqogQLccphhX5myCJqeGNYTNcmTyaic9S7CG3JhwuIByJ7J05vGbZxsizQthP1xpVx7kd3o31eOogfEirw==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.29.1': - resolution: {integrity: sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A==} + '@rollup/rollup-linux-arm-gnueabihf@4.30.1': + resolution: {integrity: sha512-PaMRNBSqCx7K3Wc9QZkFx5+CX27WFpAMxJNiYGAXfmMIKC7jstlr32UhTgK6T07OtqR+wYlWm9IxzennjnvdJg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.29.1': - resolution: {integrity: sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ==} + '@rollup/rollup-linux-arm-musleabihf@4.30.1': + resolution: {integrity: sha512-B8Rcyj9AV7ZlEFqvB5BubG5iO6ANDsRKlhIxySXcF1axXYUyqwBok+XZPgIYGBgs7LDXfWfifxhw0Ik57T0Yug==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.29.1': - resolution: {integrity: sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA==} + '@rollup/rollup-linux-arm64-gnu@4.30.1': + resolution: {integrity: sha512-hqVyueGxAj3cBKrAI4aFHLV+h0Lv5VgWZs9CUGqr1z0fZtlADVV1YPOij6AhcK5An33EXaxnDLmJdQikcn5NEw==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.29.1': - resolution: {integrity: sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA==} + '@rollup/rollup-linux-arm64-musl@4.30.1': + resolution: {integrity: sha512-i4Ab2vnvS1AE1PyOIGp2kXni69gU2DAUVt6FSXeIqUCPIR3ZlheMW3oP2JkukDfu3PsexYRbOiJrY+yVNSk9oA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.29.1': - resolution: {integrity: sha512-5a7q3tnlbcg0OodyxcAdrrCxFi0DgXJSoOuidFUzHZ2GixZXQs6Tc3CHmlvqKAmOs5eRde+JJxeIf9DonkmYkw==} + '@rollup/rollup-linux-loongarch64-gnu@4.30.1': + resolution: {integrity: sha512-fARcF5g296snX0oLGkVxPmysetwUk2zmHcca+e9ObOovBR++9ZPOhqFUM61UUZ2EYpXVPN1redgqVoBB34nTpQ==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.29.1': - resolution: {integrity: sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w==} + '@rollup/rollup-linux-powerpc64le-gnu@4.30.1': + resolution: {integrity: sha512-GLrZraoO3wVT4uFXh67ElpwQY0DIygxdv0BNW9Hkm3X34wu+BkqrDrkcsIapAY+N2ATEbvak0XQ9gxZtCIA5Rw==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.29.1': - resolution: {integrity: sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ==} + '@rollup/rollup-linux-riscv64-gnu@4.30.1': + resolution: {integrity: sha512-0WKLaAUUHKBtll0wvOmh6yh3S0wSU9+yas923JIChfxOaaBarmb/lBKPF0w/+jTVozFnOXJeRGZ8NvOxvk/jcw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.29.1': - resolution: {integrity: sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g==} + '@rollup/rollup-linux-s390x-gnu@4.30.1': + resolution: {integrity: sha512-GWFs97Ruxo5Bt+cvVTQkOJ6TIx0xJDD/bMAOXWJg8TCSTEK8RnFeOeiFTxKniTc4vMIaWvCplMAFBt9miGxgkA==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.29.1': - resolution: {integrity: sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ==} + '@rollup/rollup-linux-x64-gnu@4.30.1': + resolution: {integrity: sha512-UtgGb7QGgXDIO+tqqJ5oZRGHsDLO8SlpE4MhqpY9Llpzi5rJMvrK6ZGhsRCST2abZdBqIBeXW6WPD5fGK5SDwg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.29.1': - resolution: {integrity: sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA==} + '@rollup/rollup-linux-x64-musl@4.30.1': + resolution: {integrity: sha512-V9U8Ey2UqmQsBT+xTOeMzPzwDzyXmnAoO4edZhL7INkwQcaW1Ckv3WJX3qrrp/VHaDkEWIBWhRwP47r8cdrOow==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.29.1': - resolution: {integrity: sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig==} + '@rollup/rollup-win32-arm64-msvc@4.30.1': + resolution: {integrity: sha512-WabtHWiPaFF47W3PkHnjbmWawnX/aE57K47ZDT1BXTS5GgrBUEpvOzq0FI0V/UYzQJgdb8XlhVNH8/fwV8xDjw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.29.1': - resolution: {integrity: sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng==} + '@rollup/rollup-win32-ia32-msvc@4.30.1': + resolution: {integrity: sha512-pxHAU+Zv39hLUTdQQHUVHf4P+0C47y/ZloorHpzs2SXMRqeAWmGghzAhfOlzFHHwjvgokdFAhC4V+6kC1lRRfw==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.29.1': - resolution: {integrity: sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg==} + '@rollup/rollup-win32-x64-msvc@4.30.1': + resolution: {integrity: sha512-D6qjsXGcvhTjv0kI4fU8tUuBDF/Ueee4SVX79VfNDXZa64TfCW1Slkb6Z7O1p7vflqZjcmOVdZlqf8gvJxc6og==} cpu: [x64] os: [win32] @@ -483,8 +496,8 @@ packages: resolution: {integrity: sha512-9On64rhzuqKdOQyiYLYv2lQOh3TZU/D3+IWCR5gk0alPel2nwpp4YwDEGiUBfrQZEdQ6xww0PWkzqth4wqwX3Q==} engines: {node: '>=12.0.0'} - '@ts-morph/common@0.25.0': - resolution: {integrity: sha512-kMnZz+vGGHi4GoHnLmMhGNjm44kGtKUXGnOvrKmMwAuvNjM/PgKVGfUnL7IDvK7Jb2QQ82jq3Zmp04Gy+r3Dkg==} + '@ts-morph/common@0.26.0': + resolution: {integrity: sha512-/RmKAtctStXqM5nECMQ46duT74Hoig/DBzhWXGHcodlDNrgRbsbwwHqSKFNbca6z9Xt/CUWMeXOsC9QEN1+rqw==} '@types/buffer-crc32@0.2.4': resolution: {integrity: sha512-GSrhSZOK1/wazf2CjDp3CVJQKWzSc5Ugq3NyZ/RQqg1MWtmA9mAT6i6LzGKhzcRxDOl8aLB+AzvObDSlrMpvLw==} @@ -501,96 +514,96 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/node@22.10.2': - resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} + '@types/node@22.10.7': + resolution: {integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==} '@types/semver@7.5.8': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@typescript-eslint/eslint-plugin@8.18.2': - resolution: {integrity: sha512-adig4SzPLjeQ0Tm+jvsozSGiCliI2ajeURDGHjZ2llnA+A67HihCQ+a3amtPhUakd1GlwHxSRvzOZktbEvhPPg==} + '@typescript-eslint/eslint-plugin@8.20.0': + resolution: {integrity: sha512-naduuphVw5StFfqp4Gq4WhIBE2gN1GEmMUExpJYknZJdRnc+2gDzB8Z3+5+/Kv33hPQRDGzQO/0opHE72lZZ6A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/parser@8.18.2': - resolution: {integrity: sha512-y7tcq4StgxQD4mDr9+Jb26dZ+HTZ/SkfqpXSiqeUXZHxOUyjWDKsmwKhJ0/tApR08DgOhrFAoAhyB80/p3ViuA==} + '@typescript-eslint/parser@8.20.0': + resolution: {integrity: sha512-gKXG7A5HMyjDIedBi6bUrDcun8GIjnI8qOwVLiY3rx6T/sHP/19XLJOnIq/FgQvWLHja5JN/LSE7eklNBr612g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/scope-manager@8.18.2': - resolution: {integrity: sha512-YJFSfbd0CJjy14r/EvWapYgV4R5CHzptssoag2M7y3Ra7XNta6GPAJPPP5KGB9j14viYXyrzRO5GkX7CRfo8/g==} + '@typescript-eslint/scope-manager@8.20.0': + resolution: {integrity: sha512-J7+VkpeGzhOt3FeG1+SzhiMj9NzGD/M6KoGn9f4dbz3YzK9hvbhVTmLj/HiTp9DazIzJ8B4XcM80LrR9Dm1rJw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.18.2': - resolution: {integrity: sha512-AB/Wr1Lz31bzHfGm/jgbFR0VB0SML/hd2P1yxzKDM48YmP7vbyJNHRExUE/wZsQj2wUCvbWH8poNHFuxLqCTnA==} + '@typescript-eslint/type-utils@8.20.0': + resolution: {integrity: sha512-bPC+j71GGvA7rVNAHAtOjbVXbLN5PkwqMvy1cwGeaxUoRQXVuKCebRoLzm+IPW/NtFFpstn1ummSIasD5t60GA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/types@8.18.2': - resolution: {integrity: sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==} + '@typescript-eslint/types@8.20.0': + resolution: {integrity: sha512-cqaMiY72CkP+2xZRrFt3ExRBu0WmVitN/rYPZErA80mHjHx/Svgp8yfbzkJmDoQ/whcytOPO9/IZXnOc+wigRA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.18.2': - resolution: {integrity: sha512-WXAVt595HjpmlfH4crSdM/1bcsqh+1weFRWIa9XMTx/XHZ9TCKMcr725tLYqWOgzKdeDrqVHxFotrvWcEsk2Tg==} + '@typescript-eslint/typescript-estree@8.20.0': + resolution: {integrity: sha512-Y7ncuy78bJqHI35NwzWol8E0X7XkRVS4K4P4TCyzWkOJih5NDvtoRDW4Ba9YJJoB2igm9yXDdYI/+fkiiAxPzA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@8.18.2': - resolution: {integrity: sha512-Cr4A0H7DtVIPkauj4sTSXVl+VBWewE9/o40KcF3TV9aqDEOWoXF3/+oRXNby3DYzZeCATvbdksYsGZzplwnK/Q==} + '@typescript-eslint/utils@8.20.0': + resolution: {integrity: sha512-dq70RUw6UK9ei7vxc4KQtBRk7qkHZv447OUZ6RPQMQl71I3NZxQJX/f32Smr+iqWrB02pHKn2yAdHBb0KNrRMA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/visitor-keys@8.18.2': - resolution: {integrity: sha512-zORcwn4C3trOWiCqFQP1x6G3xTRyZ1LYydnj51cRnJ6hxBlr/cKPckk+PKPUw/fXmvfKTcw7bwY3w9izgx5jZw==} + '@typescript-eslint/visitor-keys@8.20.0': + resolution: {integrity: sha512-v/BpkeeYAsPkKCkR8BDwcno0llhzWVqPOamQrAEMdpZav2Y9OVjd9dwJyBLJWwf335B5DmlifECIkZRJCaGaHA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@vitest/coverage-v8@2.1.8': - resolution: {integrity: sha512-2Y7BPlKH18mAZYAW1tYByudlCYrQyl5RGvnnDYJKW5tCiO5qg3KSAy3XAxcxKz900a0ZXxWtKrMuZLe3lKBpJw==} + '@vitest/coverage-v8@3.0.2': + resolution: {integrity: sha512-U+hZYb0FtgNDb6B3E9piAHzXXIuxuBw2cd6Lvepc9sYYY4KjgiwCBmo3Sird9ZRu3ggLpLBTfw1ZRr77ipiSfw==} peerDependencies: - '@vitest/browser': 2.1.8 - vitest: 2.1.8 + '@vitest/browser': 3.0.2 + vitest: 3.0.2 peerDependenciesMeta: '@vitest/browser': optional: true - '@vitest/expect@2.1.8': - resolution: {integrity: sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==} + '@vitest/expect@3.0.2': + resolution: {integrity: sha512-dKSHLBcoZI+3pmP5hiZ7I5grNru2HRtEW8Z5Zp4IXog8QYcxhlox7JUPyIIFWfN53+3HW3KPLIl6nSzUGgKSuQ==} - '@vitest/mocker@2.1.8': - resolution: {integrity: sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==} + '@vitest/mocker@3.0.2': + resolution: {integrity: sha512-Hr09FoBf0jlwwSyzIF4Xw31OntpO3XtZjkccpcBf8FeVW3tpiyKlkeUzxS/txzHqpUCNIX157NaTySxedyZLvA==} peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 + vite: ^5.0.0 || ^6.0.0 peerDependenciesMeta: msw: optional: true vite: optional: true - '@vitest/pretty-format@2.1.8': - resolution: {integrity: sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==} + '@vitest/pretty-format@3.0.2': + resolution: {integrity: sha512-yBohcBw/T/p0/JRgYD+IYcjCmuHzjC3WLAKsVE4/LwiubzZkE8N49/xIQ/KGQwDRA8PaviF8IRO8JMWMngdVVQ==} - '@vitest/runner@2.1.8': - resolution: {integrity: sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==} + '@vitest/runner@3.0.2': + resolution: {integrity: sha512-GHEsWoncrGxWuW8s405fVoDfSLk6RF2LCXp6XhevbtDjdDme1WV/eNmUueDfpY1IX3MJaCRelVCEXsT9cArfEg==} - '@vitest/snapshot@2.1.8': - resolution: {integrity: sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==} + '@vitest/snapshot@3.0.2': + resolution: {integrity: sha512-h9s67yD4+g+JoYG0zPCo/cLTabpDqzqNdzMawmNPzDStTiwxwkyYM1v5lWE8gmGv3SVJ2DcxA2NpQJZJv9ym3g==} - '@vitest/spy@2.1.8': - resolution: {integrity: sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==} + '@vitest/spy@3.0.2': + resolution: {integrity: sha512-8mI2iUn+PJFMT44e3ISA1R+K6ALVs47W6eriDTfXe6lFqlflID05MB4+rIFhmDSLBj8iBsZkzBYlgSkinxLzSQ==} - '@vitest/utils@2.1.8': - resolution: {integrity: sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==} + '@vitest/utils@3.0.2': + resolution: {integrity: sha512-Qu01ZYZlgHvDP02JnMBRpX43nRaZtNpIzw3C1clDXmn8eakgX6iQVGzTQ/NjkIr64WD8ioqOjkaYRVvHQI5qiw==} acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -730,17 +743,17 @@ packages: es-module-lexer@1.6.0: resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} - esbuild@0.21.5: - resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} - engines: {node: '>=12'} + esbuild@0.24.2: + resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} + engines: {node: '>=18'} hasBin: true escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - eslint-config-prettier@9.1.0: - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} + eslint-config-prettier@10.0.1: + resolution: {integrity: sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -757,8 +770,8 @@ packages: resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.17.0: - resolution: {integrity: sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==} + eslint@9.18.0: + resolution: {integrity: sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -797,8 +810,8 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} fast-json-stable-stringify@2.1.0: @@ -810,14 +823,6 @@ packages: fastq@1.18.0: resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==} - fdir@6.4.2: - resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -858,8 +863,8 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true - glob@11.0.0: - resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} + glob@11.0.1: + resolution: {integrity: sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==} engines: {node: 20 || >=22} hasBin: true @@ -1089,8 +1094,8 @@ packages: resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} engines: {node: 20 || >=22} - pathe@1.1.2: - resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + pathe@2.0.2: + resolution: {integrity: sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==} pathval@2.0.0: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} @@ -1103,12 +1108,8 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} - engines: {node: '>=12'} - - postcss@8.4.49: - resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} + postcss@8.5.1: + resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -1140,8 +1141,8 @@ packages: engines: {node: 20 || >=22} hasBin: true - rollup@4.29.1: - resolution: {integrity: sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==} + rollup@4.30.1: + resolution: {integrity: sha512-mlJ4glW020fPuLi7DkM/lN97mYEZGWeqBnrljzN0gs7GLctqX3lNWxKQ7Gl712UAX+6fog/L3jh4gb7R6aVi3w==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -1218,19 +1219,15 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.1: - resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} - - tinyglobby@0.2.10: - resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} - engines: {node: '>=12.0.0'} + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} tinypool@1.0.2: resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} engines: {node: ^18.0.0 || >=20.0.0} - tinyrainbow@1.2.0: - resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} tinyspy@3.0.2: @@ -1241,28 +1238,28 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - ts-api-utils@1.4.3: - resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} - engines: {node: '>=16'} + ts-api-utils@2.0.0: + resolution: {integrity: sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==} + engines: {node: '>=18.12'} peerDependencies: - typescript: '>=4.2.0' + typescript: '>=4.8.4' - ts-morph@24.0.0: - resolution: {integrity: sha512-2OAOg/Ob5yx9Et7ZX4CvTCc0UFoZHwLEJ+dpDPSUi5TgwwlTlX47w+iFRrEwzUZwYACjq83cgjS/Da50Ga37uw==} + ts-morph@25.0.0: + resolution: {integrity: sha512-ERPTUVO5qF8cEGJgAejGOsCVlbk8d0SDyiJsucKQT5XgqoZslv0Qml+gnui6Yy6o+uQqw5SestyW2HvlVtT/Sg==} type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - typescript-eslint@8.18.2: - resolution: {integrity: sha512-KuXezG6jHkvC3MvizeXgupZzaG5wjhU3yE8E7e6viOvAvD9xAWYp8/vy0WULTGe9DYDWcQu7aW03YIV3mSitrQ==} + typescript-eslint@8.20.0: + resolution: {integrity: sha512-Kxz2QRFsgbWj6Xcftlw3Dd154b3cEPFqQC+qMZrMypSijPd4UanKKvoKDrJ4o8AIfZFKAF+7sMaEIR8mTElozA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - typescript@5.7.2: - resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} + typescript@5.7.3: + resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} engines: {node: '>=14.17'} hasBin: true @@ -1272,27 +1269,32 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - vite-node@2.1.8: - resolution: {integrity: sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==} - engines: {node: ^18.0.0 || >=20.0.0} + vite-node@3.0.2: + resolution: {integrity: sha512-hsEQerBAHvVAbv40m3TFQe/lTEbOp7yDpyqMJqr2Tnd+W58+DEYOt+fluQgekOePcsNBmR77lpVAnIU2Xu4SvQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@5.4.11: - resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} - engines: {node: ^18.0.0 || >=20.0.0} + vite@6.0.7: + resolution: {integrity: sha512-RDt8r/7qx9940f8FcOIAH9PTViRrghKaK2K1jY3RaAURrEUbm9Du1mJ72G+jlhtG3WwodnfzY8ORQZbBavZEAQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' less: '*' lightningcss: ^1.21.0 sass: '*' sass-embedded: '*' stylus: '*' sugarss: '*' - terser: ^5.4.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: '@types/node': optional: true + jiti: + optional: true less: optional: true lightningcss: @@ -1307,16 +1309,20 @@ packages: optional: true terser: optional: true + tsx: + optional: true + yaml: + optional: true - vitest@2.1.8: - resolution: {integrity: sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==} - engines: {node: ^18.0.0 || >=20.0.0} + vitest@3.0.2: + resolution: {integrity: sha512-5bzaHakQ0hmVVKLhfh/jXf6oETDBtgPo8tQCHYB+wftNgFJ+Hah67IsWc8ivx4vFL025Ow8UiuTf4W57z4izvQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.1.8 - '@vitest/ui': 2.1.8 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.0.2 + '@vitest/ui': 3.0.2 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -1359,8 +1365,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - zigbee-herdsman@3.2.0: - resolution: {integrity: sha512-riF+sptb6PP33oeNer8P+KXK1b5cQh1EvsvZd0hqxCX/6uCZ5wFFCjqnsbixG2rXwxYGXmGb/QqYW45a1+qQPw==} + zigbee-herdsman@3.2.2: + resolution: {integrity: sha512-BMhgUExzZBmh3gbfmsGAnRX2WfbNeNIj9hJT/Z3FixOSszFY0seBclzFweTxEVBS/oV9O+TsKemKsUww102KzQ==} snapshots: @@ -1375,10 +1381,10 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/generator@7.26.3': + '@babel/generator@7.26.5': dependencies: - '@babel/parser': 7.26.3 - '@babel/types': 7.26.3 + '@babel/parser': 7.26.5 + '@babel/types': 7.26.5 '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.1.0 @@ -1387,107 +1393,113 @@ snapshots: '@babel/helper-validator-identifier@7.25.9': {} - '@babel/parser@7.26.3': + '@babel/parser@7.26.5': dependencies: - '@babel/types': 7.26.3 + '@babel/types': 7.26.5 '@babel/template@7.25.9': dependencies: '@babel/code-frame': 7.26.2 - '@babel/parser': 7.26.3 - '@babel/types': 7.26.3 + '@babel/parser': 7.26.5 + '@babel/types': 7.26.5 - '@babel/traverse@7.26.4': + '@babel/traverse@7.26.5': dependencies: '@babel/code-frame': 7.26.2 - '@babel/generator': 7.26.3 - '@babel/parser': 7.26.3 + '@babel/generator': 7.26.5 + '@babel/parser': 7.26.5 '@babel/template': 7.25.9 - '@babel/types': 7.26.3 + '@babel/types': 7.26.5 debug: 4.4.0 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.26.3': + '@babel/types@7.26.5': dependencies: '@babel/helper-string-parser': 7.25.9 '@babel/helper-validator-identifier': 7.25.9 - '@bcoe/v8-coverage@0.2.3': {} + '@bcoe/v8-coverage@1.0.2': {} + + '@esbuild/aix-ppc64@0.24.2': + optional: true + + '@esbuild/android-arm64@0.24.2': + optional: true - '@esbuild/aix-ppc64@0.21.5': + '@esbuild/android-arm@0.24.2': optional: true - '@esbuild/android-arm64@0.21.5': + '@esbuild/android-x64@0.24.2': optional: true - '@esbuild/android-arm@0.21.5': + '@esbuild/darwin-arm64@0.24.2': optional: true - '@esbuild/android-x64@0.21.5': + '@esbuild/darwin-x64@0.24.2': optional: true - '@esbuild/darwin-arm64@0.21.5': + '@esbuild/freebsd-arm64@0.24.2': optional: true - '@esbuild/darwin-x64@0.21.5': + '@esbuild/freebsd-x64@0.24.2': optional: true - '@esbuild/freebsd-arm64@0.21.5': + '@esbuild/linux-arm64@0.24.2': optional: true - '@esbuild/freebsd-x64@0.21.5': + '@esbuild/linux-arm@0.24.2': optional: true - '@esbuild/linux-arm64@0.21.5': + '@esbuild/linux-ia32@0.24.2': optional: true - '@esbuild/linux-arm@0.21.5': + '@esbuild/linux-loong64@0.24.2': optional: true - '@esbuild/linux-ia32@0.21.5': + '@esbuild/linux-mips64el@0.24.2': optional: true - '@esbuild/linux-loong64@0.21.5': + '@esbuild/linux-ppc64@0.24.2': optional: true - '@esbuild/linux-mips64el@0.21.5': + '@esbuild/linux-riscv64@0.24.2': optional: true - '@esbuild/linux-ppc64@0.21.5': + '@esbuild/linux-s390x@0.24.2': optional: true - '@esbuild/linux-riscv64@0.21.5': + '@esbuild/linux-x64@0.24.2': optional: true - '@esbuild/linux-s390x@0.21.5': + '@esbuild/netbsd-arm64@0.24.2': optional: true - '@esbuild/linux-x64@0.21.5': + '@esbuild/netbsd-x64@0.24.2': optional: true - '@esbuild/netbsd-x64@0.21.5': + '@esbuild/openbsd-arm64@0.24.2': optional: true - '@esbuild/openbsd-x64@0.21.5': + '@esbuild/openbsd-x64@0.24.2': optional: true - '@esbuild/sunos-x64@0.21.5': + '@esbuild/sunos-x64@0.24.2': optional: true - '@esbuild/win32-arm64@0.21.5': + '@esbuild/win32-arm64@0.24.2': optional: true - '@esbuild/win32-ia32@0.21.5': + '@esbuild/win32-ia32@0.24.2': optional: true - '@esbuild/win32-x64@0.21.5': + '@esbuild/win32-x64@0.24.2': optional: true - '@eslint-community/eslint-utils@4.4.1(eslint@9.17.0)': + '@eslint-community/eslint-utils@4.4.1(eslint@9.18.0)': dependencies: - eslint: 9.17.0 + eslint: 9.18.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} @@ -1500,7 +1512,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/core@0.9.1': + '@eslint/core@0.10.0': dependencies: '@types/json-schema': 7.0.15 @@ -1518,12 +1530,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.17.0': {} + '@eslint/js@9.18.0': {} '@eslint/object-schema@2.1.5': {} - '@eslint/plugin-kit@0.2.4': + '@eslint/plugin-kit@0.2.5': dependencies: + '@eslint/core': 0.10.0 levn: 0.4.1 '@humanfs/core@0.19.1': {} @@ -1539,12 +1552,12 @@ snapshots: '@humanwhocodes/retry@0.4.1': {} - '@ianvs/prettier-plugin-sort-imports@4.4.0(prettier@3.4.2)': + '@ianvs/prettier-plugin-sort-imports@4.4.1(prettier@3.4.2)': dependencies: - '@babel/generator': 7.26.3 - '@babel/parser': 7.26.3 - '@babel/traverse': 7.26.4 - '@babel/types': 7.26.3 + '@babel/generator': 7.26.5 + '@babel/parser': 7.26.5 + '@babel/traverse': 7.26.5 + '@babel/types': 7.26.5 prettier: 3.4.2 semver: 7.6.3 transitivePeerDependencies: @@ -1595,61 +1608,61 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/rollup-android-arm-eabi@4.29.1': + '@rollup/rollup-android-arm-eabi@4.30.1': optional: true - '@rollup/rollup-android-arm64@4.29.1': + '@rollup/rollup-android-arm64@4.30.1': optional: true - '@rollup/rollup-darwin-arm64@4.29.1': + '@rollup/rollup-darwin-arm64@4.30.1': optional: true - '@rollup/rollup-darwin-x64@4.29.1': + '@rollup/rollup-darwin-x64@4.30.1': optional: true - '@rollup/rollup-freebsd-arm64@4.29.1': + '@rollup/rollup-freebsd-arm64@4.30.1': optional: true - '@rollup/rollup-freebsd-x64@4.29.1': + '@rollup/rollup-freebsd-x64@4.30.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.29.1': + '@rollup/rollup-linux-arm-gnueabihf@4.30.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.29.1': + '@rollup/rollup-linux-arm-musleabihf@4.30.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.29.1': + '@rollup/rollup-linux-arm64-gnu@4.30.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.29.1': + '@rollup/rollup-linux-arm64-musl@4.30.1': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.29.1': + '@rollup/rollup-linux-loongarch64-gnu@4.30.1': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.29.1': + '@rollup/rollup-linux-powerpc64le-gnu@4.30.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.29.1': + '@rollup/rollup-linux-riscv64-gnu@4.30.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.29.1': + '@rollup/rollup-linux-s390x-gnu@4.30.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.29.1': + '@rollup/rollup-linux-x64-gnu@4.30.1': optional: true - '@rollup/rollup-linux-x64-musl@4.29.1': + '@rollup/rollup-linux-x64-musl@4.30.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.29.1': + '@rollup/rollup-win32-arm64-msvc@4.30.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.29.1': + '@rollup/rollup-win32-ia32-msvc@4.30.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.29.1': + '@rollup/rollup-win32-x64-msvc@4.30.1': optional: true '@serialport/bindings-cpp@12.0.1': @@ -1679,15 +1692,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@ts-morph/common@0.25.0': + '@ts-morph/common@0.26.0': dependencies: + fast-glob: 3.3.3 minimatch: 9.0.5 path-browserify: 1.0.1 - tinyglobby: 0.2.10 '@types/buffer-crc32@0.2.4': dependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 '@types/eslint@9.6.1': dependencies: @@ -1702,93 +1715,93 @@ snapshots: '@types/json-schema@7.0.15': {} - '@types/node@22.10.2': + '@types/node@22.10.7': dependencies: undici-types: 6.20.0 '@types/semver@7.5.8': {} - '@typescript-eslint/eslint-plugin@8.18.2(@typescript-eslint/parser@8.18.2(eslint@9.17.0)(typescript@5.7.2))(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/eslint-plugin@8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.18.2(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/scope-manager': 8.18.2 - '@typescript-eslint/type-utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/visitor-keys': 8.18.2 - eslint: 9.17.0 + '@typescript-eslint/parser': 8.20.0(eslint@9.18.0)(typescript@5.7.3) + '@typescript-eslint/scope-manager': 8.20.0 + '@typescript-eslint/type-utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3) + '@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.20.0 + eslint: 9.18.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.4.3(typescript@5.7.2) - typescript: 5.7.2 + ts-api-utils: 2.0.0(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.18.2(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3)': dependencies: - '@typescript-eslint/scope-manager': 8.18.2 - '@typescript-eslint/types': 8.18.2 - '@typescript-eslint/typescript-estree': 8.18.2(typescript@5.7.2) - '@typescript-eslint/visitor-keys': 8.18.2 + '@typescript-eslint/scope-manager': 8.20.0 + '@typescript-eslint/types': 8.20.0 + '@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.20.0 debug: 4.4.0 - eslint: 9.17.0 - typescript: 5.7.2 + eslint: 9.18.0 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.18.2': + '@typescript-eslint/scope-manager@8.20.0': dependencies: - '@typescript-eslint/types': 8.18.2 - '@typescript-eslint/visitor-keys': 8.18.2 + '@typescript-eslint/types': 8.20.0 + '@typescript-eslint/visitor-keys': 8.20.0 - '@typescript-eslint/type-utils@8.18.2(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/type-utils@8.20.0(eslint@9.18.0)(typescript@5.7.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.18.2(typescript@5.7.2) - '@typescript-eslint/utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3) + '@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3) debug: 4.4.0 - eslint: 9.17.0 - ts-api-utils: 1.4.3(typescript@5.7.2) - typescript: 5.7.2 + eslint: 9.18.0 + ts-api-utils: 2.0.0(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.18.2': {} + '@typescript-eslint/types@8.20.0': {} - '@typescript-eslint/typescript-estree@8.18.2(typescript@5.7.2)': + '@typescript-eslint/typescript-estree@8.20.0(typescript@5.7.3)': dependencies: - '@typescript-eslint/types': 8.18.2 - '@typescript-eslint/visitor-keys': 8.18.2 + '@typescript-eslint/types': 8.20.0 + '@typescript-eslint/visitor-keys': 8.20.0 debug: 4.4.0 - fast-glob: 3.3.2 + fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.4.3(typescript@5.7.2) - typescript: 5.7.2 + ts-api-utils: 2.0.0(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.18.2(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/utils@8.20.0(eslint@9.18.0)(typescript@5.7.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.17.0) - '@typescript-eslint/scope-manager': 8.18.2 - '@typescript-eslint/types': 8.18.2 - '@typescript-eslint/typescript-estree': 8.18.2(typescript@5.7.2) - eslint: 9.17.0 - typescript: 5.7.2 + '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0) + '@typescript-eslint/scope-manager': 8.20.0 + '@typescript-eslint/types': 8.20.0 + '@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3) + eslint: 9.18.0 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.18.2': + '@typescript-eslint/visitor-keys@8.20.0': dependencies: - '@typescript-eslint/types': 8.18.2 + '@typescript-eslint/types': 8.20.0 eslint-visitor-keys: 4.2.0 - '@vitest/coverage-v8@2.1.8(vitest@2.1.8(@types/node@22.10.2))': + '@vitest/coverage-v8@3.0.2(vitest@3.0.2(@types/node@22.10.7))': dependencies: '@ampproject/remapping': 2.3.0 - '@bcoe/v8-coverage': 0.2.3 + '@bcoe/v8-coverage': 1.0.2 debug: 4.4.0 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 @@ -1798,50 +1811,50 @@ snapshots: magicast: 0.3.5 std-env: 3.8.0 test-exclude: 7.0.1 - tinyrainbow: 1.2.0 - vitest: 2.1.8(@types/node@22.10.2) + tinyrainbow: 2.0.0 + vitest: 3.0.2(@types/node@22.10.7) transitivePeerDependencies: - supports-color - '@vitest/expect@2.1.8': + '@vitest/expect@3.0.2': dependencies: - '@vitest/spy': 2.1.8 - '@vitest/utils': 2.1.8 + '@vitest/spy': 3.0.2 + '@vitest/utils': 3.0.2 chai: 5.1.2 - tinyrainbow: 1.2.0 + tinyrainbow: 2.0.0 - '@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.2))': + '@vitest/mocker@3.0.2(vite@6.0.7(@types/node@22.10.7))': dependencies: - '@vitest/spy': 2.1.8 + '@vitest/spy': 3.0.2 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 5.4.11(@types/node@22.10.2) + vite: 6.0.7(@types/node@22.10.7) - '@vitest/pretty-format@2.1.8': + '@vitest/pretty-format@3.0.2': dependencies: - tinyrainbow: 1.2.0 + tinyrainbow: 2.0.0 - '@vitest/runner@2.1.8': + '@vitest/runner@3.0.2': dependencies: - '@vitest/utils': 2.1.8 - pathe: 1.1.2 + '@vitest/utils': 3.0.2 + pathe: 2.0.2 - '@vitest/snapshot@2.1.8': + '@vitest/snapshot@3.0.2': dependencies: - '@vitest/pretty-format': 2.1.8 + '@vitest/pretty-format': 3.0.2 magic-string: 0.30.17 - pathe: 1.1.2 + pathe: 2.0.2 - '@vitest/spy@2.1.8': + '@vitest/spy@3.0.2': dependencies: tinyspy: 3.0.2 - '@vitest/utils@2.1.8': + '@vitest/utils@3.0.2': dependencies: - '@vitest/pretty-format': 2.1.8 + '@vitest/pretty-format': 3.0.2 loupe: 3.1.2 - tinyrainbow: 1.2.0 + tinyrainbow: 2.0.0 acorn-jsx@5.3.2(acorn@8.14.0): dependencies: @@ -1953,37 +1966,39 @@ snapshots: es-module-lexer@1.6.0: {} - esbuild@0.21.5: + esbuild@0.24.2: optionalDependencies: - '@esbuild/aix-ppc64': 0.21.5 - '@esbuild/android-arm': 0.21.5 - '@esbuild/android-arm64': 0.21.5 - '@esbuild/android-x64': 0.21.5 - '@esbuild/darwin-arm64': 0.21.5 - '@esbuild/darwin-x64': 0.21.5 - '@esbuild/freebsd-arm64': 0.21.5 - '@esbuild/freebsd-x64': 0.21.5 - '@esbuild/linux-arm': 0.21.5 - '@esbuild/linux-arm64': 0.21.5 - '@esbuild/linux-ia32': 0.21.5 - '@esbuild/linux-loong64': 0.21.5 - '@esbuild/linux-mips64el': 0.21.5 - '@esbuild/linux-ppc64': 0.21.5 - '@esbuild/linux-riscv64': 0.21.5 - '@esbuild/linux-s390x': 0.21.5 - '@esbuild/linux-x64': 0.21.5 - '@esbuild/netbsd-x64': 0.21.5 - '@esbuild/openbsd-x64': 0.21.5 - '@esbuild/sunos-x64': 0.21.5 - '@esbuild/win32-arm64': 0.21.5 - '@esbuild/win32-ia32': 0.21.5 - '@esbuild/win32-x64': 0.21.5 + '@esbuild/aix-ppc64': 0.24.2 + '@esbuild/android-arm': 0.24.2 + '@esbuild/android-arm64': 0.24.2 + '@esbuild/android-x64': 0.24.2 + '@esbuild/darwin-arm64': 0.24.2 + '@esbuild/darwin-x64': 0.24.2 + '@esbuild/freebsd-arm64': 0.24.2 + '@esbuild/freebsd-x64': 0.24.2 + '@esbuild/linux-arm': 0.24.2 + '@esbuild/linux-arm64': 0.24.2 + '@esbuild/linux-ia32': 0.24.2 + '@esbuild/linux-loong64': 0.24.2 + '@esbuild/linux-mips64el': 0.24.2 + '@esbuild/linux-ppc64': 0.24.2 + '@esbuild/linux-riscv64': 0.24.2 + '@esbuild/linux-s390x': 0.24.2 + '@esbuild/linux-x64': 0.24.2 + '@esbuild/netbsd-arm64': 0.24.2 + '@esbuild/netbsd-x64': 0.24.2 + '@esbuild/openbsd-arm64': 0.24.2 + '@esbuild/openbsd-x64': 0.24.2 + '@esbuild/sunos-x64': 0.24.2 + '@esbuild/win32-arm64': 0.24.2 + '@esbuild/win32-ia32': 0.24.2 + '@esbuild/win32-x64': 0.24.2 escape-string-regexp@4.0.0: {} - eslint-config-prettier@9.1.0(eslint@9.17.0): + eslint-config-prettier@10.0.1(eslint@9.18.0): dependencies: - eslint: 9.17.0 + eslint: 9.18.0 eslint-scope@8.2.0: dependencies: @@ -1994,15 +2009,15 @@ snapshots: eslint-visitor-keys@4.2.0: {} - eslint@9.17.0: + eslint@9.18.0: dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.17.0) + '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0) '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.19.1 - '@eslint/core': 0.9.1 + '@eslint/core': 0.10.0 '@eslint/eslintrc': 3.2.0 - '@eslint/js': 9.17.0 - '@eslint/plugin-kit': 0.2.4 + '@eslint/js': 9.18.0 + '@eslint/plugin-kit': 0.2.5 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.1 @@ -2059,7 +2074,7 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-glob@3.3.2: + fast-glob@3.3.3: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 @@ -2075,10 +2090,6 @@ snapshots: dependencies: reusify: 1.0.4 - fdir@6.4.2(picomatch@4.0.2): - optionalDependencies: - picomatch: 4.0.2 - file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -2124,7 +2135,7 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 - glob@11.0.0: + glob@11.0.1: dependencies: foreground-child: 3.3.0 jackspeak: 4.0.2 @@ -2242,8 +2253,8 @@ snapshots: magicast@0.3.5: dependencies: - '@babel/parser': 7.26.3 - '@babel/types': 7.26.3 + '@babel/parser': 7.26.5 + '@babel/types': 7.26.5 source-map-js: 1.2.1 make-dir@4.0.0: @@ -2329,7 +2340,7 @@ snapshots: lru-cache: 11.0.2 minipass: 7.1.2 - pathe@1.1.2: {} + pathe@2.0.2: {} pathval@2.0.0: {} @@ -2337,9 +2348,7 @@ snapshots: picomatch@2.3.1: {} - picomatch@4.0.2: {} - - postcss@8.4.49: + postcss@8.5.1: dependencies: nanoid: 3.3.8 picocolors: 1.1.1 @@ -2359,32 +2368,32 @@ snapshots: rimraf@6.0.1: dependencies: - glob: 11.0.0 + glob: 11.0.1 package-json-from-dist: 1.0.1 - rollup@4.29.1: + rollup@4.30.1: dependencies: '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.29.1 - '@rollup/rollup-android-arm64': 4.29.1 - '@rollup/rollup-darwin-arm64': 4.29.1 - '@rollup/rollup-darwin-x64': 4.29.1 - '@rollup/rollup-freebsd-arm64': 4.29.1 - '@rollup/rollup-freebsd-x64': 4.29.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.29.1 - '@rollup/rollup-linux-arm-musleabihf': 4.29.1 - '@rollup/rollup-linux-arm64-gnu': 4.29.1 - '@rollup/rollup-linux-arm64-musl': 4.29.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.29.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.29.1 - '@rollup/rollup-linux-riscv64-gnu': 4.29.1 - '@rollup/rollup-linux-s390x-gnu': 4.29.1 - '@rollup/rollup-linux-x64-gnu': 4.29.1 - '@rollup/rollup-linux-x64-musl': 4.29.1 - '@rollup/rollup-win32-arm64-msvc': 4.29.1 - '@rollup/rollup-win32-ia32-msvc': 4.29.1 - '@rollup/rollup-win32-x64-msvc': 4.29.1 + '@rollup/rollup-android-arm-eabi': 4.30.1 + '@rollup/rollup-android-arm64': 4.30.1 + '@rollup/rollup-darwin-arm64': 4.30.1 + '@rollup/rollup-darwin-x64': 4.30.1 + '@rollup/rollup-freebsd-arm64': 4.30.1 + '@rollup/rollup-freebsd-x64': 4.30.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.30.1 + '@rollup/rollup-linux-arm-musleabihf': 4.30.1 + '@rollup/rollup-linux-arm64-gnu': 4.30.1 + '@rollup/rollup-linux-arm64-musl': 4.30.1 + '@rollup/rollup-linux-loongarch64-gnu': 4.30.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.30.1 + '@rollup/rollup-linux-riscv64-gnu': 4.30.1 + '@rollup/rollup-linux-s390x-gnu': 4.30.1 + '@rollup/rollup-linux-x64-gnu': 4.30.1 + '@rollup/rollup-linux-x64-musl': 4.30.1 + '@rollup/rollup-win32-arm64-msvc': 4.30.1 + '@rollup/rollup-win32-ia32-msvc': 4.30.1 + '@rollup/rollup-win32-x64-msvc': 4.30.1 fsevents: 2.3.3 run-parallel@1.2.0: @@ -2449,16 +2458,11 @@ snapshots: tinybench@2.9.0: {} - tinyexec@0.3.1: {} - - tinyglobby@0.2.10: - dependencies: - fdir: 6.4.2(picomatch@4.0.2) - picomatch: 4.0.2 + tinyexec@0.3.2: {} tinypool@1.0.2: {} - tinyrainbow@1.2.0: {} + tinyrainbow@2.0.0: {} tinyspy@3.0.2: {} @@ -2466,30 +2470,30 @@ snapshots: dependencies: is-number: 7.0.0 - ts-api-utils@1.4.3(typescript@5.7.2): + ts-api-utils@2.0.0(typescript@5.7.3): dependencies: - typescript: 5.7.2 + typescript: 5.7.3 - ts-morph@24.0.0: + ts-morph@25.0.0: dependencies: - '@ts-morph/common': 0.25.0 + '@ts-morph/common': 0.26.0 code-block-writer: 13.0.3 type-check@0.4.0: dependencies: prelude-ls: 1.2.1 - typescript-eslint@8.18.2(eslint@9.17.0)(typescript@5.7.2): + typescript-eslint@8.20.0(eslint@9.18.0)(typescript@5.7.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.18.2(@typescript-eslint/parser@8.18.2(eslint@9.17.0)(typescript@5.7.2))(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/parser': 8.18.2(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) - eslint: 9.17.0 - typescript: 5.7.2 + '@typescript-eslint/eslint-plugin': 8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3) + '@typescript-eslint/parser': 8.20.0(eslint@9.18.0)(typescript@5.7.3) + '@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3) + eslint: 9.18.0 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - typescript@5.7.2: {} + typescript@5.7.3: {} undici-types@6.20.0: {} @@ -2497,15 +2501,16 @@ snapshots: dependencies: punycode: 2.3.1 - vite-node@2.1.8(@types/node@22.10.2): + vite-node@3.0.2(@types/node@22.10.7): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 - pathe: 1.1.2 - vite: 5.4.11(@types/node@22.10.2) + pathe: 2.0.2 + vite: 6.0.7(@types/node@22.10.7) transitivePeerDependencies: - '@types/node' + - jiti - less - lightningcss - sass @@ -2514,41 +2519,44 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml - vite@5.4.11(@types/node@22.10.2): + vite@6.0.7(@types/node@22.10.7): dependencies: - esbuild: 0.21.5 - postcss: 8.4.49 - rollup: 4.29.1 + esbuild: 0.24.2 + postcss: 8.5.1 + rollup: 4.30.1 optionalDependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 fsevents: 2.3.3 - vitest@2.1.8(@types/node@22.10.2): + vitest@3.0.2(@types/node@22.10.7): dependencies: - '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.2)) - '@vitest/pretty-format': 2.1.8 - '@vitest/runner': 2.1.8 - '@vitest/snapshot': 2.1.8 - '@vitest/spy': 2.1.8 - '@vitest/utils': 2.1.8 + '@vitest/expect': 3.0.2 + '@vitest/mocker': 3.0.2(vite@6.0.7(@types/node@22.10.7)) + '@vitest/pretty-format': 3.0.2 + '@vitest/runner': 3.0.2 + '@vitest/snapshot': 3.0.2 + '@vitest/spy': 3.0.2 + '@vitest/utils': 3.0.2 chai: 5.1.2 debug: 4.4.0 expect-type: 1.1.0 magic-string: 0.30.17 - pathe: 1.1.2 + pathe: 2.0.2 std-env: 3.8.0 tinybench: 2.9.0 - tinyexec: 0.3.1 + tinyexec: 0.3.2 tinypool: 1.0.2 - tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@22.10.2) - vite-node: 2.1.8(@types/node@22.10.2) + tinyrainbow: 2.0.0 + vite: 6.0.7(@types/node@22.10.7) + vite-node: 3.0.2(@types/node@22.10.7) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 transitivePeerDependencies: + - jiti - less - lightningcss - msw @@ -2558,6 +2566,8 @@ snapshots: - sugarss - supports-color - terser + - tsx + - yaml which@2.0.2: dependencies: @@ -2584,7 +2594,7 @@ snapshots: yocto-queue@0.1.0: {} - zigbee-herdsman@3.2.0: + zigbee-herdsman@3.2.2: dependencies: '@serialport/bindings-cpp': 12.0.1 '@serialport/parser-delimiter': 12.0.0 diff --git a/scripts/modernExtendRefactor.ts b/scripts/modernExtendRefactor.ts deleted file mode 100644 index 6467308d8c77b..0000000000000 --- a/scripts/modernExtendRefactor.ts +++ /dev/null @@ -1,156 +0,0 @@ -import {Project, QuoteKind, SyntaxKind} from 'ts-morph'; - -const project = new Project({ - manipulationSettings: { - quoteKind: QuoteKind.Single, - insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: false, - }, -}); -project.addSourceFilesAtPaths('src/devices/*.ts'); - -let totalDefinitions = 0; -let totalDefinitionsWithModernExtend = 0; - -project.getSourceFiles().forEach((sourceFile) => { - if (sourceFile.getBaseName() === 'index.ts') return; - console.log(`Handling ${sourceFile.getBaseName()}`); - - let changed = true; - let save = false; - const type = 'mullerLichtLight'; - while (changed) { - changed = false; - const definitions = sourceFile.getVariableStatementOrThrow('definitions').getDescendantsOfKind(SyntaxKind.ObjectLiteralExpression); - let localTotalDefinitionsWithModernExtend = 0; - - for (const definition of definitions) { - const childs = definition.getChildrenOfKind(SyntaxKind.PropertyAssignment); - const model = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'model'); - const extend = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'extend'); - // const exposes = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'exposes'); - // const configure = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'configure'); - const fromZigbee = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'fromZigbee'); - const toZigbee = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'toZigbee'); - // const meta = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'meta'); - // const endpoint = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'endpoint'); - - // const ota = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'ota'); - - if (extend?.getFullText().includes('extend.light_onoff') && !fromZigbee && toZigbee?.getFullText().includes('tint_scene')) { - console.log(`Handling ${model?.getFullText().trim()}`); - toZigbee?.remove(); - const newOpts: {[s: string]: unknown} = {}; // {endpoints: eval(`(${endpoint.getFullText().split('return ')[1].split(';')[0]})`)}; - // configure?.remove(); - // endpoint?.remove(); - const extendFeatures = extend.getFullText().split('(')[0].split('_'); - if (extendFeatures.includes('colortemp')) { - newOpts.colorTemp = {range: null}; - } - if (extendFeatures.includes('color')) { - newOpts.color = true; - } - if (extendFeatures.includes('gradient')) { - newOpts.gradient = true; - } - let opts = extend?.getFullText().split('(')[1].slice(0, -1).trim(); - if (opts) { - if (opts[opts.length - 1] === ',') { - opts = opts.substring(0, opts.length - 1); - } - const evalOpts = Object.entries(eval(`(${opts})`)); - for (const [key, value] of evalOpts) { - if (key === 'colorTempRange') { - newOpts.colorTemp = {...(newOpts.colorTemp as object), range: value}; - } else if (key === 'disableColorTempStartup') { - // @ts-expect-error ignore - newOpts.colorTemp = {...newOpts.colorTemp, startup: !value}; - } else if (key === 'disablePowerOnBehavior') { - newOpts.powerOnBehavior = !value; - } else if (key === 'disableEffect') { - newOpts.effect = !value; - } else if (key === 'disableHueEffects') { - newOpts.hueEffect = !value; - } else if (key === 'supportsHueAndSaturation' || key === 'preferHueAndSaturation') { - // @ts-expect-error ignore - newOpts.color = {...newOpts.color, modes: evalOpts.preferHueAndSaturation ? ['hs', 'xy'] : ['xy', 'hs']}; - } else if (key === 'extraEffects') { - // @ts-expect-error ignore - newOpts.gradient = {...newOpts.gradient, extraEffects: value}; - } else if (key === 'noConfigure') { - // ignore - } else { - throw new Error(`Unsupported ${key} - ${value}`); - } - } - } - // if (meta) { - // for (const [key, value] of Object.entries(eval(`(${meta?.getFullText().replace('meta: ', '')})`))) { - // if (key === 'turnsOffAtBrightness1') { - // newOpts.turnsOffAtBrightness1 = value; - // } else if (key === 'applyRedFix') { - // // @ts-expect-error ignore - // newOpts.color = {...newOpts.color, applyRedFix: value}; - // } else if (key === 'supportsEnhancedHue') { - // // @ts-expect-error ignore - // newOpts.color = {...newOpts.color, enhancedHue: value}; - // } else if (key === 'multiEndpoint' || key === 'disableDefaultResponse') { - // // ignore - // } else { - // throw new Error(`Unsupported ${key} - ${value}`); - // } - // } - // // meta.remove(); - // } - // if (ota) { - // ota.remove(); - // } - - localTotalDefinitionsWithModernExtend += 1; - extend.replaceWithText( - `extend: [${type}(${JSON.stringify(newOpts) - .split(`"`) - .join('') - .replace(`range:null`, `range:undefined`) - .replace(`xy`, `'xy'`) - .replace(`hs`, `'hs'`) - .replace(`({})`, `()`)})]`, - ); - changed = true; - save = true; - break; - } else if (extend?.getFirstChildByKind(SyntaxKind.ArrayLiteralExpression)) { - localTotalDefinitionsWithModernExtend += 1; - } - } - - if (!changed) { - totalDefinitions += definitions.length; - totalDefinitionsWithModernExtend += localTotalDefinitionsWithModernExtend; - } - } - - if (save) { - const modernExtendImport = sourceFile - .getImportDeclarations() - .find((d) => d.getModuleSpecifierSourceFile()?.getBaseName() === 'modernExtend.ts'); - if (!modernExtendImport) { - sourceFile.addImportDeclaration({moduleSpecifier: '../lib/modernExtend', namedImports: [type]}); - } else { - if (!modernExtendImport.getNamedImports().find((i) => i.getName() === type)) { - modernExtendImport.addNamedImport(type); - } - } - - const extendImport = sourceFile.getImportDeclarations().find((d) => d.getModuleSpecifierSourceFile()?.getBaseName() === 'extend.ts'); - if (!sourceFile.getFullText().includes('extend.') && extendImport) { - extendImport.remove(); - } - - sourceFile.saveSync(); - } -}); - -console.log( - `${totalDefinitionsWithModernExtend} out of ${totalDefinitions} use modern extend ` + - `(${(totalDefinitionsWithModernExtend / totalDefinitions) * 100}%)`, -); diff --git a/scripts/refactor.ts b/scripts/refactor.ts new file mode 100644 index 0000000000000..9eef0f6d3d955 --- /dev/null +++ b/scripts/refactor.ts @@ -0,0 +1,134 @@ +// In the root of this repo, execute: `npx ts-node scripts/refactor.ts` + +import {assert} from 'console'; + +import {ArrayLiteralExpression, Project, QuoteKind, SyntaxKind} from 'ts-morph'; + +const project = new Project({ + manipulationSettings: { + quoteKind: QuoteKind.Single, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: false, + }, +}); +project.addSourceFilesAtPaths('src/devices/*.ts'); + +//#region Refactor modernExtend temperature() to m.temperature() +project.getSourceFiles().forEach((sourceFile) => { + if (sourceFile.getBaseName() === 'index.ts') return; + console.log(`Handling ${sourceFile.getBaseName()}`); + + let save = false; + + const definitions = sourceFile + .getVariableStatementOrThrow('definitions') + .getDeclarations()[0] + .getInitializerOrThrow() + .asKindOrThrow(SyntaxKind.ArrayLiteralExpression); + + for (const definition of definitions.getElements()) { + const childs = definition.getChildrenOfKind(SyntaxKind.PropertyAssignment); + const fingerprint = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'fingerprint'); + const model = childs.find((c) => c.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'model'); + const fingerprintArray = fingerprint?.getFirstChildByKind(SyntaxKind.ArrayLiteralExpression); + if (fingerprintArray) { + const lookup: {[s: string]: Set} = {}; + let match = true; + for (const f of fingerprintArray.getElements()) { + let modelID: string | undefined; + let manufacturerName: string | undefined; + for (const p of f.getChildrenOfKind(SyntaxKind.PropertyAssignment)) { + if (p.getName() === 'modelID') { + modelID = p.getInitializer()?.getText(); + } else if (p.getName() === 'manufacturerName') { + manufacturerName = p.getInitializer()?.getText(); + } else { + match = false; + } + } + + if (modelID && manufacturerName && manufacturerName.includes('_T')) { + if (!(modelID in lookup)) lookup[modelID] = new Set(); + lookup[modelID].add(manufacturerName); + } else { + match = false; + console.log(`skip ${model?.getText()} (${modelID}, ${manufacturerName} ${manufacturerName?.includes('_T')})`); + break; + } + } + + if (match) { + if (Object.keys(lookup).length == 1) { + const key = Object.keys(lookup)[0]; + fingerprintArray.replaceWithText(`tuya.fingerprint(${key}, [${[...lookup[key]]}])`); + } else { + let txt: string[] = []; + for (const [modelID, manufacturers] of Object.entries(lookup)) { + txt.push(`...tuya.fingerprint(${modelID}, [${[...manufacturers]}])`); + } + fingerprintArray.replaceWithText(`[` + txt.join(', ') + `]`); + } + save = true; + } + } + } + + if (save) { + const modernExtendImport = sourceFile.getImportDeclarations().filter((d) => d.getModuleSpecifierSourceFile()?.getBaseName() === 'tuya.ts'); + let match = false; + for (const i of modernExtendImport) { + match = true; + i.remove(); + } + + sourceFile.addImportDeclaration({ + moduleSpecifier: '../lib/tuya', + namespaceImport: 'tuya', + }); + sourceFile.saveSync(); + } +}); + +//#region Refactor modernExtend temperature() to m.temperature() +// project.getSourceFiles().forEach((sourceFile) => { +// if (sourceFile.getBaseName() === 'index.ts') return; +// console.log(`Handling ${sourceFile.getBaseName()}`); + +// let save = false; + +// const modernExtendImport = sourceFile +// .getImportDeclarations() +// .filter((d) => d.getModuleSpecifierSourceFile()?.getBaseName() === 'modernExtend.ts'); + +// for (const i of modernExtendImport) { +// for (const n of i.getNamedImports()) { +// const references = sourceFile.getDescendantsOfKind(SyntaxKind.Identifier).filter((identifier) => identifier.getText() === n.getText()); +// references.forEach((reference) => { +// if (reference.getParent().getKind() == SyntaxKind.CallExpression) { +// reference.replaceWithText(`m.${reference.getText()}`); +// } +// }); +// } +// } + +// save = true; + +// if (save) { +// const modernExtendImport = sourceFile +// .getImportDeclarations() +// .filter((d) => d.getModuleSpecifierSourceFile()?.getBaseName() === 'modernExtend.ts'); +// let match = false; +// for (const i of modernExtendImport) { +// match = true; +// i.remove(); +// } + +// if (match) { +// sourceFile.addImportDeclaration({ +// moduleSpecifier: '../lib/modernExtend', +// namespaceImport: 'm', +// }); +// } + +// sourceFile.saveSync(); +// } +// }); diff --git a/src/converters/fromZigbee.ts b/src/converters/fromZigbee.ts index ad2b4d4043fb4..c0689a4fba759 100644 --- a/src/converters/fromZigbee.ts +++ b/src/converters/fromZigbee.ts @@ -485,15 +485,6 @@ const converters1 = { return {soil_moisture: soilMoisture}; }, } satisfies Fz.Converter, - illuminance: { - cluster: 'msIlluminanceMeasurement', - type: ['attributeReport', 'readResponse'], - convert: (model, msg, publish, options, meta) => { - const illuminance = msg.data['measuredValue']; - const illuminanceLux = illuminance === 0 ? 0 : Math.pow(10, (illuminance - 1) / 10000); - return {illuminance: illuminanceLux}; - }, - } satisfies Fz.Converter, pressure: { cluster: 'msPressureMeasurement', type: ['attributeReport', 'readResponse'], @@ -512,7 +503,7 @@ const converters1 = { cluster: 'msCO2', type: ['attributeReport', 'readResponse'], convert: (model, msg, publish, options, meta) => { - return {co2: Math.floor(msg.data.measuredValue * 1000000)}; + return {co2: Math.floor(1 / msg.data.measuredValue)}; }, } satisfies Fz.Converter, occupancy: { diff --git a/src/converters/toZigbee.ts b/src/converters/toZigbee.ts index 1ca0db90ef53d..8ccabdac1dd65 100644 --- a/src/converters/toZigbee.ts +++ b/src/converters/toZigbee.ts @@ -1054,7 +1054,7 @@ const converters2 = { }, } satisfies Tz.Converter, light_onoff_brightness: { - key: ['state', 'brightness', 'brightness_percent', 'on_time', 'off_wait_time'], + key: ['state', 'brightness', 'brightness_percent'], options: [exposes.options.transition()], convertSet: async (entity, key, value, meta) => { const {message} = meta; @@ -1893,12 +1893,6 @@ const converters2 = { await entity.read('msRelativeHumidity', ['measuredValue']); }, } satisfies Tz.Converter, - illuminance: { - key: ['illuminance'], - convertGet: async (entity, key, meta) => { - await entity.read('msIlluminanceMeasurement', ['measuredValue']); - }, - } satisfies Tz.Converter, // #endregion // #region Non-generic converters diff --git a/src/devices/acuity_brands_lighting.ts b/src/devices/acuity_brands_lighting.ts index 0e22a586a3beb..749adb2bea3fb 100644 --- a/src/devices/acuity_brands_lighting.ts +++ b/src/devices/acuity_brands_lighting.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,21 +7,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'WF4C_WF6C', vendor: 'Acuity Brands Lighting (ABL)', description: 'Juno 4" and 6" LED smart wafer downlight', - extend: [light({colorTemp: {range: [200, 370], startup: false}})], + extend: [m.light({colorTemp: {range: [200, 370], startup: false}})], }, { zigbeeModel: ['ABL-LIGHT-Z-201'], model: 'RB56SC', vendor: 'Acuity Brands Lighting (ABL)', description: 'Juno Retrobasics 4" and 6" LED smart downlight', - extend: [light({colorTemp: {range: [200, 370], startup: false}, color: true})], + extend: [m.light({colorTemp: {range: [200, 370], startup: false}, color: true})], }, { zigbeeModel: ['ABL-LIGHT-Z-202'], model: 'RB56AC', vendor: 'Acuity Brands Lighting (ABL)', description: 'Juno Retrobasics 4" and 6" LED smart adjustable downlight', - extend: [light({colorTemp: {range: [200, 370], startup: false}, color: true})], + extend: [m.light({colorTemp: {range: [200, 370], startup: false}, color: true})], }, ]; diff --git a/src/devices/adeo.ts b/src/devices/adeo.ts index 810bbba7bd939..56c4cbb81093c 100644 --- a/src/devices/adeo.ts +++ b/src/devices/adeo.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {battery, electricityMeter, humidity, iasZoneAlarm, illuminance, light, onOff, quirkCheckinInterval, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {nodonPilotWire} from '../lib/nodon'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, Tz} from '../lib/types'; @@ -78,70 +78,70 @@ const definitions: DefinitionWithExtend[] = [ model: 'IA-CDZOTAAA007MA-MAN', vendor: 'ADEO', description: 'ENKI LEXMAN E27 7.2 to 60W LED RGBW', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-2'], model: 'IG-CDZOTAAG014RA-MAN', vendor: 'ADEO', description: 'ENKI LEXMAN E27 14W to 100W LED RGBW v2', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-3'], model: 'IP-CDZOTAAP005JA-MAN', vendor: 'ADEO', description: 'ENKI LEXMAN E14 LED RGBW', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-4'], model: 'IM-CDZDGAAA0005KA_MAN', vendor: 'ADEO', description: 'ENKI LEXMAN RGBTW GU10 Bulb', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-5'], model: 'IST-CDZFB2AS007NA-MZN-01', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED white', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['SIN-4-1-21_EQU'], model: 'SIN-4-1-21_EQU', vendor: 'ADEO', description: 'Multifunction relay switch with metering', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['ZBEK-7'], model: 'IST-CDZFB2AS007NA-MZN-02', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED Edison white filament 806 lumen', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-8'], model: 'IG-CDZFB2G009RA-MZN-02', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED white filament 1055 lumen', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-9'], model: 'IA-CDZFB2AA007NA-MZN-02', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED white', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-6'], model: 'IG-CDZB2AG009RA-MZN-01', vendor: 'ADEO', description: 'ENKI LEXMAN E27 Led white bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { @@ -149,98 +149,98 @@ const definitions: DefinitionWithExtend[] = [ model: 'IC-CDZFB2AC004HA-MZN', vendor: 'ADEO', description: 'ENKI LEXMAN E14 LED white', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-11'], model: 'IM-CDZDGAAG005KA-MZN', vendor: 'ADEO', description: 'ENKI LEXMAN GU-10 LED white', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-12'], model: 'IA-CDZFB2AA007NA-MZN-01', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED white', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-13'], model: 'IG-CDZFB2AG010RA-MNZ', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED white', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-14'], model: 'IC-CDZFB2AC005HA-MZN', vendor: 'ADEO', description: 'ENKI LEXMAN E14 LED white', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBEK-22'], model: 'BD05C-FL-21-G-ENK', vendor: 'ADEO', description: 'ENKI LEXMAN RGBCCT lamp', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-27'], model: '84845506', vendor: 'ADEO', description: 'ENKI LEXMAN Gdansk', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-29'], model: '84845509', vendor: 'ADEO', description: 'ENKI LEXMAN Gdansk LED panel', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-28'], model: 'PEZ1-042-1020-C1D1', vendor: 'ADEO', description: 'ENKI LEXMAN Gdansk', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-31'], model: '84870054', vendor: 'ADEO', description: 'ENKI LEXMAN Extraflat 85', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-32'], model: 'ZBEK-32', vendor: 'ADEO', description: 'ENKI Inspire Extraflat D12', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ZBEK-34'], model: '84870058', vendor: 'ADEO', description: 'ENKI LEXMAN Extraflat 225 ', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['LDSENK01F'], model: 'LDSENK01F', vendor: 'ADEO', description: '10A EU smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['LDSENK01S'], model: 'LDSENK01S', vendor: 'ADEO', description: '10A EU smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['LXEK-5', 'ZBEK-26'], @@ -294,28 +294,28 @@ const definitions: DefinitionWithExtend[] = [ model: '9CZA-A806ST-Q1A', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED RGBW', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['LXEK-3'], model: '9CZA-P470T-A1A', vendor: 'ADEO', description: 'ENKI LEXMAN E14 LED RGBW', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['LXEK-4'], model: '9CZA-M350ST-Q1A', vendor: 'ADEO', description: 'ENKI LEXMAN GU-10 LED RGBW', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['LXEK-2'], model: '9CZA-G1521-Q1A', vendor: 'ADEO', description: 'ENKI LEXMAN E27 14W to 100W LED RGBW', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['LDSENK07'], @@ -325,7 +325,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.battery, fz.ias_siren], toZigbee: [tz.warning], exposes: [e.warning(), e.battery(), e.battery_low(), e.tamper()], - extend: [quirkCheckinInterval(0)], + extend: [m.quirkCheckinInterval(0)], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); if (endpoint.binds.some((b) => b.cluster.name === 'genPollCtrl')) { @@ -338,14 +338,14 @@ const definitions: DefinitionWithExtend[] = [ model: '9CZA-A806ST-Q1Z', vendor: 'ADEO', description: 'ENKI LEXMAN E27 LED white', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['LDSENK02F'], model: 'LDSENK02F', description: '10A/16A EU smart plug', vendor: 'ADEO', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['LDSENK10'], @@ -361,14 +361,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'LDSENK02S', vendor: 'ADEO', description: 'ENKI LEXMAN 16A EU smart plug', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['SIN-4-1-20_LEX'], model: 'SIN-4-1-20_LEX', vendor: 'ADEO', description: 'ENKI LEXMAN 3680W single output relay', - extend: [onOff()], + extend: [m.onOff()], endpoint: (device) => { return {default: 1}; }, @@ -393,7 +393,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SIN-4-1-22_LEX', vendor: 'ADEO', description: 'ENKI LEXMAN Access Control', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['SIN-4-FP-21_EQU'], @@ -434,11 +434,11 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ADEO', description: 'Smart 4 in 1 sensor', extend: [ - battery(), - illuminance(), - temperature(), - humidity(), - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery(), + m.illuminance(), + m.temperature(), + m.humidity(), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), ], }, { @@ -446,7 +446,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-DoorSensor-D0007', vendor: 'ADEO', description: 'ENKI LEXMAN wireless smart door window sensor', - extend: [battery(), iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']})], }, ]; diff --git a/src/devices/adurosmart.ts b/src/devices/adurosmart.ts index 88d27a89f77fb..3b1b2f86fb837 100644 --- a/src/devices/adurosmart.ts +++ b/src/devices/adurosmart.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -41,7 +41,7 @@ const definitions: DefinitionWithExtend[] = [ model: '81809/81813', vendor: 'AduroSmart', description: 'ERIA colors and white shades smart light bulb A19/BR30', - extend: [light({colorTemp: {range: undefined}, color: {applyRedFix: true}})], + extend: [m.light({colorTemp: {range: undefined}, color: {applyRedFix: true}})], endpoint: (device) => { return {default: 2}; }, @@ -51,21 +51,21 @@ const definitions: DefinitionWithExtend[] = [ model: '81809FBA', vendor: 'AduroSmart', description: 'ERIA colors and white shades smart light bulb A19/BR30', - extend: [light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], }, { zigbeeModel: ['AD-E14RGBW3001'], model: '81895', vendor: 'AduroSmart', description: 'ERIA E14 Candle Color', - extend: [light({colorTemp: {range: [153, 500]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: true})], }, { zigbeeModel: ['AD-DimmableLight3001'], model: '81810', vendor: 'AduroSmart', description: 'Zigbee Aduro Eria B22 bulb - warm white', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['Adurolight_NCC'], @@ -85,42 +85,42 @@ const definitions: DefinitionWithExtend[] = [ model: '81849', vendor: 'AduroSmart', description: 'ERIA built-in multi dimmer module 300W', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['BDP3001'], model: '81855', vendor: 'AduroSmart', description: 'ERIA smart plug (dimmer)', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['BPU3'], model: 'BPU3', vendor: 'AduroSmart', description: 'ERIA smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['Extended Color LED Strip V1.0'], model: '81863', vendor: 'AduroSmart', description: 'Eria color LED strip', - extend: [light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], }, { zigbeeModel: ['AD-81812', 'AD-ColorTemperature3001'], model: '81812/81814', vendor: 'AduroSmart', description: 'Eria tunable white A19/BR30 smart bulb', - extend: [light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['ONOFFRELAY'], model: '81898', vendor: 'AduroSmart', description: 'AduroSmart on/off relay', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { fingerprint: [{modelID: 'Smart Siren', manufacturerName: 'AduroSmart Eria'}], diff --git a/src/devices/aeotec.ts b/src/devices/aeotec.ts index b1130bad91535..de87b00f0d734 100644 --- a/src/devices/aeotec.ts +++ b/src/devices/aeotec.ts @@ -1,15 +1,5 @@ import fz from '../converters/fromZigbee'; -import { - commandsLevelCtrl, - commandsOnOff, - commandsWindowCovering, - deviceEndpoints, - deviceTemperature, - electricityMeter, - identify, - onOff, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -28,13 +18,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aeotec', description: 'Pico switch with power meter', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3}, multiEndpointSkip: ['state', 'voltage', 'power', 'current', 'energy']}), - deviceTemperature(), - identify(), - onOff({powerOnBehavior: false}), - electricityMeter(), - commandsOnOff({endpointNames: ['2', '3']}), - commandsLevelCtrl({endpointNames: ['2', '3']}), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3}, multiEndpointSkip: ['state', 'voltage', 'power', 'current', 'energy']}), + m.deviceTemperature(), + m.identify(), + m.onOff({powerOnBehavior: false}), + m.electricityMeter(), + m.commandsOnOff({endpointNames: ['2', '3']}), + m.commandsLevelCtrl({endpointNames: ['2', '3']}), ], }, { @@ -43,13 +33,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aeotec', description: 'Pico switch duo with power meter', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), - deviceTemperature(), - identify(), - onOff({powerOnBehavior: false, endpointNames: ['1', '2']}), - electricityMeter({endpointNames: ['1', '2']}), - commandsOnOff({endpointNames: ['3', '4']}), - commandsLevelCtrl({endpointNames: ['3', '4']}), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.deviceTemperature(), + m.identify(), + m.onOff({powerOnBehavior: false, endpointNames: ['1', '2']}), + m.electricityMeter({endpointNames: ['1', '2']}), + m.commandsOnOff({endpointNames: ['3', '4']}), + m.commandsLevelCtrl({endpointNames: ['3', '4']}), ], }, { @@ -58,13 +48,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aeotec', description: 'Pico shutter', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5}}), - deviceTemperature(), - identify(), - windowCovering({controls: ['lift', 'tilt']}), - commandsWindowCovering({endpointNames: ['3']}), - commandsOnOff({endpointNames: ['4', '5']}), - commandsLevelCtrl({endpointNames: ['4', '5']}), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5}}), + m.deviceTemperature(), + m.identify(), + m.windowCovering({controls: ['lift', 'tilt']}), + m.commandsWindowCovering({endpointNames: ['3']}), + m.commandsOnOff({endpointNames: ['4', '5']}), + m.commandsLevelCtrl({endpointNames: ['4', '5']}), ], }, ]; diff --git a/src/devices/airam.ts b/src/devices/airam.ts index 1a624863b20d6..21da401eb0f20 100644 --- a/src/devices/airam.ts +++ b/src/devices/airam.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -12,7 +12,7 @@ const definitions: DefinitionWithExtend[] = [ model: '4713407', vendor: 'Airam', description: 'LED OP A60 ZB 9W/827 E27', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ZBT-Remote-EU-DIMV1A2'], @@ -63,7 +63,7 @@ const definitions: DefinitionWithExtend[] = [ model: '4713406', vendor: 'Airam', description: 'GU10 spot 4.8W 2700K 385lm', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/ajax_online.ts b/src/devices/ajax_online.ts index 0876099b62c25..a0f5ed0833a2d 100644 --- a/src/devices/ajax_online.ts +++ b/src/devices/ajax_online.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -8,31 +8,31 @@ const definitions: DefinitionWithExtend[] = [ model: 'Aj_Zigbee_Led_Strip', vendor: 'Ajax Online', description: 'LED Strip', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['AJ_ZB30_GU10', 'AJ_ZB120_GU10'], model: 'AJ_ZB_GU10', vendor: 'Ajax Online', description: 'Smart Zigbee pro GU10 spotlight bulb', - extend: [light({colorTemp: {range: [158, 495]}, color: true, effect: false})], + extend: [m.light({colorTemp: {range: [158, 495]}, color: true, effect: false})], }, { zigbeeModel: ['AJ_ZBPROA60', 'AJ_ZBPROA6'], model: 'AJ_ZIGPROA60', vendor: 'Ajax Online', description: 'Smart Zigbee pro 12W A60 bulb', - extend: [light({colorTemp: {range: [158, 495]}, color: true, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [158, 495]}, color: true, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['ZB_A60_RGBCW'], model: 'ZB_A60_RGBCW', vendor: 'Ajax Online', description: 'Smart Zigbee pro 12W A60 RGBCW bulb', - extend: [light({colorTemp: {range: [153, 500]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: true})], }, { - fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_hzy4rjz3'}], + fingerprint: tuya.fingerprint('TS0505B', ['_TZ3210_hzy4rjz3']), model: 'AJ_RGBCCT_CTRL', vendor: 'Ajax Online', description: 'Smart Zigbee LED strip RGB+CCT', @@ -43,7 +43,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-CCT_Filament', vendor: 'Ajax Online', description: 'Zigbee LED filament light dimmable E27, edison ST64, flame 2200K', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, ]; diff --git a/src/devices/akuvox.ts b/src/devices/akuvox.ts index 54af23beaa25c..9fe03dc51b2f2 100644 --- a/src/devices/akuvox.ts +++ b/src/devices/akuvox.ts @@ -1,13 +1,14 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as reporting from '../lib/reporting'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0201', manufacturerName: '_TYZB01_ujfk3xd9'}], + fingerprint: tuya.fingerprint('TS0201', ['_TYZB01_ujfk3xd9']), model: 'M423-9E', vendor: 'Akuvox', description: 'Smart temperature & humidity Sensor', diff --git a/src/devices/alchemy.ts b/src/devices/alchemy.ts index 3e3ff8abafc83..5f083134dc840 100644 --- a/src/devices/alchemy.ts +++ b/src/devices/alchemy.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'AL8TC13W-AP', vendor: 'Alchemy', description: 'Downlight with tuneable white', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['AL8RGB13W-AP'], model: 'AL8RGB13W-AP', vendor: 'Alchemy', description: 'Downlight RGBW', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, ]; diff --git a/src/devices/aldi.ts b/src/devices/aldi.ts index 22efd078cae5d..c360abe92f580 100644 --- a/src/devices/aldi.ts +++ b/src/devices/aldi.ts @@ -1,12 +1,13 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS1001', manufacturerName: '_TZ3000_ztrfrcsu'}], + fingerprint: tuya.fingerprint('TS1001', ['_TZ3000_ztrfrcsu']), model: '141L100RC', vendor: 'Aldi', description: 'MEGOS switch and dimming light remote control', diff --git a/src/devices/alecto.ts b/src/devices/alecto.ts index 993837cea5e75..7c0739a133cd8 100644 --- a/src/devices/alecto.ts +++ b/src/devices/alecto.ts @@ -1,6 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -8,10 +9,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'daqwrsj\u0000', manufacturerName: '_TYST11_8daqwrsj'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_8daqwrsj'}, - ], + fingerprint: [...tuya.fingerprint('daqwrsj\u0000', ['_TYST11_8daqwrsj']), ...tuya.fingerprint('TS0601', ['_TZE200_8daqwrsj'])], model: 'SMART-HEAT10', vendor: 'Alecto', description: 'Radiator valve with thermostat', @@ -39,10 +37,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'tbrwrfv\u0000', manufacturerName: '_TYST11_qtbrwrfv'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_qtbrwrfv'}, - ], + fingerprint: [...tuya.fingerprint('tbrwrfv\u0000', ['_TYST11_qtbrwrfv']), ...tuya.fingerprint('TS0601', ['_TZE200_qtbrwrfv'])], model: 'SMART-SMOKE10', vendor: 'Alecto', description: 'Smoke detector', diff --git a/src/devices/amina.ts b/src/devices/amina.ts index 3c4ee977da1f2..ff480ee24e1c9 100644 --- a/src/devices/amina.ts +++ b/src/devices/amina.ts @@ -2,7 +2,7 @@ import {Zcl} from 'zigbee-herdsman'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {binary, deviceAddCustomCluster, electricityMeter, numeric, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -138,7 +138,7 @@ const definitions: DefinitionWithExtend[] = [ e.list('alarms', ea.STATE_GET, aminaAlarmsEnum).withDescription('List of active alarms'), ], extend: [ - deviceAddCustomCluster('aminaControlCluster', { + m.deviceAddCustomCluster('aminaControlCluster', { ID: aminaControlAttributes.cluster, manufacturerCode: manufacturerOptions.manufacturerCode, attributes: { @@ -157,11 +157,11 @@ const definitions: DefinitionWithExtend[] = [ commandsResponse: {}, }), - onOff({ + m.onOff({ powerOnBehavior: false, }), - numeric({ + m.numeric({ name: 'charge_limit', cluster: 'genLevelCtrl', attribute: 'currentLevel', @@ -174,7 +174,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'ALL', }), - numeric({ + m.numeric({ name: 'total_active_power', cluster: 'haElectricalMeasurement', attribute: 'totalActivePower', @@ -186,7 +186,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'total_active_energy', cluster: 'aminaControlCluster', attribute: 'totalActiveEnergy', @@ -198,7 +198,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'last_session_energy', cluster: 'aminaControlCluster', attribute: 'lastSessionEnergy', @@ -210,7 +210,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', }), - binary({ + m.binary({ name: 'ev_connected', cluster: 'aminaControlCluster', attribute: 'evConnected', @@ -220,7 +220,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE', }), - binary({ + m.binary({ name: 'charging', cluster: 'aminaControlCluster', attribute: 'charging', @@ -230,7 +230,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE', }), - binary({ + m.binary({ name: 'derated', cluster: 'aminaControlCluster', attribute: 'derated', @@ -240,7 +240,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE', }), - binary({ + m.binary({ name: 'alarm_active', cluster: 'aminaControlCluster', attribute: 'alarmActive', @@ -250,13 +250,13 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE', }), - electricityMeter({ + m.electricityMeter({ cluster: 'electrical', acFrequency: true, threePhase: true, }), - binary({ + m.binary({ name: 'single_phase', cluster: 'aminaControlCluster', attribute: 'singlePhase', @@ -266,7 +266,7 @@ const definitions: DefinitionWithExtend[] = [ entityCategory: 'config', }), - binary({ + m.binary({ name: 'enable_offline', cluster: 'aminaControlCluster', attribute: 'enableOffline', @@ -276,7 +276,7 @@ const definitions: DefinitionWithExtend[] = [ entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'time_to_offline', cluster: 'aminaControlCluster', attribute: 'timeToOffline', @@ -288,7 +288,7 @@ const definitions: DefinitionWithExtend[] = [ entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'offline_current', cluster: 'aminaControlCluster', attribute: 'offlineCurrent', @@ -300,7 +300,7 @@ const definitions: DefinitionWithExtend[] = [ entityCategory: 'config', }), - binary({ + m.binary({ name: 'offline_single_phase', cluster: 'aminaControlCluster', attribute: 'offlineSinglePhase', diff --git a/src/devices/anchor.ts b/src/devices/anchor.ts index 2d40b9b67c1a5..afe011fa4615e 100644 --- a/src/devices/anchor.ts +++ b/src/devices/anchor.ts @@ -1,4 +1,4 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '67200BL', description: 'Vetaar smart plug', vendor: 'Anchor', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/atsmart.ts b/src/devices/atsmart.ts index 4f956ff0d3a87..825fac503228e 100644 --- a/src/devices/atsmart.ts +++ b/src/devices/atsmart.ts @@ -1,4 +1,4 @@ -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'Z6', vendor: 'Atsmart', description: '3 gang smart wall switch (no neutral wire)', - extend: [deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), onOff({endpointNames: ['left', 'center', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), m.onOff({endpointNames: ['left', 'center', 'right']})], }, ]; diff --git a/src/devices/aubess.ts b/src/devices/aubess.ts index 3f8fa1f07b470..0ea3d71c5e831 100644 --- a/src/devices/aubess.ts +++ b/src/devices/aubess.ts @@ -1,3 +1,4 @@ +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; import * as zosung from '../lib/zosung'; @@ -7,7 +8,7 @@ const ez = zosung.presetsZosung; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS1201', manufacturerName: '_TZ3290_acv1iuslxi3shaaj'}], + fingerprint: tuya.fingerprint('TS1201', ['_TZ3290_acv1iuslxi3shaaj']), model: 'ZXZIR-02', vendor: 'Aubess', description: 'Universal smart IR remote control', diff --git a/src/devices/aurora_lighting.ts b/src/devices/aurora_lighting.ts index c1fdf6df6435f..1f6a79d4695bc 100644 --- a/src/devices/aurora_lighting.ts +++ b/src/devices/aurora_lighting.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {identify, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {Configure, DefinitionWithExtend, Fz, OnEvent, Tz, Zh} from '../lib/types'; import * as utils from '../lib/utils'; @@ -93,70 +93,70 @@ const definitions: DefinitionWithExtend[] = [ model: 'AU-A1GSZ9CX', vendor: 'Aurora Lighting', description: 'AOne GLS lamp 9w tunable dimmable 2200-5000K', - extend: [light({colorTemp: {range: [200, 454]}})], + extend: [m.light({colorTemp: {range: [200, 454]}})], }, { zigbeeModel: ['RGBCXStrip50AU'], model: 'AU-A1ZBSCRGBCX', vendor: 'Aurora Lighting', description: 'RGBW LED strip controller', - extend: [light({colorTemp: {range: [166, 400]}, color: true})], + extend: [m.light({colorTemp: {range: [166, 400]}, color: true})], }, { zigbeeModel: ['TWGU10Bulb50AU'], model: 'AU-A1GUZBCX5', vendor: 'Aurora Lighting', description: 'AOne 5.4W smart tuneable GU10 lamp', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['TWMPROZXBulb50AU'], model: 'AU-A1ZBMPRO1ZX', vendor: 'Aurora Lighting', description: 'AOne MPROZX fixed IP65 fire rated smart tuneable LED downlight', - extend: [light({colorTemp: {range: [200, 455]}, powerOnBehavior: false})], + extend: [m.light({colorTemp: {range: [200, 455]}, powerOnBehavior: false})], }, { zigbeeModel: ['FWG125Bulb50AU'], model: 'AU-A1VG125Z5E/19', vendor: 'Aurora Lighting', description: 'AOne 4W smart dimmable G125 lamp 1900K', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['FWBulb51AU'], model: 'AU-A1GSZ9B/27', vendor: 'Aurora Lighting', description: 'AOne 9W smart GLS B22', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['FWGU10Bulb50AU', 'FWGU10Bulb01UK'], model: 'AU-A1GUZB5/30', vendor: 'Aurora Lighting', description: 'AOne 4.8W smart dimmable GU10 lamp 3000K', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['FWA60Bulb50AU'], model: 'AU-A1VGSZ5E/19', vendor: 'Aurora Lighting', description: 'AOne 4W smart dimmable Vintage GLS lamp 1900K', - extend: [light({effect: false})], + extend: [m.light({effect: false})], }, { zigbeeModel: ['RGBGU10Bulb50AU', 'RGBGU10Bulb50AU2'], model: 'AU-A1GUZBRGBW', vendor: 'Aurora Lighting', description: 'AOne 5.6w smart RGBW tuneable GU10 lamp', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['RGBBulb01UK', 'RGBBulb02UK', 'RGBBulb51AU'], model: 'AU-A1GSZ9RGBW_HV-GSCXZB269K', vendor: 'Aurora Lighting', description: 'AOne 9.5W smart RGBW GLS E27/B22', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['Remote50AU'], @@ -176,14 +176,9 @@ const definitions: DefinitionWithExtend[] = [ model: 'AU-A1ZBPIRS', vendor: 'Aurora Lighting', description: 'AOne PIR sensor', - fromZigbee: [fz.ias_occupancy_alarm_1, fz.illuminance], - toZigbee: [], - configure: async (device, coordinatorEndpoint) => { - const endpoint = device.getEndpoint(39); - await reporting.bind(endpoint, coordinatorEndpoint, ['msIlluminanceMeasurement']); - await reporting.illuminance(endpoint); - }, - exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.illuminance()], + fromZigbee: [fz.ias_occupancy_alarm_1], + exposes: [e.occupancy(), e.battery_low(), e.tamper()], + extend: [m.illuminance()], }, { zigbeeModel: ['SingleSocket50AU'], @@ -215,7 +210,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'AOne 250W smart rotary dimmer module', exposes: [e.binary('backlight_led', ea.STATE_SET, 'ON', 'OFF').withDescription('Enable or disable the blue backlight LED')], toZigbee: [tzLocal.aOneBacklight], - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['DoubleSocket50AU'], @@ -305,7 +300,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'AU-A1ZB110', vendor: 'Aurora Lighting', description: 'AOne 1-10V in-line dimmer', - extend: [identify(), light({powerOnBehavior: false})], + extend: [m.identify(), m.light({powerOnBehavior: false})], }, ]; diff --git a/src/devices/avatto.ts b/src/devices/avatto.ts index 7c170d1fd612a..42ead3ca729f6 100644 --- a/src/devices/avatto.ts +++ b/src/devices/avatto.ts @@ -6,9 +6,9 @@ const e = exposes.presets; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_s139roas'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_s139roas']), model: 'ZWSH16', - vendor: 'Avatto', + vendor: 'AVATTO', description: 'Smart Temperature and Humidity Detector', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], diff --git a/src/devices/awox.ts b/src/devices/awox.ts index 93affcb86165f..c6e8e1a9d0011 100644 --- a/src/devices/awox.ts +++ b/src/devices/awox.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -11,14 +11,14 @@ const definitions: DefinitionWithExtend[] = [ model: '12226', vendor: 'AwoX', description: 'Dimmable filament lamp', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['TLSR82xx'], model: '33951/33948', vendor: 'AwoX', description: 'LED white', - extend: [light()], + extend: [m.light()], whiteLabel: [{vendor: 'EGLO', model: '12229'}], }, { @@ -126,7 +126,7 @@ const definitions: DefinitionWithExtend[] = [ model: '33943/33944/33946', vendor: 'AwoX', description: 'LED RGB & brightness', - extend: [light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], }, { fingerprint: [ @@ -173,7 +173,7 @@ const definitions: DefinitionWithExtend[] = [ model: '33957', vendor: 'AwoX', description: 'LED light with color temperature', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], whiteLabel: [{vendor: 'EGLO', model: '12239'}], }, { @@ -192,7 +192,7 @@ const definitions: DefinitionWithExtend[] = [ model: '33955', vendor: 'AwoX', description: 'LED light with color temperature', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], whiteLabel: [ {vendor: 'EGLO', model: '900316'}, {vendor: 'EGLO', model: '900317'}, diff --git a/src/devices/bankamp.ts b/src/devices/bankamp.ts index e26757499e71f..0be27afb0ea52 100644 --- a/src/devices/bankamp.ts +++ b/src/devices/bankamp.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '2189/1-xx', vendor: 'Bankamp', description: 'Ceiling light (e.g. Grazia, Grand)', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/bega.ts b/src/devices/bega.ts index eac97af5651cf..8f21e22d08a1b 100644 --- a/src/devices/bega.ts +++ b/src/devices/bega.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -14,14 +14,14 @@ const definitions: DefinitionWithExtend[] = [ model: '70049', vendor: 'Bega', description: 'Zigbee control module DALI', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['BEGA 13557 bulb E27 RGBW 805lm'], model: '13557', vendor: 'Bega', description: 'LED lamp with adjustable LED color temperature (Tunable White - RGBW) for use in luminaires with E27 lamp base', - extend: [light({colorTemp: {range: [153, 556]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 556]}, color: true})], }, ]; diff --git a/src/devices/belkin.ts b/src/devices/belkin.ts index 7a3221154470e..9cc06dfec9291 100644 --- a/src/devices/belkin.ts +++ b/src/devices/belkin.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'F7C033', vendor: 'Belkin', description: 'WeMo smart LED bulb', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/bitron.ts b/src/devices/bitron.ts index e1ad3b7abfb14..81b50bd4825cd 100644 --- a/src/devices/bitron.ts +++ b/src/devices/bitron.ts @@ -3,7 +3,7 @@ import {Zcl} from 'zigbee-herdsman'; import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValueAny, Tz} from '../lib/types'; @@ -73,14 +73,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'AV2010/16', vendor: 'SMaBiT (Bitron Video)', description: 'Wall-mount relay with dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['AV2010/18', '902010/18'], model: 'AV2010/18', vendor: 'SMaBiT (Bitron Video)', description: 'Wall-mount relay', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['AV2010/21A', '902010/21A'], @@ -194,14 +194,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'AV2010/26', vendor: 'SMaBiT (Bitron Video)', description: 'Wireless socket with dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['AV2010/28', '902010/28'], model: 'AV2010/28', vendor: 'SMaBiT (Bitron Video)', description: 'Wireless socket', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['AV2010/29', '902010/29'], @@ -279,7 +279,6 @@ const definitions: DefinitionWithExtend[] = [ dynExposes.push(hysteresisExposes); dynExposes.push(e.battery().withAccess(ea.STATE_GET)); dynExposes.push(e.battery_low()); - dynExposes.push(e.linkquality()); return dynExposes; }, diff --git a/src/devices/blitzwolf.ts b/src/devices/blitzwolf.ts index 9d15dbe62a455..66d621d33ebf9 100644 --- a/src/devices/blitzwolf.ts +++ b/src/devices/blitzwolf.ts @@ -1,7 +1,8 @@ import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -17,19 +18,19 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.occupancy()], }, { - fingerprint: [{modelID: 'TS0003', manufacturerName: '_TYZB01_aneiicmq'}], + fingerprint: tuya.fingerprint('TS0003', ['_TYZB01_aneiicmq']), model: 'BW-SS7_1gang', vendor: 'BlitzWolf', description: 'Zigbee 3.0 smart light switch module 1 gang', - extend: [onOff()], + extend: [m.onOff()], toZigbee: [tz.TYZB01_on_off], }, { - fingerprint: [{modelID: 'TS0003', manufacturerName: '_TYZB01_digziiav'}], + fingerprint: tuya.fingerprint('TS0003', ['_TYZB01_digziiav']), model: 'BW-SS7_2gang', vendor: 'BlitzWolf', description: 'Zigbee 3.0 smart light switch module 2 gang', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], toZigbee: [tz.TYZB01_on_off], }, ]; diff --git a/src/devices/bosch.ts b/src/devices/bosch.ts index fc3f743f9da4c..f0af5c31e6493 100644 --- a/src/devices/bosch.ts +++ b/src/devices/bosch.ts @@ -5,22 +5,7 @@ import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import { - battery, - binary, - bindCluster, - deviceAddCustomCluster, - deviceEndpoints, - electricityMeter, - enumLookup, - humidity, - iasZoneAlarm, - identify, - light, - numeric, - onOff, - quirkCheckinInterval, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend, Expose, Fz, KeyValue, ModernExtend, Tz} from '../lib/types'; @@ -93,7 +78,7 @@ Example: 30ff00000102010001`; const boschExtend = { hvacThermostatCluster: () => - deviceAddCustomCluster('hvacThermostat', { + m.deviceAddCustomCluster('hvacThermostat', { ID: Zcl.Clusters.hvacThermostat.ID, attributes: { operatingMode: { @@ -136,7 +121,7 @@ const boschExtend = { commandsResponse: {}, }), hvacUserInterfaceCfgCluster: () => - deviceAddCustomCluster('hvacUserInterfaceCfg', { + m.deviceAddCustomCluster('hvacUserInterfaceCfg', { ID: Zcl.Clusters.hvacUserInterfaceCfg.ID, attributes: { displayOrientation: { @@ -164,7 +149,7 @@ const boschExtend = { commandsResponse: {}, }), operatingMode: () => - enumLookup({ + m.enumLookup({ name: 'operating_mode', cluster: 'hvacThermostat', attribute: 'operatingMode', @@ -174,7 +159,7 @@ const boschExtend = { zigbeeCommandOptions: manufacturerOptions, }), windowDetection: () => - binary({ + m.binary({ name: 'window_detection', cluster: 'hvacThermostat', attribute: 'windowDetection', @@ -184,7 +169,7 @@ const boschExtend = { zigbeeCommandOptions: manufacturerOptions, }), boostHeating: () => - binary({ + m.binary({ name: 'boost_heating', cluster: 'hvacThermostat', attribute: 'boostHeating', @@ -195,7 +180,7 @@ const boschExtend = { zigbeeCommandOptions: manufacturerOptions, }), childLock: () => - binary({ + m.binary({ name: 'child_lock', cluster: 'hvacUserInterfaceCfg', attribute: 'keypadLockout', @@ -204,7 +189,7 @@ const boschExtend = { valueOff: ['UNLOCK', 0x00], }), displayOntime: () => - numeric({ + m.numeric({ name: 'display_ontime', cluster: 'hvacUserInterfaceCfg', attribute: 'displayOntime', @@ -215,7 +200,7 @@ const boschExtend = { zigbeeCommandOptions: manufacturerOptions, }), displayBrightness: () => - numeric({ + m.numeric({ name: 'display_brightness', cluster: 'hvacUserInterfaceCfg', attribute: 'displayBrightness', @@ -1183,7 +1168,7 @@ const definitions: DefinitionWithExtend[] = [ e.binary('ac_status', ea.STATE, true, false).withDescription('Is the device plugged in'), ], extend: [ - deviceAddCustomCluster('ssIasZone', { + m.deviceAddCustomCluster('ssIasZone', { ID: Zcl.Clusters.ssIasZone.ID, attributes: {}, commands: { @@ -1194,7 +1179,7 @@ const definitions: DefinitionWithExtend[] = [ }, commandsResponse: {}, }), - deviceAddCustomCluster('ssIasWd', { + m.deviceAddCustomCluster('ssIasWd', { ID: Zcl.Clusters.ssIasWd.ID, attributes: {}, commands: { @@ -1205,7 +1190,7 @@ const definitions: DefinitionWithExtend[] = [ }, commandsResponse: {}, }), - quirkCheckinInterval(0), + m.quirkCheckinInterval(0), ], }, { @@ -1214,7 +1199,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Bosch', description: 'Smart water alarm', extend: [ - deviceAddCustomCluster('boschSpecific', { + m.deviceAddCustomCluster('boschSpecific', { ID: 0xfcac, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: { @@ -1226,15 +1211,15 @@ const definitions: DefinitionWithExtend[] = [ commands: {}, commandsResponse: {}, }), - iasZoneAlarm({ + m.iasZoneAlarm({ zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'tamper'], }), - battery({ + m.battery({ percentage: true, lowStatus: true, }), - binary({ + m.binary({ name: 'alarm_on_motion', cluster: 'boschSpecific', attribute: 'alarmOnMotion', @@ -1244,7 +1229,7 @@ const definitions: DefinitionWithExtend[] = [ zigbeeCommandOptions: manufacturerOptions, entityCategory: 'config', }), - bindCluster({ + m.bindCluster({ cluster: 'genPollCtrl', clusterType: 'input', }), @@ -1262,7 +1247,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Bosch', description: 'Smoke alarm II', extend: [ - deviceAddCustomCluster('ssIasZone', { + m.deviceAddCustomCluster('ssIasZone', { ID: Zcl.Clusters.ssIasZone.ID, attributes: {}, commands: { @@ -1274,11 +1259,11 @@ const definitions: DefinitionWithExtend[] = [ commandsResponse: {}, }), boschExtend.smokeAlarm(), - battery({ + m.battery({ percentage: true, lowStatus: false, }), - enumLookup({ + m.enumLookup({ name: 'sensitivity', cluster: 'ssIasZone', attribute: 'currentZoneSensitivityLevel', @@ -1291,7 +1276,7 @@ const definitions: DefinitionWithExtend[] = [ entityCategory: 'config', }), boschExtend.broadcastAlarm(), - bindCluster({ + m.bindCluster({ cluster: 'genPollCtrl', clusterType: 'input', }), @@ -1321,17 +1306,17 @@ const definitions: DefinitionWithExtend[] = [ model: 'RADON TriTech ZB', vendor: 'Bosch', description: 'Wireless motion detector', - fromZigbee: [fz.temperature, fz.battery, fz.ias_occupancy_alarm_1, fz.illuminance], + fromZigbee: [fz.temperature, fz.battery, fz.ias_occupancy_alarm_1], toZigbee: [], meta: {battery: {voltageToPercentage: {min: 2500, max: 3000}}}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg', 'msIlluminanceMeasurement']); + await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']); await reporting.temperature(endpoint); await reporting.batteryVoltage(endpoint); - await reporting.illuminance(endpoint); }, - exposes: [e.temperature(), e.battery(), e.occupancy(), e.battery_low(), e.tamper(), e.illuminance()], + exposes: [e.temperature(), e.battery(), e.occupancy(), e.battery_low(), e.tamper()], + extend: [m.illuminance()], }, { zigbeeModel: ['ISW-ZPR1-WP13'], @@ -1397,14 +1382,14 @@ const definitions: DefinitionWithExtend[] = [ extend: [ boschExtend.hvacThermostatCluster(), boschExtend.hvacUserInterfaceCfgCluster(), - battery({ + m.battery({ percentage: true, lowStatus: false, }), boschExtend.operatingMode(), boschExtend.windowDetection(), boschExtend.boostHeating(), - numeric({ + m.numeric({ name: 'remote_temperature', cluster: 'hvacThermostat', attribute: 'remoteTemperature', @@ -1416,7 +1401,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, zigbeeCommandOptions: manufacturerOptions, }), - enumLookup({ + m.enumLookup({ name: 'setpoint_change_source', cluster: 'hvacThermostat', attribute: 'setpointChangeSource', @@ -1428,7 +1413,7 @@ const definitions: DefinitionWithExtend[] = [ boschExtend.childLock(), boschExtend.displayOntime(), boschExtend.displayBrightness(), - enumLookup({ + m.enumLookup({ name: 'display_orientation', cluster: 'hvacUserInterfaceCfg', attribute: 'displayOrientation', @@ -1436,7 +1421,7 @@ const definitions: DefinitionWithExtend[] = [ lookup: {normal: 0x00, flipped: 0x01}, zigbeeCommandOptions: manufacturerOptions, }), - enumLookup({ + m.enumLookup({ name: 'displayed_temperature', cluster: 'hvacUserInterfaceCfg', attribute: 'displayedTemperature', @@ -1444,7 +1429,7 @@ const definitions: DefinitionWithExtend[] = [ lookup: {target: 0x00, measured: 0x01}, zigbeeCommandOptions: manufacturerOptions, }), - enumLookup({ + m.enumLookup({ name: 'valve_adapt_status', cluster: 'hvacThermostat', attribute: 'valveAdaptStatus', @@ -1463,7 +1448,7 @@ const definitions: DefinitionWithExtend[] = [ boschExtend.valveAdaptProcess(), boschExtend.heatingDemand(), boschExtend.ignoreDst(), - bindCluster({ + m.bindCluster({ cluster: 'genPollCtrl', clusterType: 'input', }), @@ -1536,7 +1521,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ boschExtend.hvacThermostatCluster(), boschExtend.hvacUserInterfaceCfgCluster(), - battery({ + m.battery({ voltageToPercentage: {min: 4400, max: 6400}, percentage: true, voltage: true, @@ -1544,14 +1529,14 @@ const definitions: DefinitionWithExtend[] = [ voltageReporting: true, percentageReporting: false, }), - humidity(), + m.humidity(), boschExtend.operatingMode(), boschExtend.windowDetection(), boschExtend.boostHeating(), boschExtend.childLock(), boschExtend.displayOntime(), boschExtend.displayBrightness(), - bindCluster({ + m.bindCluster({ cluster: 'genPollCtrl', clusterType: 'input', }), @@ -1611,7 +1596,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ boschExtend.hvacThermostatCluster(), boschExtend.hvacUserInterfaceCfgCluster(), - humidity(), + m.humidity(), boschExtend.operatingMode(), boschExtend.windowDetection(), boschExtend.boostHeating(), @@ -1649,7 +1634,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Bosch', description: 'Twinguard', extend: [ - deviceAddCustomCluster('twinguardSmokeDetector', { + m.deviceAddCustomCluster('twinguardSmokeDetector', { ID: 0xe000, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: { @@ -1663,7 +1648,7 @@ const definitions: DefinitionWithExtend[] = [ }, commandsResponse: {}, }), - deviceAddCustomCluster('twinguardMeasurements', { + m.deviceAddCustomCluster('twinguardMeasurements', { ID: 0xe002, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: { @@ -1684,7 +1669,7 @@ const definitions: DefinitionWithExtend[] = [ commands: {}, commandsResponse: {}, }), - deviceAddCustomCluster('twinguardOptions', { + m.deviceAddCustomCluster('twinguardOptions', { ID: 0xe004, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: { @@ -1694,7 +1679,7 @@ const definitions: DefinitionWithExtend[] = [ commands: {}, commandsResponse: {}, }), - deviceAddCustomCluster('twinguardSetup', { + m.deviceAddCustomCluster('twinguardSetup', { ID: 0xe006, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: { @@ -1710,7 +1695,7 @@ const definitions: DefinitionWithExtend[] = [ }, commandsResponse: {}, }), - deviceAddCustomCluster('twinguardAlarm', { + m.deviceAddCustomCluster('twinguardAlarm', { ID: 0xe007, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: { @@ -1764,7 +1749,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'BSP-FZ2', vendor: 'Bosch', description: 'Plug compact EU', - extend: [onOff(), electricityMeter({voltage: false, current: false})], + extend: [m.onOff(), m.electricityMeter({voltage: false, current: false})], ota: true, whiteLabel: [ {vendor: 'Bosch', model: 'BSP-EZ2', description: 'Plug compact FR', fingerprint: [{modelID: 'RBSH-SP-ZB-FR'}]}, @@ -1778,11 +1763,11 @@ const definitions: DefinitionWithExtend[] = [ description: 'Door/window contact II', extend: [ boschExtend.doorWindowContact(false), - battery({ + m.battery({ percentage: true, lowStatus: true, }), - bindCluster({ + m.bindCluster({ cluster: 'genPollCtrl', clusterType: 'input', }), @@ -1800,11 +1785,11 @@ const definitions: DefinitionWithExtend[] = [ description: 'Door/window contact II plus', extend: [ boschExtend.doorWindowContact(true), - battery({ + m.battery({ percentage: true, lowStatus: true, }), - bindCluster({ + m.bindCluster({ cluster: 'genPollCtrl', clusterType: 'input', }), @@ -1820,14 +1805,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'BMCT-DZ', vendor: 'Bosch', description: 'Phase-cut dimmer', - extend: [identify(), light({configureReporting: true, effect: false})], + extend: [m.identify(), m.light({configureReporting: true, effect: false})], }, { zigbeeModel: ['RBSH-MMR-ZB-EU'], model: 'BMCT-RZ', vendor: 'Bosch', description: 'Relay, potential free', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['RBSH-MMS-ZB-EU'], @@ -1835,8 +1820,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Bosch', description: 'Light/shutter control unit II', extend: [ - deviceEndpoints({endpoints: {left: 2, right: 3}}), - deviceAddCustomCluster('boschSpecific', { + m.deviceEndpoints({endpoints: {left: 2, right: 3}}), + m.deviceAddCustomCluster('boschSpecific', { ID: 0xfca0, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: { @@ -1896,7 +1881,6 @@ const definitions: DefinitionWithExtend[] = [ }; const commonExposes = [ e.enum('switch_type', ea.ALL, Object.keys(stateSwitchType)).withDescription('Module controlled by a rocker switch or a button'), - e.linkquality(), ]; const lightExposes = [ e.switch().withEndpoint('left'), @@ -1950,7 +1934,7 @@ const definitions: DefinitionWithExtend[] = [ return [...commonExposes, ...coverExposes]; } } - return [e.enum('device_mode', ea.ALL, Object.keys(stateDeviceMode)).withDescription('Device mode'), e.linkquality()]; + return [e.enum('device_mode', ea.ALL, Object.keys(stateDeviceMode)).withDescription('Device mode')]; }, }, { @@ -2019,7 +2003,7 @@ const definitions: DefinitionWithExtend[] = [ ]), ], extend: [ - deviceAddCustomCluster('boschSpecific', { + m.deviceAddCustomCluster('boschSpecific', { ID: 0xfca1, manufacturerCode: Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH, attributes: {}, diff --git a/src/devices/bouffalo_lab.ts b/src/devices/bouffalo_lab.ts index ae2ba6cba80f0..bdab9a0bbb1f9 100644 --- a/src/devices/bouffalo_lab.ts +++ b/src/devices/bouffalo_lab.ts @@ -1,4 +1,4 @@ -import {forcePowerSource, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RMC002', vendor: 'Bouffalolab', description: 'US plug smart socket', - extend: [onOff(), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff(), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, ]; diff --git a/src/devices/bseed.ts b/src/devices/bseed.ts index e4eac38b77260..903403e50a803 100644 --- a/src/devices/bseed.ts +++ b/src/devices/bseed.ts @@ -1,5 +1,6 @@ import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -7,11 +8,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_yenbr4om'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_bdblidq3'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_bdblidq3'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_yenbr4om', '_TZE204_bdblidq3', '_TZE200_bdblidq3']), model: 'BSEED_TS0601_cover', vendor: 'BSEED', description: 'Zigbee curtain switch', diff --git a/src/devices/bticino.ts b/src/devices/bticino.ts index 3ae41f6cead0e..48f343594d498 100644 --- a/src/devices/bticino.ts +++ b/src/devices/bticino.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import {eLegrand, fzLegrand, tzLegrand} from '../lib/legrand'; -import {electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -40,14 +40,14 @@ const definitions: DefinitionWithExtend[] = [ eLegrand.ledInDark(), eLegrand.ledIfOn(), ], - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['Bticino Din power consumption module '], model: 'F20T60A', description: 'DIN power consumption module (same as Legrand 412015)', vendor: 'BTicino', - extend: [onOff(), electricityMeter({cluster: 'electrical'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'electrical'})], fromZigbee: [fz.identify, fzLegrand.cluster_fc01, fz.ignore_basic_report, fz.ignore_genOta], toZigbee: [tz.legrand_device_mode, tzLegrand.identify], exposes: [ diff --git a/src/devices/busch_jaeger.ts b/src/devices/busch_jaeger.ts index f2b698a76aad9..aad2bedc8b536 100644 --- a/src/devices/busch_jaeger.ts +++ b/src/devices/busch_jaeger.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; import * as utils from '../lib/utils'; @@ -15,7 +15,7 @@ const definitions: DefinitionWithExtend[] = [ model: '6717-84', vendor: 'Busch-Jaeger', description: 'Adaptor plug', - extend: [onOff()], + extend: [m.onOff()], }, { // Busch-Jaeger 6735, 6736 and 6737 have been tested with the 6710 U (Power Adapter), @@ -72,7 +72,6 @@ const definitions: DefinitionWithExtend[] = [ 'brightness_stop_row_4', ]), ); - expose.push(e.linkquality()); return expose; }, diff --git a/src/devices/calex.ts b/src/devices/calex.ts index e134d3dfce222..33955a8d77955 100644 --- a/src/devices/calex.ts +++ b/src/devices/calex.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -11,14 +11,14 @@ const definitions: DefinitionWithExtend[] = [ model: '421786', vendor: 'Calex', description: 'LED A60 Zigbee GLS-lamp', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['EC-Z3.0-RGBW'], model: '421792', vendor: 'Calex', description: 'LED A60 Zigbee RGB lamp', - extend: [light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['Smart Wall Switch '], // Yes, it has a space at the end :( diff --git a/src/devices/candeo.ts b/src/devices/candeo.ts index cf6a254c921a9..40dc47547beef 100644 --- a/src/devices/candeo.ts +++ b/src/devices/candeo.ts @@ -1,4 +1,4 @@ -import {deviceEndpoints, electricityMeter, identify, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'C205', vendor: 'Candeo', description: 'Switch module', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['HK-DIM-A', 'Candeo Zigbee Dimmer', 'HK_DIM_A'], @@ -18,21 +18,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'C202.1', vendor: 'Candeo', description: 'Zigbee LED smart dimmer switch', - extend: [light({configureReporting: true, powerOnBehavior: false})], + extend: [m.light({configureReporting: true, powerOnBehavior: false})], }, { fingerprint: [{modelID: 'Dimmer-Switch-ZB3.0', manufacturerID: 4098}], model: 'C210', vendor: 'Candeo', description: 'Zigbee dimming smart plug', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { - zigbeeModel: ['C204', 'C-ZB-DM204'], + zigbeeModel: ['C204'], model: 'C204', vendor: 'Candeo', description: 'Zigbee micro smart dimmer', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], + }, + { + zigbeeModel: ['C-ZB-DM204'], + model: 'C-ZB-DM204', + vendor: 'Candeo', + description: 'Zigbee micro smart dimmer', + extend: [m.light({configureReporting: true}), m.electricityMeter()], }, { zigbeeModel: ['C202'], @@ -44,7 +51,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart rotary dimmer', extend: [ - light({ + m.light({ configureReporting: true, levelConfig: {disabledFeatures: ['on_transition_time', 'off_transition_time', 'on_off_transition_time', 'execute_if_off']}, powerOnBehavior: true, @@ -57,7 +64,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart dimmer module', extend: [ - light({ + m.light({ configureReporting: true, levelConfig: {disabledFeatures: ['on_transition_time', 'off_transition_time', 'on_off_transition_time', 'execute_if_off']}, powerOnBehavior: true, @@ -70,7 +77,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart LED controller (CCT mode)', extend: [ - light({ + m.light({ colorTemp: {range: [158, 500]}, configureReporting: true, levelConfig: { @@ -78,7 +85,7 @@ const definitions: DefinitionWithExtend[] = [ }, powerOnBehavior: true, }), - identify(), + m.identify(), ], }, { @@ -87,14 +94,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart LED controller (dimmer mode)', extend: [ - light({ + m.light({ configureReporting: true, levelConfig: { disabledFeatures: ['on_transition_time', 'off_transition_time', 'on_off_transition_time', 'on_level', 'execute_if_off'], }, powerOnBehavior: true, }), - identify(), + m.identify(), ], }, { @@ -103,7 +110,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart LED controller (RGB mode)', extend: [ - light({ + m.light({ color: {modes: ['xy', 'hs'], enhancedHue: true}, configureReporting: true, levelConfig: { @@ -111,7 +118,7 @@ const definitions: DefinitionWithExtend[] = [ }, powerOnBehavior: true, }), - identify(), + m.identify(), ], }, { @@ -120,7 +127,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart LED controller (RGBCCT mode)', extend: [ - light({ + m.light({ colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}, configureReporting: true, @@ -129,7 +136,7 @@ const definitions: DefinitionWithExtend[] = [ }, powerOnBehavior: true, }), - identify(), + m.identify(), ], }, { @@ -138,7 +145,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart LED controller (RGBW mode)', extend: [ - light({ + m.light({ colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}, configureReporting: true, @@ -147,7 +154,7 @@ const definitions: DefinitionWithExtend[] = [ }, powerOnBehavior: true, }), - identify(), + m.identify(), ], }, { @@ -156,12 +163,12 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Candeo', description: 'Smart 2 gang switch module', extend: [ - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {l1: 1, l2: 2}, multiEndpointSkip: ['power', 'current', 'voltage', 'energy'], }), - onOff({endpointNames: ['l1', 'l2']}), - electricityMeter(), + m.onOff({endpointNames: ['l1', 'l2']}), + m.electricityMeter(), ], meta: {}, }, @@ -170,14 +177,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'C-RFZB-SM1', vendor: 'Candeo', description: 'Zigbee & RF Switch Module', - extend: [onOff({powerOnBehavior: true})], + extend: [m.onOff({powerOnBehavior: true})], }, { fingerprint: [{modelID: 'C203', manufacturerName: 'Candeo'}], model: 'C203', vendor: 'Candeo', description: 'Zigbee micro smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/casaia.ts b/src/devices/casaia.ts index 5182e0bd6bff1..b0921f4602889 100644 --- a/src/devices/casaia.ts +++ b/src/devices/casaia.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -13,14 +13,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'CSLC601-D-E', vendor: 'CASAIA', description: 'Dry contact relay switch module in 220v AC for gas boiler', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['CSAC451-WTC-E'], model: 'CSAC451-WTC-E', vendor: 'CASAIA', description: 'Dry contact relay switch module in 6-24v AC', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['CTHS317ET'], diff --git a/src/devices/centralite.ts b/src/devices/centralite.ts index 31d3ae0cd643e..05f5b61163143 100644 --- a/src/devices/centralite.ts +++ b/src/devices/centralite.ts @@ -4,7 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend, Fz} from '../lib/types'; @@ -102,7 +102,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Centralite', description: '3-Series smart dimming outlet', fromZigbee: [fz.restorable_brightness, fz.on_off, fz.electrical_measurement], - toZigbee: [tz.light_onoff_restorable_brightness], + toZigbee: [tz.light_onoff_restorable_brightness, tz.ignore_transition], exposes: [e.light_brightness(), e.power(), e.voltage(), e.current()], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); @@ -219,7 +219,7 @@ const definitions: DefinitionWithExtend[] = [ model: '3420-G', vendor: 'Centralite', description: '3-Series night light repeater', - extend: [light()], + extend: [m.light()], }, { fingerprint: [ @@ -319,7 +319,7 @@ const definitions: DefinitionWithExtend[] = [ model: '4200-C', vendor: 'Centralite', description: 'Smart outlet', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['3310-G'], diff --git a/src/devices/chacon.ts b/src/devices/chacon.ts index a8bc63ac51248..f26b441499778 100644 --- a/src/devices/chacon.ts +++ b/src/devices/chacon.ts @@ -1,4 +1,4 @@ -import {commandsWindowCovering, windowCovering} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -8,8 +8,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Chacon', description: 'Roller shutter module', extend: [ - windowCovering({controls: ['lift'], coverInverted: true, coverMode: true}), - commandsWindowCovering({commands: ['open', 'close', 'stop']}), + m.windowCovering({controls: ['lift'], coverInverted: true, coverMode: true}), + m.commandsWindowCovering({commands: ['open', 'close', 'stop']}), ], }, ]; diff --git a/src/devices/cleode.ts b/src/devices/cleode.ts index 67119ed5d8e2c..1c5a6d419a8e8 100644 --- a/src/devices/cleode.ts +++ b/src/devices/cleode.ts @@ -1,4 +1,4 @@ -import {electricityMeter, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZPLUG_Boost', vendor: 'CLEODE', description: 'ZPlug boost', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, ]; diff --git a/src/devices/cleverio.ts b/src/devices/cleverio.ts index 02b074c0f55ee..a0080184c9791 100644 --- a/src/devices/cleverio.ts +++ b/src/devices/cleverio.ts @@ -2,6 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as reporting from '../lib/reporting'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -9,7 +10,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0219', manufacturerName: '_TZ3000_vdfwjopk'}], + fingerprint: tuya.fingerprint('TS0219', ['_TZ3000_vdfwjopk']), model: 'SA100', vendor: 'Cleverio', description: 'Smart siren', @@ -28,7 +29,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'SM0201', manufacturerName: '_TYZB01_lzrhtcxu'}], + fingerprint: tuya.fingerprint('SM0201', ['_TYZB01_lzrhtcxu']), model: 'SS300', vendor: 'Cleverio', description: 'Temperature/humdity sensor', diff --git a/src/devices/climax.ts b/src/devices/climax.ts index 9623449b45d21..876cff1e1d94a 100644 --- a/src/devices/climax.ts +++ b/src/devices/climax.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {forcePowerSource, identify, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -14,7 +14,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'PSS-23ZBS', vendor: 'Climax', description: 'Power plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['SD8SC_00.00.03.12TC'], @@ -138,7 +138,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'PRL-1ZBS-12/24V', vendor: 'Climax', description: 'Zigbee 12-24V relay controller', - extend: [identify(), onOff(), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.identify(), m.onOff(), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, ]; diff --git a/src/devices/commercial_electric.ts b/src/devices/commercial_electric.ts index de3e0d8dd746b..48efbe8f03e25 100644 --- a/src/devices/commercial_electric.ts +++ b/src/devices/commercial_electric.ts @@ -1,4 +1,4 @@ -import {forcePowerSource, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '53170161', vendor: 'Commercial Electric', description: 'Matte White Recessed Retrofit Smart Led Downlight - 4 Inch', - extend: [light({colorTemp: {range: undefined}}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.light({colorTemp: {range: undefined}}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, ]; diff --git a/src/devices/cree.ts b/src/devices/cree.ts index cacab41806ed7..b4131e5134150 100644 --- a/src/devices/cree.ts +++ b/src/devices/cree.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'B00TN589ZG', vendor: 'CREE', description: 'Connected bulb', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/ctm.ts b/src/devices/ctm.ts index ac23c19df1fbf..61a8ebb7a672c 100644 --- a/src/devices/ctm.ts +++ b/src/devices/ctm.ts @@ -4,7 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {battery, identify, light, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -1029,7 +1029,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'mKomfy_Tak', vendor: 'CTM Lyng', description: 'Temperature sensor', - extend: [battery(), temperature()], + extend: [m.battery(), m.temperature()], }, { zigbeeModel: ['mKomfy'], @@ -1255,17 +1255,15 @@ const definitions: DefinitionWithExtend[] = [ model: 'MBD-S', vendor: 'CTM Lyng', description: 'MBD-S, motion detector with 16A relay', - fromZigbee: [fz.illuminance, fz.occupancy, fzLocal.ctm_mbd_device_enabled, fzLocal.ctm_relay_state], + fromZigbee: [fz.occupancy, fzLocal.ctm_mbd_device_enabled, fzLocal.ctm_relay_state], toZigbee: [tzLocal.ctm_mbd_device_enabled, tzLocal.ctm_relay_state], meta: {disableDefaultResponse: true}, ota: true, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'msIlluminanceMeasurement', 'msOccupancySensing']); + await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'msOccupancySensing']); await endpoint.read('genOnOff', ['onOff']); await reporting.onOff(endpoint); - await endpoint.read('msIlluminanceMeasurement', ['measuredValue']); - await reporting.illuminance(endpoint); await endpoint.read('msOccupancySensing', ['occupancy']); await reporting.occupancy(endpoint); // Relay State @@ -1283,37 +1281,20 @@ const definitions: DefinitionWithExtend[] = [ {manufacturerCode: Zcl.ManufacturerCode.DATEK_WIRELESS_AS}, ); }, - exposes: [ - e.switch(), - e.illuminance(), - e.occupancy(), - e.binary('device_enabled', ea.ALL, 'ON', 'OFF').withDescription('Turn the device on or off'), - ], + exposes: [e.switch(), e.occupancy(), e.binary('device_enabled', ea.ALL, 'ON', 'OFF').withDescription('Turn the device on or off')], + extend: [m.illuminance()], }, { zigbeeModel: ['MBD Dim'], model: 'CTM_MBD_Dim', vendor: 'CTM Lyng', description: 'MBD Dim, motion detector with dimmer', - fromZigbee: [ - fz.illuminance, - fz.occupancy, - fzLocal.ctm_mbd_device_enabled, - fzLocal.ctm_relay_state, - fz.brightness, - fz.lighting_ballast_configuration, - ], + fromZigbee: [fz.occupancy, fzLocal.ctm_mbd_device_enabled, fzLocal.ctm_relay_state, fz.brightness, fz.lighting_ballast_configuration], toZigbee: [tzLocal.ctm_mbd_device_enabled, tzLocal.ctm_relay_state, tzLocal.ctm_mbd_brightness, tz.ballast_config], meta: {disableDefaultResponse: true}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - await reporting.bind(endpoint, coordinatorEndpoint, [ - 'genOnOff', - 'genLevelCtrl', - 'lightingBallastCfg', - 'msIlluminanceMeasurement', - 'msOccupancySensing', - ]); + await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg', 'msOccupancySensing']); await endpoint.read('genOnOff', ['onOff']); await reporting.onOff(endpoint); await endpoint.read('genLevelCtrl', ['currentLevel']); @@ -1343,8 +1324,6 @@ const definitions: DefinitionWithExtend[] = [ reportableChange: null, }, ]); - await endpoint.read('msIlluminanceMeasurement', ['measuredValue']); - await reporting.illuminance(endpoint); await endpoint.read('msOccupancySensing', ['occupancy']); await reporting.occupancy(endpoint); // Relay State @@ -1364,7 +1343,6 @@ const definitions: DefinitionWithExtend[] = [ }, exposes: [ e.light_brightness(), - e.illuminance(), e.occupancy(), e.binary('device_enabled', ea.ALL, 'ON', 'OFF').withDescription('Turn the device on or off'), e.numeric('ballast_minimum_level', ea.ALL).withValueMin(10).withValueMax(97).withDescription('Specifies the minimum brightness value'), @@ -1375,13 +1353,14 @@ const definitions: DefinitionWithExtend[] = [ .withValueMax(97) .withDescription('Specifies the initialisation light level. Can not be set lower than "ballast_minimum_level"'), ], + extend: [m.illuminance()], }, { fingerprint: [{modelID: 'DIMMER', manufacturerName: 'NorLum Dim OP'}], model: '4503145', vendor: 'CTM Lyng', description: 'NorLum Dim OP, 2-250W rotary dimmer', - extend: [identify(), light({configureReporting: true, powerOnBehavior: true, effect: false})], + extend: [m.identify(), m.light({configureReporting: true, powerOnBehavior: true, effect: false})], ota: true, meta: {}, }, diff --git a/src/devices/custom_devices_diy.ts b/src/devices/custom_devices_diy.ts index 3e87584a0f9d5..b10ce5c07756e 100644 --- a/src/devices/custom_devices_diy.ts +++ b/src/devices/custom_devices_diy.ts @@ -4,21 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import { - battery, - binary, - commandsOnOff, - deviceEndpoints, - enumLookup, - forcePowerSource, - humidity, - light, - linkQuality, - numeric, - onOff, - quirkAddEndpointCluster, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Expose, Fz, KeyValue, KeyValueAny, Tz, Zh} from '../lib/types'; import {getFromLookup, getKey, isEndpoint, postfixWithEndpointName} from '../lib/utils'; @@ -267,7 +253,7 @@ const definitions: DefinitionWithExtend[] = [ 'Resets and launches the bootloader for flashing. If USB, ensure the device is already connected to the machine where you intend to flash it before triggering this.', ), ], - extend: [linkQuality({reporting: true})], + extend: [m.linkQuality({reporting: true})], // prevent timeout with tz.factory_reset (reboots adapter into bootloader, hence disconnected) // since this is the only tz, it's not a problem to disable this globally meta: {disableDefaultResponse: true}, @@ -541,7 +527,7 @@ const definitions: DefinitionWithExtend[] = [ if (exposeDeviceOptions['expose_battery']) { expose.push(e.battery()); } - expose.push(e.linkquality()); + return expose; }, meta: {multiEndpoint: true, tuyaThermostatPreset: legacy.fz /* for subclassed custom converters */}, @@ -621,14 +607,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'DNCKATSD001', vendor: 'Custom devices (DiY)', description: 'DNCKAT single key wired wall dimmable light switch', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['DNCKAT_S001'], model: 'DNCKATSW001', vendor: 'Custom devices (DiY)', description: 'DNCKAT single key wired wall light switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['DNCKAT_S002'], @@ -636,7 +622,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Custom devices (DiY)', description: 'DNCKAT double key wired wall light switch', fromZigbee: [fz.DNCKAT_S00X_buttons], - extend: [deviceEndpoints({endpoints: {left: 1, right: 2}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, right: 2}}), m.onOff({endpointNames: ['left', 'right']})], exposes: [e.action(['release_left', 'hold_left', 'release_right', 'hold_right'])], }, { @@ -645,7 +631,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Custom devices (DiY)', description: 'DNCKAT triple key wired wall light switch', fromZigbee: [fz.DNCKAT_S00X_buttons], - extend: [deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), onOff({endpointNames: ['left', 'center', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), m.onOff({endpointNames: ['left', 'center', 'right']})], exposes: [e.action(['release_left', 'hold_left', 'release_right', 'hold_right', 'release_center', 'hold_center'])], }, { @@ -655,8 +641,8 @@ const definitions: DefinitionWithExtend[] = [ description: 'DNCKAT quadruple key wired wall light switch', fromZigbee: [fz.DNCKAT_S00X_buttons], extend: [ - deviceEndpoints({endpoints: {bottom_left: 1, bottom_right: 2, top_left: 3, top_right: 4}}), - onOff({endpointNames: ['bottom_left', 'bottom_right', 'top_left', 'top_right']}), + m.deviceEndpoints({endpoints: {bottom_left: 1, bottom_right: 2, top_left: 3, top_right: 4}}), + m.onOff({endpointNames: ['bottom_left', 'bottom_right', 'top_left', 'top_right']}), ], exposes: [ e.action([ @@ -694,32 +680,27 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZeeFlora', vendor: 'Custom devices (DiY)', description: 'Flower sensor with rechargeable battery', - fromZigbee: [fz.temperature, fz.illuminance, fz.soil_moisture, fz.battery], + fromZigbee: [fz.temperature, fz.soil_moisture, fz.battery], toZigbee: [], meta: {multiEndpoint: true}, configure: async (device, coordinatorEndpoint) => { const firstEndpoint = device.getEndpoint(1); - await reporting.bind(firstEndpoint, coordinatorEndpoint, [ - 'genPowerCfg', - 'msTemperatureMeasurement', - 'msIlluminanceMeasurement', - 'msSoilMoisture', - ]); + await reporting.bind(firstEndpoint, coordinatorEndpoint, ['genPowerCfg', 'msTemperatureMeasurement', 'msSoilMoisture']); const overrides = {min: 0, max: 3600, change: 0}; await reporting.batteryVoltage(firstEndpoint, overrides); await reporting.batteryPercentageRemaining(firstEndpoint, overrides); await reporting.temperature(firstEndpoint, overrides); - await reporting.illuminance(firstEndpoint, overrides); await reporting.soil_moisture(firstEndpoint, overrides); }, - exposes: [e.soil_moisture(), e.battery(), e.illuminance(), e.temperature()], + exposes: [e.soil_moisture(), e.battery(), e.temperature()], + extend: [m.illuminance()], }, { zigbeeModel: ['UT-01'], model: 'EFR32MG21.Router.1', vendor: 'Custom devices (DiY)', description: 'EFR32MG21 Zigbee bridge router', - extend: [forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['UT-02'], @@ -735,24 +716,18 @@ const definitions: DefinitionWithExtend[] = [ model: 'b-parasite', vendor: 'Custom devices (DiY)', description: 'b-parasite open source soil moisture sensor', - fromZigbee: [fz.temperature, fz.humidity, fz.battery, fz.soil_moisture, fz.illuminance], + fromZigbee: [fz.temperature, fz.humidity, fz.battery, fz.soil_moisture], toZigbee: [], - exposes: [e.temperature(), e.humidity(), e.battery(), e.soil_moisture(), e.illuminance()], + exposes: [e.temperature(), e.humidity(), e.battery(), e.soil_moisture()], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(10); - await reporting.bind(endpoint, coordinatorEndpoint, [ - 'genPowerCfg', - 'msTemperatureMeasurement', - 'msRelativeHumidity', - 'msSoilMoisture', - 'msIlluminanceMeasurement', - ]); + await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'msSoilMoisture']); await reporting.batteryPercentageRemaining(endpoint); await reporting.temperature(endpoint); await reporting.humidity(endpoint); await reporting.soil_moisture(endpoint); - await reporting.illuminance(endpoint); }, + extend: [m.illuminance()], }, { zigbeeModel: ['MULTI-ZIG-SW'], @@ -786,22 +761,22 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Custom devices (DiY)', description: 'Xiaomi temperature & humidity sensor with custom firmware', extend: [ - quirkAddEndpointCluster({ + m.quirkAddEndpointCluster({ endpointID: 1, outputClusters: [], inputClusters: ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'hvacUserInterfaceCfg'], }), - battery(), - temperature({reporting: {min: 10, max: 300, change: 10}}), - humidity({reporting: {min: 10, max: 300, change: 50}}), - enumLookup({ + m.battery(), + m.temperature({reporting: {min: 10, max: 300, change: 10}}), + m.humidity({reporting: {min: 10, max: 300, change: 50}}), + m.enumLookup({ name: 'temperature_display_mode', lookup: {celsius: 0, fahrenheit: 1}, cluster: 'hvacUserInterfaceCfg', attribute: 'tempDisplayMode', description: 'The units of the temperature displayed on the device screen.', }), - binary({ + m.binary({ name: 'show_smiley', valueOn: ['SHOW', 1], valueOff: ['HIDE', 0], @@ -809,7 +784,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0010, type: Zcl.DataType.BOOLEAN}, description: 'Whether to show a smiley on the device screen.', }), - binary({ + m.binary({ name: 'enable_display', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -817,7 +792,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0011, type: Zcl.DataType.BOOLEAN}, description: 'Whether to turn display on/off.', }), - numeric({ + m.numeric({ name: 'temperature_calibration', unit: '°C', cluster: 'msTemperatureMeasurement', @@ -828,7 +803,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'The temperature calibration offset is set in 0.01° steps.', }), - numeric({ + m.numeric({ name: 'humidity_calibration', unit: '%', cluster: 'msRelativeHumidity', @@ -839,7 +814,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'The humidity calibration offset is set in 0.01 % steps.', }), - numeric({ + m.numeric({ name: 'comfort_temperature_min', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -849,7 +824,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'Comfort parameters/Temperature minimum, in 0.01°C steps.', }), - numeric({ + m.numeric({ name: 'comfort_temperature_max', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -859,7 +834,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'Comfort parameters/Temperature maximum, in 0.01°C steps.', }), - numeric({ + m.numeric({ name: 'comfort_humidity_min', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -869,7 +844,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'Comfort parameters/Humidity minimum, in 0.01% steps.', }), - numeric({ + m.numeric({ name: 'comfort_humidity_max', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -903,24 +878,24 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Custom devices (DiY)', description: 'Xiaomi temperature & humidity sensor with custom firmware', extend: [ - quirkAddEndpointCluster({ + m.quirkAddEndpointCluster({ endpointID: 1, outputClusters: ['hvacUserInterfaceCfg'], inputClusters: ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'hvacUserInterfaceCfg'], }), - battery(), - temperature({reporting: {min: 10, max: 300, change: 10}}), - humidity({reporting: {min: 10, max: 300, change: 50}}), + m.battery(), + m.temperature({reporting: {min: 10, max: 300, change: 10}}), + m.humidity({reporting: {min: 10, max: 300, change: 50}}), // Temperature display and show smile. // For details, see: https://github.com/pvvx/ZigbeeTLc/issues/28#issue-2033984519 - enumLookup({ + m.enumLookup({ name: 'temperature_display_mode', lookup: {celsius: 0, fahrenheit: 1}, cluster: 'hvacUserInterfaceCfg', attribute: 'tempDisplayMode', description: 'The units of the temperature displayed on the device screen.', }), - binary({ + m.binary({ name: 'show_smile', valueOn: ['HIDE', 1], valueOff: ['SHOW', 0], @@ -930,7 +905,7 @@ const definitions: DefinitionWithExtend[] = [ }), // Setting offsets for temperature and humidity. // For details, see: https://github.com/pvvx/ZigbeeTLc/issues/30 - numeric({ + m.numeric({ name: 'temperature_calibration', unit: 'C', cluster: 'hvacUserInterfaceCfg', @@ -941,7 +916,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 10, description: 'The temperature calibration, in 0.1° steps. Requires v0.1.1.6 or newer.', }), - numeric({ + m.numeric({ name: 'humidity_calibration', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -954,7 +929,7 @@ const definitions: DefinitionWithExtend[] = [ }), // Comfort parameters. // For details, see: https://github.com/pvvx/ZigbeeTLc/issues/28#issuecomment-1855763432 - numeric({ + m.numeric({ name: 'comfort_temperature_min', unit: 'C', cluster: 'hvacUserInterfaceCfg', @@ -963,7 +938,7 @@ const definitions: DefinitionWithExtend[] = [ valueMax: 127, description: 'Comfort parameters/Temperature minimum, in 1° steps. Requires v0.1.1.7 or newer.', }), - numeric({ + m.numeric({ name: 'comfort_temperature_max', unit: 'C', cluster: 'hvacUserInterfaceCfg', @@ -972,7 +947,7 @@ const definitions: DefinitionWithExtend[] = [ valueMax: 127, description: 'Comfort parameters/Temperature maximum, in 1° steps. Requires v0.1.1.7 or newer.', }), - numeric({ + m.numeric({ name: 'comfort_humidity_min', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -981,7 +956,7 @@ const definitions: DefinitionWithExtend[] = [ valueMax: 100, description: 'Comfort parameters/Humidity minimum, in 1% steps. Requires v0.1.1.7 or newer.', }), - numeric({ + m.numeric({ name: 'comfort_humidity_max', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -999,22 +974,22 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Xiaomi', description: 'E-Ink temperature & humidity sensor with custom firmware (pvxx/ZigbeeTLc)', extend: [ - quirkAddEndpointCluster({ + m.quirkAddEndpointCluster({ endpointID: 1, outputClusters: [], inputClusters: ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'hvacUserInterfaceCfg'], }), - battery({percentage: true}), - temperature({reporting: {min: 10, max: 300, change: 10}, access: 'STATE'}), - humidity({reporting: {min: 2, max: 300, change: 50}, access: 'STATE'}), - enumLookup({ + m.battery({percentage: true}), + m.temperature({reporting: {min: 10, max: 300, change: 10}, access: 'STATE'}), + m.humidity({reporting: {min: 2, max: 300, change: 50}, access: 'STATE'}), + m.enumLookup({ name: 'temperature_display_mode', lookup: {celsius: 0, fahrenheit: 1}, cluster: 'hvacUserInterfaceCfg', attribute: {ID: 0x0000, type: Zcl.DataType.ENUM8}, description: 'The units of the temperature displayed on the device screen.', }), - binary({ + m.binary({ name: 'smiley', valueOn: ['SHOW', 0], valueOff: ['HIDE', 1], @@ -1022,7 +997,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0002, type: Zcl.DataType.ENUM8}, description: 'Whether to show a smiley on the device screen.', }), - numeric({ + m.numeric({ name: 'temperature_calibration', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -1033,7 +1008,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 10, description: 'The temperature calibration, in 0.01° steps.', }), - numeric({ + m.numeric({ name: 'humidity_calibration', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -1044,7 +1019,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 10, description: 'The humidity offset is set in 0.01 % steps.', }), - numeric({ + m.numeric({ name: 'comfort_temperature_min', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -1054,7 +1029,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'Comfort parameters/Temperature minimum, in 1°C steps.', }), - numeric({ + m.numeric({ name: 'comfort_temperature_max', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -1064,7 +1039,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'Comfort parameters/Temperature maximum, in 1°C steps.', }), - numeric({ + m.numeric({ name: 'comfort_humidity_min', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -1074,7 +1049,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'Comfort parameters/Humidity minimum, in 1% steps.', }), - numeric({ + m.numeric({ name: 'comfort_humidity_max', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -1084,7 +1059,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 100, description: 'Comfort parameters/Humidity maximum, in 1% steps.', }), - numeric({ + m.numeric({ name: 'measurement_interval', unit: 's', cluster: 'hvacUserInterfaceCfg', @@ -1175,14 +1150,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Alab', description: 'Four channel relay board with four inputs', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, in1: 5, in2: 6, in3: 7, in4: 8}}), - onOff({ + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, in1: 5, in2: 6, in3: 7, in4: 8}}), + m.onOff({ powerOnBehavior: false, configureReporting: false, endpointNames: ['l1', 'l2', 'l3', 'l4'], }), - commandsOnOff({endpointNames: ['l1', 'l2', 'l3', 'l4']}), - numeric({ + m.commandsOnOff({endpointNames: ['l1', 'l2', 'l3', 'l4']}), + m.numeric({ name: 'input_state', valueMin: 0, valueMax: 1, diff --git a/src/devices/cy_lighting.ts b/src/devices/cy_lighting.ts index c69e2300ffa06..6ac4f4c19f4d4 100644 --- a/src/devices/cy_lighting.ts +++ b/src/devices/cy_lighting.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'DM A60F', vendor: 'CY-LIGHTING', description: '6W smart dimmable E27 lamp 2700K', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/danfoss.ts b/src/devices/danfoss.ts index c69bd19961d6d..6342b2a1857ca 100644 --- a/src/devices/danfoss.ts +++ b/src/devices/danfoss.ts @@ -76,7 +76,6 @@ const definitions: DefinitionWithExtend[] = [ exposes: (device, options) => { const maxSetpoint = ['TRV001', 'TRV003'].includes(device?.modelID) ? 32 : 35; return [ - e.linkquality(), e.battery(), e.keypad_lockout(), e.programming_operation_mode(), diff --git a/src/devices/databyte.ts b/src/devices/databyte.ts index 2080236d8d382..4762586341288 100644 --- a/src/devices/databyte.ts +++ b/src/devices/databyte.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend, Fz} from '../lib/types'; const ea = exposes.access; @@ -37,7 +37,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ED2004-012', vendor: 'databyte.ch', description: 'Panda 1 - wall switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['DTB-ED2011-014'], @@ -48,7 +48,6 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [], exposes: [ e.battery(), - e.linkquality(), e.binary('key_1', ea.STATE, 'ON', 'OFF'), e.binary('key_2', ea.STATE, 'ON', 'OFF'), e.binary('key_3', ea.STATE, 'ON', 'OFF'), diff --git a/src/devices/datek.ts b/src/devices/datek.ts index d5c8fd5433484..ffb4a1a1fe747 100644 --- a/src/devices/datek.ts +++ b/src/devices/datek.ts @@ -5,7 +5,7 @@ import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import {repInterval} from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {electricityMeter, onOff, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -41,7 +41,19 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Datek', description: 'Datek Eva AMS HAN power-meter sensor', fromZigbee: [fz.hw_version], - extend: [onOff(), electricityMeter({threePhase: true, fzMetering: fz.metering_datek, producedEnergy: true}), temperature()], + extend: [ + m.electricityMeter({ + cluster: 'metering', + fzMetering: fz.metering_datek, + producedEnergy: true, + }), + m.electricityMeter({ + cluster: 'electrical', + threePhase: true, + power: false, + }), + m.temperature(), + ], ota: true, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); @@ -62,7 +74,6 @@ const definitions: DefinitionWithExtend[] = [ fz.battery, fz.occupancy, fz.occupancy_timeout, - fz.illuminance, fz.temperature, fz.ias_enroll, fz.ias_occupancy_alarm_1, @@ -73,11 +84,10 @@ const definitions: DefinitionWithExtend[] = [ configure: async (device, coordinatorEndpoint) => { const options = {manufacturerCode: Zcl.ManufacturerCode.DATEK_WIRELESS_AS}; const endpoint = device.getEndpoint(1); - const binds = ['msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing', 'ssIasZone']; + const binds = ['msTemperatureMeasurement', 'msOccupancySensing', 'ssIasZone']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.occupancy(endpoint); await reporting.temperature(endpoint); - await reporting.illuminance(endpoint); const payload = [ { attribute: {ID: 0x4000, type: 0x10}, @@ -93,10 +103,10 @@ const definitions: DefinitionWithExtend[] = [ e.temperature(), e.occupancy(), e.battery_low(), - e.illuminance(), e.binary('led_on_motion', ea.ALL, true, false).withDescription('Enable/disable LED on motion'), e.numeric('occupancy_timeout', ea.ALL).withUnit('s').withValueMin(0).withValueMax(65535), ], + extend: [m.illuminance()], }, { zigbeeModel: ['ID Lock 150', 'ID Lock 202'], diff --git a/src/devices/dawon_dns.ts b/src/devices/dawon_dns.ts index d7de6068a823b..e6c21c5e50b39 100644 --- a/src/devices/dawon_dns.ts +++ b/src/devices/dawon_dns.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, forcePowerSource, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, Tz} from '../lib/types'; @@ -110,14 +110,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'PM-S140-ZB', vendor: 'Dawon DNS', description: 'IOT smart switch 1 gang without neutral wire', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['PM-S240-ZB'], model: 'PM-S240-ZB', vendor: 'Dawon DNS', description: 'IOT smart switch 2 gang without neutral wire', - extend: [deviceEndpoints({endpoints: {top: 1, bottom: 2}}), onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], + extend: [m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), m.onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], }, { zigbeeModel: ['PM-S340-ZB'], @@ -125,8 +125,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Dawon DNS', description: 'IOT smart switch 3 gang without neutral wire', extend: [ - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), - onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), ], }, { @@ -134,14 +134,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'PM-S140R-ZB', vendor: 'Dawon DNS', description: 'IOT smart switch 1 gang router without neutral wire', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['PM-S240R-ZB'], model: 'PM-S240R-ZB', vendor: 'Dawon DNS', description: 'IOT smart switch 2 gang without neutral wire', - extend: [deviceEndpoints({endpoints: {top: 1, bottom: 2}}), onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], + extend: [m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), m.onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], }, { zigbeeModel: ['PM-S340R-ZB'], @@ -149,8 +149,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Dawon DNS', description: 'IOT smart switch 3 gang without neutral wire', extend: [ - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), - onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), ], }, { @@ -158,7 +158,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'PM-S150-ZB', vendor: 'Dawon DNS', description: 'IOT smart switch 1 gang router without neutral wire', - extend: [onOff({powerOnBehavior: false}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff({powerOnBehavior: false}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['PM-S250-ZB'], @@ -166,9 +166,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Dawon DNS', description: 'IOT smart switch 2 gang without neutral wire', extend: [ - deviceEndpoints({endpoints: {top: 1, bottom: 2}}), - onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false}), - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), + m.onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), ], }, { @@ -177,9 +177,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Dawon DNS', description: 'IOT smart switch 3 gang without neutral wire', extend: [ - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), - onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), ], }, { diff --git a/src/devices/develco.ts b/src/devices/develco.ts index 3eccc0b7565e4..90d58fe608626 100644 --- a/src/devices/develco.ts +++ b/src/devices/develco.ts @@ -6,7 +6,7 @@ import * as constants from '../lib/constants'; import {develcoModernExtend} from '../lib/develco'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import {battery, electricityMeter, humidity, iasZoneAlarm, illuminance, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend, Fz, KeyValue, Tz} from '../lib/types'; @@ -228,8 +228,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.deviceTemperature(), - electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), - onOff(), + m.electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), + m.onOff(), ], endpoint: (device) => { return {default: 2}; @@ -245,8 +245,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.deviceTemperature(), - electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), - onOff(), + m.electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), + m.onOff(), ], endpoint: (device) => { return {default: 2}; @@ -262,8 +262,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.deviceTemperature(), - electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), - onOff(), + m.electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), + m.onOff(), ], endpoint: (device) => { return {default: 2}; @@ -304,8 +304,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.deviceTemperature(), - electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), - onOff(), + m.electricityMeter({acFrequency: true, fzMetering: develco.fz.metering, fzElectricalMeasurement: develco.fz.electrical_measurement}), + m.onOff(), ], endpoint: (device) => { return {default: 2}; @@ -384,7 +384,7 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), // TODO: ep 38 - battery({ + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -461,7 +461,7 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), // TODO: ep 38 - battery({ + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -516,7 +516,7 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), // TODO: ep 38 - battery({ + m.battery({ percentage: true, voltage: true, lowStatus: false, @@ -540,7 +540,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), - battery({ + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -565,7 +565,7 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), - battery({ + m.battery({ voltageToPercentage: '3V_2100', percentage: true, voltage: true, @@ -590,7 +590,7 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), - battery({ + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -629,7 +629,6 @@ const definitions: DefinitionWithExtend[] = [ e.enum('led_control', ea.ALL, ['off', 'fault_only', 'motion_only', 'both']).withDescription('Control LED indicator usage.'), ); } - dynExposes.push(e.linkquality()); return dynExposes; }, ota: true, @@ -640,8 +639,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), // TODO: ep 38 - illuminance(), // TODO: ep 39 - battery({ + m.illuminance(), // TODO: ep 39 + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -670,7 +669,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low']}), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low']}), ], }, { @@ -689,7 +688,6 @@ const definitions: DefinitionWithExtend[] = [ e.enum('led_control', ea.ALL, ['off', 'fault_only', 'motion_only', 'both']).withDescription('Control LED indicator usage.'), ); } - dynExposes.push(e.linkquality()); return dynExposes; }, ota: true, @@ -700,8 +698,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), - illuminance({reporting: {min: 60, max: 3600, change: 500}}), - battery({ + m.illuminance({reporting: {min: 60, max: 3600, change: 500}}), + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -709,7 +707,7 @@ const definitions: DefinitionWithExtend[] = [ voltageReporting: true, percentageReporting: false, }), - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1']}), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1']}), ], configure: async (device, coordinatorEndpoint) => { if (device && device.softwareBuildID && Number(device.softwareBuildID.split('.')[0]) >= 2) { @@ -733,8 +731,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), - humidity(), - battery({ + m.humidity(), + m.battery({ voltageToPercentage: {min: 2500, max: 3200}, percentage: true, voltage: true, @@ -817,7 +815,7 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), // TODO: ep 38 - battery({ + m.battery({ voltageToPercentage: {min: 2800, max: 3000}, percentage: true, voltage: true, @@ -843,8 +841,8 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.voc(), develcoModernExtend.airQuality(), develcoModernExtend.temperature(), - humidity(), - battery({ + m.humidity(), + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -866,7 +864,7 @@ const definitions: DefinitionWithExtend[] = [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.temperature(), - battery({ + m.battery({ voltageToPercentage: {min: 2500, max: 3000}, percentage: true, voltage: true, @@ -923,7 +921,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), - battery({ + m.battery({ voltageToPercentage: {min: 3000, max: 4200}, percentage: true, voltage: true, @@ -1015,7 +1013,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), - battery({ + m.battery({ voltageToPercentage: {min: 2200, max: 3000}, percentage: true, voltage: true, diff --git a/src/devices/diyruz.ts b/src/devices/diyruz.ts index 9469547e16c33..1088659631880 100644 --- a/src/devices/diyruz.ts +++ b/src/devices/diyruz.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -16,8 +16,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'DIYRuZ', description: 'DiY 4 Relays + 4 switches + 1 buzzer', extend: [ - deviceEndpoints({endpoints: {bottom_left: 1, bottom_right: 2, top_left: 3, top_right: 4, center: 5}}), - onOff({endpointNames: ['bottom_left', 'bottom_right', 'top_left', 'top_right', 'center']}), + m.deviceEndpoints({endpoints: {bottom_left: 1, bottom_right: 2, top_left: 3, top_right: 4, center: 5}}), + m.onOff({endpointNames: ['bottom_left', 'bottom_right', 'top_left', 'top_right', 'center']}), ], }, { @@ -239,8 +239,8 @@ const definitions: DefinitionWithExtend[] = [ description: 'DiY 8 Relays + 8 switches', fromZigbee: [fz.ptvo_multistate_action, fz.ignore_basic_report], extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5, l6: 6, l7: 7, l8: 8}}), - onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'l7', 'l8']}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5, l6: 6, l7: 7, l8: 8}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'l7', 'l8']}), ], }, { @@ -257,7 +257,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'DIYRuZ_Flower', vendor: 'DIYRuZ', description: 'Flower sensor', - fromZigbee: [fz.temperature, fz.humidity, fz.illuminance, fz.soil_moisture, fz.pressure, fz.battery], + fromZigbee: [fz.temperature, fz.humidity, fz.soil_moisture, fz.pressure, fz.battery], toZigbee: [], meta: {multiEndpoint: true, multiEndpointSkip: ['humidity']}, endpoint: (device) => { @@ -271,7 +271,6 @@ const definitions: DefinitionWithExtend[] = [ 'msTemperatureMeasurement', 'msRelativeHumidity', 'msPressureMeasurement', - 'msIlluminanceMeasurement', 'msSoilMoisture', ]); await reporting.bind(secondEndpoint, coordinatorEndpoint, ['msTemperatureMeasurement']); @@ -281,7 +280,6 @@ const definitions: DefinitionWithExtend[] = [ await reporting.temperature(firstEndpoint, overrides); await reporting.humidity(firstEndpoint, overrides); await reporting.pressureExtended(firstEndpoint, overrides); - await reporting.illuminance(firstEndpoint, overrides); await reporting.soil_moisture(firstEndpoint, overrides); await reporting.temperature(secondEndpoint, overrides); await firstEndpoint.read('msPressureMeasurement', ['scale']); @@ -289,12 +287,12 @@ const definitions: DefinitionWithExtend[] = [ exposes: [ e.soil_moisture(), e.battery(), - e.illuminance(), e.humidity(), e.pressure(), e.temperature().withEndpoint('ds'), e.temperature().withEndpoint('bme'), ], + extend: [m.illuminance()], }, { zigbeeModel: ['DIYRuZ_AirSense'], diff --git a/src/devices/dnake.ts b/src/devices/dnake.ts index 828ff0d7852d9..ab904b65f5ba0 100644 --- a/src/devices/dnake.ts +++ b/src/devices/dnake.ts @@ -1,4 +1,4 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'CS-Z-CZ-2402', vendor: 'DNAKE', description: 'Smart socket', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/dowsing_reynolds.ts b/src/devices/dowsing_reynolds.ts index 1ed265c8822a6..5740b7c43cf6c 100644 --- a/src/devices/dowsing_reynolds.ts +++ b/src/devices/dowsing_reynolds.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'DR3000', vendor: 'Dowsing & Reynolds', description: 'Antique brass double dimmer switch', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/dresden_elektronik.ts b/src/devices/dresden_elektronik.ts index 0b0f22ae6a7c7..0a4f3cfddd556 100644 --- a/src/devices/dresden_elektronik.ts +++ b/src/devices/dresden_elektronik.ts @@ -1,4 +1,4 @@ -import {battery, deviceEndpoints, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -9,8 +9,8 @@ const definitions: DefinitionWithExtend[] = [ description: 'ZigBee Light Link wireless electronic ballast', ota: true, extend: [ - deviceEndpoints({endpoints: {rgb: 10, white: 11}}), - light({colorTemp: {range: undefined}, color: true, endpointNames: ['rgb', 'white']}), + m.deviceEndpoints({endpoints: {rgb: 10, white: 11}}), + m.light({colorTemp: {range: undefined}, color: true, endpointNames: ['rgb', 'white']}), ], }, { @@ -18,14 +18,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'XVV-Mega23M12', vendor: 'Dresden Elektronik', description: 'ZigBee Light Link wireless electronic ballast color temperature', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['Kobold'], model: 'BN-600110', vendor: 'Dresden Elektronik', description: 'Zigbee 3.0 dimm actuator', - extend: [light()], + extend: [m.light()], ota: true, }, { @@ -34,14 +34,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Phoscon', description: 'Battery powered smart LED light', ota: true, - extend: [light({colorTemp: {range: [153, 370]}, color: true}), battery()], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true}), m.battery()], }, { zigbeeModel: ['FLS-A lp (1-10V)'], model: 'BN-600078', vendor: 'Dresden Elektronik', description: 'Zigbee controller for 1-10V/PWM', - extend: [deviceEndpoints({endpoints: {l1: 11, l2: 12, l3: 13, l4: 14}}), light({endpointNames: ['l1', 'l2', 'l3', 'l4']})], + extend: [m.deviceEndpoints({endpoints: {l1: 11, l2: 12, l3: 13, l4: 14}}), m.light({endpointNames: ['l1', 'l2', 'l3', 'l4']})], meta: {disableDefaultResponse: true}, }, ]; diff --git a/src/devices/easyiot.ts b/src/devices/easyiot.ts index 776f0afe37720..883069559fa79 100644 --- a/src/devices/easyiot.ts +++ b/src/devices/easyiot.ts @@ -2,7 +2,7 @@ import * as iconv from 'iconv-lite'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import {deviceEndpoints, electricityMeter, onOff, windowCovering} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValueAny, Tz} from '../lib/types'; @@ -233,14 +233,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-PM01', vendor: 'easyiot', description: 'Smart circuit breaker with Metering', - extend: [onOff({powerOnBehavior: false}), electricityMeter()], + extend: [m.onOff({powerOnBehavior: false}), m.electricityMeter()], }, { zigbeeModel: ['ZB-WC01'], model: 'ZB-WC01', vendor: 'easyiot', description: 'Curtain motor', - extend: [windowCovering({controls: ['lift'], configureReporting: false})], + extend: [m.windowCovering({controls: ['lift'], configureReporting: false})], }, { zigbeeModel: ['ZB-WB01'], @@ -342,8 +342,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'easyiot', description: 'Zigbee 4-channel relay', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), - onOff({endpointNames: ['l1', 'l2', 'l3', 'l4'], configureReporting: false, powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4'], configureReporting: false, powerOnBehavior: false}), ], }, { @@ -352,8 +352,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'easyiot', description: 'Zigbee 8-channel relay', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5, l6: 6, l7: 7, l8: 8}}), - onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'l7', 'l8'], configureReporting: false, powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5, l6: 6, l7: 7, l8: 8}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'l7', 'l8'], configureReporting: false, powerOnBehavior: false}), ], }, ]; diff --git a/src/devices/eatonhalo_led.ts b/src/devices/eatonhalo_led.ts index 7b8639ebf3e7f..cf642d04a2f61 100644 --- a/src/devices/eatonhalo_led.ts +++ b/src/devices/eatonhalo_led.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RL460WHZHA69', // The 4" CAN variant presents as 5/6" zigbeeModel. vendor: 'Eaton/Halo LED', description: 'Wireless Controlled LED retrofit downlight', - extend: [light({colorTemp: {range: [200, 370]}})], + extend: [m.light({colorTemp: {range: [200, 370]}})], }, ]; diff --git a/src/devices/ecodim.ts b/src/devices/ecodim.ts index 4d3839ab275e8..387329bb24587 100644 --- a/src/devices/ecodim.ts +++ b/src/devices/ecodim.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -44,8 +44,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EcoDim', description: 'LED dimmer duo 2x 0-100W', extend: [ - deviceEndpoints({endpoints: {left: 2, right: 1}}), - light({effect: false, configureReporting: true, endpointNames: ['left', 'right']}), + m.deviceEndpoints({endpoints: {left: 2, right: 1}}), + m.light({effect: false, configureReporting: true, endpointNames: ['left', 'right']}), ], }, { @@ -75,7 +75,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EcoDim', description: 'Zigbee & Z-wave dimmer', ota: true, - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ED-10010'], @@ -213,7 +213,7 @@ const definitions: DefinitionWithExtend[] = [ meta: {multiEndpoint: true}, }, { - fingerprint: [{modelID: 'TS0501B', manufacturerName: '_TZ3210_yluvwhjc'}], + fingerprint: tuya.fingerprint('TS0501B', ['_TZ3210_yluvwhjc']), model: 'ED-10042', vendor: 'EcoDim', description: 'Zigbee LED filament light dimmable E27, globe G125, flame 2200K', diff --git a/src/devices/ecosmart.ts b/src/devices/ecosmart.ts index f0281d0f2972e..69193f7b85669 100644 --- a/src/devices/ecosmart.ts +++ b/src/devices/ecosmart.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,21 +7,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'A9A19A60WESDZ02', vendor: 'EcoSmart', description: 'Tuneable white (A19)', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['Ecosmart-ZBT-BR30-CCT-Bulb'], model: 'A9BR3065WESDZ02', vendor: 'EcoSmart', description: 'Tuneable white (BR30)', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['zhaRGBW'], model: 'D1821', vendor: 'EcoSmart', description: 'A19 RGB bulb', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: [ @@ -31,7 +31,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'D1531', vendor: 'EcoSmart', description: 'A19 bright white bulb', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: [ @@ -40,14 +40,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'D1532', vendor: 'EcoSmart', description: 'A19 soft white bulb', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['zhaTunW'], model: 'D1542', vendor: 'EcoSmart', description: 'GU10 adjustable white bulb', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: [ @@ -62,7 +62,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'D1533', vendor: 'EcoSmart', description: 'PAR20/A19 bright white bulb', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: [ @@ -75,7 +75,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'D1523', vendor: 'EcoSmart', description: 'A19 soft white bulb', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/edp.ts b/src/devices/edp.ts index ea98e84ccccb2..61a67bf19c4cd 100644 --- a/src/devices/edp.ts +++ b/src/devices/edp.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -31,7 +31,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SWITCH EDP RE:DY', vendor: 'EDP', description: 're:dy switch', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/efekta.ts b/src/devices/efekta.ts index bd51d7e23d3a2..b6bad85bb2caa 100644 --- a/src/devices/efekta.ts +++ b/src/devices/efekta.ts @@ -1,18 +1,6 @@ import {Zcl} from 'zigbee-herdsman'; -import { - battery, - binary, - co2, - deviceEndpoints, - enumLookup, - humidity, - illuminance, - numeric, - pressure, - soilMoisture, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const defaultReporting = {min: 0, max: 300, change: 0}; @@ -27,29 +15,29 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'CO2 Monitor with IPS TFT Display, outdoor temperature and humidity, date and time', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2}}), - co2({reporting: defaultReporting}), - temperature({ + m.deviceEndpoints({endpoints: {'1': 1, '2': 2}}), + m.co2({reporting: defaultReporting}), + m.temperature({ endpointNames: ['1'], description: 'Measured value of the built-in temperature sensor', reporting: defaultReporting, }), - temperature({ + m.temperature({ endpointNames: ['2'], description: 'Measured value of the external temperature sensor', reporting: defaultReporting, }), - humidity({ + m.humidity({ endpointNames: ['1'], description: 'Measured value of the built-in humidity sensor', reporting: defaultReporting, }), - humidity({ + m.humidity({ endpointNames: ['2'], description: 'Measured value of the external humidity sensor', reporting: defaultReporting, }), - numeric({ + m.numeric({ name: 'voc_index', unit: 'VOC Index points', cluster: 'genAnalogInput', @@ -58,7 +46,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE', reporting: defaultReporting, }), - numeric({ + m.numeric({ name: 'voc_raw_data', unit: 'ticks', cluster: 'genAnalogInput', @@ -66,11 +54,11 @@ const definitions: DefinitionWithExtend[] = [ description: 'SRAW_VOC, digital raw value', access: 'STATE', }), - illuminance({ + m.illuminance({ access: 'STATE', reporting: defaultReporting, }), - binary({ + m.binary({ name: 'auto_brightness', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -78,7 +66,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0203, type: Zcl.DataType.BOOLEAN}, description: 'Enable or Disable Auto Brightness of the Display', }), - binary({ + m.binary({ name: 'night_onoff_backlight', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -86,7 +74,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0401, type: Zcl.DataType.BOOLEAN}, description: 'Complete shutdown of the backlight at night mode', }), - numeric({ + m.numeric({ name: 'night_on_backlight', unit: 'Hr', valueMin: 0, @@ -95,7 +83,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0405, type: Zcl.DataType.UINT8}, description: 'Night mode activation time', }), - numeric({ + m.numeric({ name: 'night_off_backlight', unit: 'Hr', valueMin: 0, @@ -104,14 +92,14 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0406, type: Zcl.DataType.UINT8}, description: 'Night mode deactivation time', }), - enumLookup({ + m.enumLookup({ name: 'rotate', lookup: {'0': 0, '90': 90, '180': 180, '270': 270}, cluster: 'msCO2', attribute: {ID: 0x0285, type: Zcl.DataType.UINT16}, description: 'Display rotation angle', }), - binary({ + m.binary({ name: 'long_chart_period', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -119,7 +107,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0204, type: Zcl.DataType.BOOLEAN}, description: 'The period of plotting the CO2 level(OFF - 1H | ON - 24H)', }), - binary({ + m.binary({ name: 'long_chart_period2', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -127,7 +115,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0404, type: Zcl.DataType.BOOLEAN}, description: 'The period of plotting the VOC Index points(OFF - 1H | ON - 24H)', }), - numeric({ + m.numeric({ name: 'set_altitude', unit: 'meters', valueMin: 0, @@ -136,7 +124,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0205, type: Zcl.DataType.UINT16}, description: 'Setting the altitude above sea level (for high accuracy of the CO2 sensor)', }), - numeric({ + m.numeric({ name: 'temperature_offset', unit: '°C', valueMin: -50, @@ -147,7 +135,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0210, type: Zcl.DataType.INT16}, description: 'Adjust temperature', }), - numeric({ + m.numeric({ name: 'humidity_offset', unit: '%', valueMin: -50, @@ -157,7 +145,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0210, type: Zcl.DataType.INT16}, description: 'Adjust humidity', }), - binary({ + m.binary({ name: 'internal_or_external', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -165,7 +153,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0288, type: Zcl.DataType.BOOLEAN}, description: 'Display data from internal or external TH sensor', }), - binary({ + m.binary({ name: 'automatic_scal', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -173,7 +161,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0402, type: Zcl.DataType.BOOLEAN}, description: 'Automatic self calibration', }), - binary({ + m.binary({ name: 'forced_recalibration', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -181,7 +169,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0202, type: Zcl.DataType.BOOLEAN}, description: 'Start FRC (Perform Forced Recalibration of the CO2 Sensor)', }), - binary({ + m.binary({ name: 'factory_reset_co2', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -189,7 +177,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0206, type: Zcl.DataType.BOOLEAN}, description: 'Factory Reset CO2 sensor', }), - numeric({ + m.numeric({ name: 'manual_forced_recalibration', unit: 'ppm', valueMin: 0, @@ -198,7 +186,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0207, type: Zcl.DataType.UINT16}, description: 'Start Manual FRC (Perform Forced Recalibration of the CO2 Sensor)', }), - binary({ + m.binary({ name: 'enable_gas', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -206,7 +194,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0220, type: Zcl.DataType.BOOLEAN}, description: 'Enable CO2 Gas Control', }), - binary({ + m.binary({ name: 'invert_logic_gas', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -214,7 +202,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0225, type: Zcl.DataType.BOOLEAN}, description: 'Enable invert logic CO2 Gas Control', }), - numeric({ + m.numeric({ name: 'high_gas', unit: 'ppm', valueMin: 400, @@ -223,7 +211,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0221, type: Zcl.DataType.UINT16}, description: 'Setting High CO2 Gas Border', }), - numeric({ + m.numeric({ name: 'low_gas', unit: 'ppm', valueMin: 400, @@ -240,14 +228,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: '[Plant Wattering Sensor, CR2450, CR2477 batteries, temperature ]', extend: [ - soilMoisture({reporting: rareReporting}), - battery({ + m.soilMoisture({reporting: rareReporting}), + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - temperature({reporting: rareReporting}), - numeric({ + m.temperature({reporting: rareReporting}), + m.numeric({ name: 'report_delay', unit: 'min', valueMin: 1, @@ -264,14 +252,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'DIY outdoor long-range sensor for temperature, humidity and atmospheric pressure', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rarestReporting, percentageReportingConfig: rarestReporting, }), - temperature({reporting: rarestReporting}), - humidity({reporting: rarestReporting}), - pressure({reporting: rarestReporting}), + m.temperature({reporting: rarestReporting}), + m.humidity({reporting: rarestReporting}), + m.pressure({reporting: rarestReporting}), ], }, { @@ -280,13 +268,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Plant wattering sensor with e-ink display', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - soilMoisture({reporting: rareReporting}), - temperature({reporting: rareReporting}), + m.soilMoisture({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), ], }, { @@ -295,13 +283,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Temperature and humidity sensor with e-ink2.13', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), ], }, { @@ -310,13 +298,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Mini plant wattering sensor', extend: [ - soilMoisture({reporting: rareReporting}), - battery({ + m.soilMoisture({reporting: rareReporting}), + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - numeric({ + m.numeric({ name: 'report_delay', unit: 'min', valueMin: 1, @@ -333,14 +321,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Mini weather station, digital barometer, forecast, charts, temperature, humidity', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), - pressure({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), + m.pressure({reporting: rareReporting}), ], }, { @@ -349,14 +337,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'DIY temperature, humidity and atmospheric pressure sensor, long battery life', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), - pressure({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), + m.pressure({reporting: rareReporting}), ], }, { @@ -365,15 +353,15 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Plant watering sensor EFEKTA PWS max', extend: [ - soilMoisture({reporting: rareReporting}), - battery({ + m.soilMoisture({reporting: rareReporting}), + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - illuminance({reporting: rareReporting}), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), + m.illuminance({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), ], }, { @@ -382,15 +370,15 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Plant watering sensor EFEKTA PWS Max Pro, long battery life', extend: [ - soilMoisture({reporting: rareReporting}), - battery({ + m.soilMoisture({reporting: rareReporting}), + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - illuminance({reporting: rareReporting}), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), + m.illuminance({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), ], }, { @@ -399,15 +387,15 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Mini weather station, barometer, forecast, charts, temperature, humidity, light', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - illuminance({reporting: rareReporting}), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), - pressure({reporting: rareReporting}), + m.illuminance({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), + m.pressure({reporting: rareReporting}), ], }, { @@ -416,15 +404,15 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Plant Wattering Sensor with e-ink display 2.13', extend: [ - soilMoisture({reporting: rareReporting}), - battery({ + m.soilMoisture({reporting: rareReporting}), + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - illuminance({reporting: rareReporting}), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), + m.illuminance({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), ], }, { @@ -433,13 +421,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Mini digital thermometer & hygrometer with e-ink1.02', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), ], }, { @@ -448,11 +436,11 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'CO2 Monitor with IPS TFT Display, outdoor temperature and humidity, date and time', extend: [ - co2({reporting: normalReporting}), - temperature({reporting: normalReporting}), - humidity({reporting: normalReporting}), - illuminance({reporting: normalReporting}), - binary({ + m.co2({reporting: normalReporting}), + m.temperature({reporting: normalReporting}), + m.humidity({reporting: normalReporting}), + m.illuminance({reporting: normalReporting}), + m.binary({ name: 'auto_brightness', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -460,7 +448,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0203, type: Zcl.DataType.BOOLEAN}, description: 'Enable or Disable Auto Brightness of the Display', }), - binary({ + m.binary({ name: 'long_chart_period', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -468,7 +456,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0204, type: Zcl.DataType.BOOLEAN}, description: 'The period of plotting the CO2 level(OFF - 1H | ON - 24H)', }), - numeric({ + m.numeric({ name: 'set_altitude', unit: 'meters', valueMin: 0, @@ -477,7 +465,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0205, type: Zcl.DataType.UINT16}, description: 'Setting the altitude above sea level (for high accuracy of the CO2 sensor)', }), - numeric({ + m.numeric({ name: 'temperature_offset', unit: '°C', valueMin: -50, @@ -488,7 +476,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0210, type: Zcl.DataType.INT16}, description: 'Adjust temperature', }), - numeric({ + m.numeric({ name: 'humidity_offset', unit: '%', valueMin: -50, @@ -498,7 +486,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0210, type: Zcl.DataType.INT16}, description: 'Adjust humidity', }), - binary({ + m.binary({ name: 'forced_recalibration', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -506,7 +494,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0202, type: Zcl.DataType.BOOLEAN}, description: 'Start FRC (Perform Forced Recalibration of the CO2 Sensor)', }), - binary({ + m.binary({ name: 'factory_reset_co2', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -514,7 +502,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0206, type: Zcl.DataType.BOOLEAN}, description: 'Factory Reset CO2 sensor', }), - numeric({ + m.numeric({ name: 'manual_forced_recalibration', unit: 'ppm', valueMin: 0, @@ -531,10 +519,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'EFEKTA CO2 Smart Monitor, ws2812b indicator, can control the relay, binding', extend: [ - co2({reporting: normalReporting}), - temperature({reporting: normalReporting}), - humidity({reporting: normalReporting}), - binary({ + m.co2({reporting: normalReporting}), + m.temperature({reporting: normalReporting}), + m.humidity({reporting: normalReporting}), + m.binary({ name: 'light_indicator', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -542,7 +530,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0211, type: Zcl.DataType.BOOLEAN}, description: 'Enable or Disable light indicator', }), - numeric({ + m.numeric({ name: 'light_indicator_level', unit: '%', valueMin: 0, @@ -551,7 +539,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0209, type: Zcl.DataType.UINT8}, description: 'Light indicator level', }), - numeric({ + m.numeric({ name: 'set_altitude', unit: 'meters', valueMin: 0, @@ -560,7 +548,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0205, type: Zcl.DataType.UINT16}, description: 'Setting the altitude above sea level (for high accuracy of the CO2 sensor)', }), - numeric({ + m.numeric({ name: 'temperature_offset', unit: '°C', valueMin: -50, @@ -571,7 +559,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0210, type: Zcl.DataType.INT16}, description: 'Adjust temperature', }), - numeric({ + m.numeric({ name: 'humidity_offset', unit: '%', valueMin: -50, @@ -581,7 +569,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0210, type: Zcl.DataType.INT16}, description: 'Adjust humidity', }), - binary({ + m.binary({ name: 'forced_recalibration', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -589,7 +577,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0202, type: Zcl.DataType.BOOLEAN}, description: 'Start FRC (Perform Forced Recalibration of the CO2 Sensor)', }), - binary({ + m.binary({ name: 'factory_reset_co2', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -597,7 +585,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0206, type: Zcl.DataType.BOOLEAN}, description: 'Factory Reset CO2 sensor', }), - numeric({ + m.numeric({ name: 'manual_forced_recalibration', unit: 'ppm', valueMin: 0, @@ -606,7 +594,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0207, type: Zcl.DataType.UINT16}, description: 'Start Manual FRC (Perform Forced Recalibration of the CO2 Sensor)', }), - binary({ + m.binary({ name: 'enable_gas', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -614,7 +602,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0220, type: Zcl.DataType.BOOLEAN}, description: 'Enable CO2 Gas Control', }), - numeric({ + m.numeric({ name: 'high_gas', unit: 'ppm', valueMin: 400, @@ -623,7 +611,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0221, type: Zcl.DataType.UINT16}, description: 'Setting High CO2 Gas Border', }), - numeric({ + m.numeric({ name: 'low_gas', unit: 'ppm', valueMin: 400, @@ -632,7 +620,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0222, type: Zcl.DataType.UINT16}, description: 'Setting Low CO2 Gas Border', }), - binary({ + m.binary({ name: 'enable_temperature', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -640,7 +628,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0220, type: Zcl.DataType.BOOLEAN}, description: 'Enable Temperature Control', }), - numeric({ + m.numeric({ name: 'high_temperature', unit: '°C', valueMin: -5, @@ -649,7 +637,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0221, type: Zcl.DataType.INT16}, description: 'Setting High Temperature Border', }), - numeric({ + m.numeric({ name: 'low_temperature', unit: '°C', valueMin: -5, @@ -658,7 +646,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0222, type: Zcl.DataType.INT16}, description: 'Setting Low Temperature Border', }), - binary({ + m.binary({ name: 'enable_humidity', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -666,7 +654,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0220, type: Zcl.DataType.BOOLEAN}, description: 'Enable Humidity Control', }), - numeric({ + m.numeric({ name: 'high_humidity', unit: '%', valueMin: 0, @@ -675,7 +663,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0221, type: Zcl.DataType.UINT16}, description: 'Setting High Humidity Border', }), - numeric({ + m.numeric({ name: 'low_humidity', unit: '%', valueMin: 0, @@ -692,14 +680,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'EFEKTA', description: 'Alternative firmware for the SONOFF SNZB-02 sensor from EfektaLab, DIY', extend: [ - battery({ + m.battery({ voltage: true, voltageReportingConfig: rareReporting, percentageReportingConfig: rareReporting, }), - temperature({reporting: rareReporting}), - humidity({reporting: rareReporting}), - numeric({ + m.temperature({reporting: rareReporting}), + m.humidity({reporting: rareReporting}), + m.numeric({ name: 'report_delay', unit: 'min', valueMin: 1, @@ -708,7 +696,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0201, type: Zcl.DataType.UINT16}, description: 'Adjust Report Delay. Setting the time in minutes, by default 5 minutes', }), - binary({ + m.binary({ name: 'enable_temperature', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -716,7 +704,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0220, type: Zcl.DataType.BOOLEAN}, description: 'Enable Temperature Control', }), - numeric({ + m.numeric({ name: 'high_temperature', unit: '°C', valueMin: -5, @@ -725,7 +713,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0221, type: Zcl.DataType.INT16}, description: 'Setting High Temperature Border', }), - numeric({ + m.numeric({ name: 'low_temperature', unit: '°C', valueMin: -5, @@ -734,7 +722,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0222, type: Zcl.DataType.INT16}, description: 'Setting Low Temperature Border', }), - binary({ + m.binary({ name: 'enable_humidity', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -742,7 +730,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0220, type: Zcl.DataType.BOOLEAN}, description: 'Enable Humidity Control', }), - numeric({ + m.numeric({ name: 'high_humidity', unit: '%', valueMin: 0, @@ -751,7 +739,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x0221, type: Zcl.DataType.UINT16}, description: 'Setting High Humidity Border', }), - numeric({ + m.numeric({ name: 'low_humidity', unit: '%', valueMin: 0, diff --git a/src/devices/eglo.ts b/src/devices/eglo.ts index c8c06de6adbd7..ea32af829784e 100644 --- a/src/devices/eglo.ts +++ b/src/devices/eglo.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -11,28 +11,28 @@ const definitions: DefinitionWithExtend[] = [ model: '900091', vendor: 'EGLO', description: 'ROVITO-Z ceiling light', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['ESMLFzm_w6_TW'], model: '12242', vendor: 'EGLO', description: 'ST64 adjustable white filament bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['EGLO_ZM_RGB_TW'], model: '900024/12253', vendor: 'EGLO', description: 'RGB light', - extend: [light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['EGLO_ZM_TW_CLP'], model: '98847', vendor: 'EGLO', description: 'FUEVA-Z ceiling light IP44', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['ERCU_3groups_Zm'], diff --git a/src/devices/elko.ts b/src/devices/elko.ts index 515c763be4a9d..2da6164a02314 100644 --- a/src/devices/elko.ts +++ b/src/devices/elko.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {binary, enumLookup, light, numeric, text} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; import {assertString} from '../lib/utils'; @@ -16,7 +16,7 @@ const definitions: DefinitionWithExtend[] = [ model: '316GLEDRF', vendor: 'ELKO', description: 'ZigBee in-wall smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], meta: {disableDefaultResponse: true}, }, { @@ -41,7 +41,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.elko_thermostat], toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.elko_power_status, tz.elko_relay_state, tz.elko_local_temperature_calibration], extend: [ - text({ + m.text({ name: 'display_text', cluster: 'hvacThermostat', attribute: 'elkoDisplayText', @@ -52,7 +52,7 @@ const definitions: DefinitionWithExtend[] = [ if (value.length > 14) throw new Error('Length of text is greater than 14'); }, }), - numeric({ + m.numeric({ name: 'load', cluster: 'hvacThermostat', attribute: 'elkoLoad', @@ -63,7 +63,7 @@ const definitions: DefinitionWithExtend[] = [ valueMin: 0, valueMax: 2300, }), - binary({ + m.binary({ name: 'regulator_mode', cluster: 'hvacThermostat', attribute: 'elkoRegulatorMode', @@ -73,7 +73,7 @@ const definitions: DefinitionWithExtend[] = [ valueOn: ['regulator', 1], valueOff: ['thermostat', 0], }), - numeric({ + m.numeric({ name: 'regulator_time', cluster: 'hvacThermostat', attribute: 'elkoRegulatorTime', @@ -88,7 +88,7 @@ const definitions: DefinitionWithExtend[] = [ valueMin: 5, valueMax: 20, }), - enumLookup({ + m.enumLookup({ name: 'sensor', cluster: 'hvacThermostat', attribute: 'elkoSensor', @@ -96,7 +96,7 @@ const definitions: DefinitionWithExtend[] = [ reporting: {min: 'MIN', max: 'MAX', change: null}, lookup: {air: 0, floor: 1, supervisor_floor: 3}, }), - numeric({ + m.numeric({ name: 'floor_temp', cluster: 'hvacThermostat', attribute: 'elkoExternalTemp', @@ -106,7 +106,7 @@ const definitions: DefinitionWithExtend[] = [ reporting: {min: 0, max: constants.repInterval.HOUR, change: 10}, scale: 100, }), - numeric({ + m.numeric({ name: 'max_floor_temp', cluster: 'hvacThermostat', attribute: 'elkoMaxFloorTemp', @@ -117,7 +117,7 @@ const definitions: DefinitionWithExtend[] = [ valueMin: 20, valueMax: 35, }), - numeric({ + m.numeric({ name: 'mean_power', cluster: 'hvacThermostat', attribute: 'elkoMeanPower', @@ -126,7 +126,7 @@ const definitions: DefinitionWithExtend[] = [ unit: 'W', reporting: {min: 0, max: constants.repInterval.HOUR, change: 5}, }), - binary({ + m.binary({ name: 'child_lock', cluster: 'hvacThermostat', attribute: 'elkoChildLock', @@ -136,7 +136,7 @@ const definitions: DefinitionWithExtend[] = [ valueOn: ['lock', 1], valueOff: ['unlock', 0], }), - binary({ + m.binary({ name: 'frost_guard', cluster: 'hvacThermostat', attribute: 'elkoFrostGuard', @@ -149,7 +149,7 @@ const definitions: DefinitionWithExtend[] = [ valueOn: ['on', 1], valueOff: ['off', 0], }), - binary({ + m.binary({ name: 'night_switching', cluster: 'hvacThermostat', attribute: 'elkoNightSwitching', diff --git a/src/devices/enbrighten.ts b/src/devices/enbrighten.ts index c8aa70f7c9be9..f6bccb11e6818 100644 --- a/src/devices/enbrighten.ts +++ b/src/devices/enbrighten.ts @@ -1,5 +1,5 @@ import fz from '../converters/fromZigbee'; -import {electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -8,42 +8,42 @@ const definitions: DefinitionWithExtend[] = [ model: '43076', vendor: 'Enbrighten', description: 'Zigbee in-wall smart switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['43078'], model: '43078', vendor: 'Enbrighten', description: 'Zigbee in-wall smart switch', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['43080'], model: '43080', vendor: 'Enbrighten', description: 'Zigbee in-wall smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['43113'], model: '43113', vendor: 'Enbrighten', description: 'Zigbee in-wall smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['43102'], model: '43102', vendor: 'Enbrighten', description: 'Zigbee in-wall outlet', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['43100'], model: '43100', vendor: 'Enbrighten', description: 'Plug-in Zigbee outdoor smart switch', - extend: [onOff()], + extend: [m.onOff()], fromZigbee: [fz.command_on_state, fz.command_off_state], }, { @@ -51,42 +51,42 @@ const definitions: DefinitionWithExtend[] = [ model: '43082', vendor: 'Enbrighten', description: 'Zigbee in-wall smart dimmer', - extend: [light({configureReporting: true, effect: false, powerOnBehavior: false}), electricityMeter({cluster: 'metering'})], + extend: [m.light({configureReporting: true, effect: false, powerOnBehavior: false}), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['43084'], model: '43084', vendor: 'Enbrighten', description: 'Zigbee in-wall smart switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['43090'], model: '43090', vendor: 'Enbrighten', description: 'Zigbee in-wall smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['43094'], model: '43094', vendor: 'Enbrighten', description: 'Zigbee in-wall smart switch ZB4102', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['43096'], model: '43096', vendor: 'Enbrighten', description: 'Zigbee plug-in smart dimmer with dual controlled outlets', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['43109'], model: '43109', vendor: 'Enbrighten', description: 'Zigbee in-wall smart switch', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/envilar.ts b/src/devices/envilar.ts index ea77f32c84170..6ea81d9ba1b71 100644 --- a/src/devices/envilar.ts +++ b/src/devices/envilar.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, electricityMeter, identify, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -11,14 +11,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZG_LED_DRIVER42CC', vendor: 'Envilar', description: 'Zigbee LED driver', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZG50CC-CCT-DRIVER', 'HK-CCT'], model: 'ZG50CC-CCT-DRIVER', vendor: 'Envilar', description: 'Zigbee CCT LED driver', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, { zigbeeModel: ['ZGR904-S'], @@ -35,28 +35,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZG102-BOX-UNIDIM', vendor: 'Envilar', description: 'ZigBee AC phase-cut dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ZG302-BOX-RELAY'], model: 'ZG302-BOX-RELAY', vendor: 'Envilar', description: 'Zigbee AC in wall switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['2CH-ZG-BOX-RELAY'], model: '2CH-ZG-BOX-RELAY', vendor: 'Envilar', description: '2 channel box relay', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['7853'], model: '1CH-HP-RELAY-7853', vendor: 'Envilar', description: '1 channel high power box relay', - extend: [onOff({powerOnBehavior: true}), identify(), electricityMeter()], + extend: [m.onOff({powerOnBehavior: true}), m.identify(), m.electricityMeter()], whiteLabel: [{vendor: 'Sunricher', model: 'SR-ZG9101SAC-HP-SWITCH-B'}], }, ]; diff --git a/src/devices/essentialb.ts b/src/devices/essentialb.ts index 8ab4d8b857cdc..444b47c4a440c 100644 --- a/src/devices/essentialb.ts +++ b/src/devices/essentialb.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -12,63 +12,63 @@ const definitions: DefinitionWithExtend[] = [ model: 'EB-E14-P45-RGBW', vendor: 'EssentielB', description: 'Smart LED bulb', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['EB-E14-FLA-CCT'], model: 'EB-E14-FLA-CCT', vendor: 'EssentielB', description: 'E14 flame CCT light bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['EB-E27-A60-CCT-FC'], model: 'EB-E27-A60-CCT-FC', vendor: 'EssentielB', description: 'E27 A60 CCT filament clear light bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['EB-E27-A60-CCT'], model: 'EB-E27-A60-CCT', vendor: 'EssentielB', description: 'E27 A60 CCT light bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['EB-E27-A60-RGBW'], model: 'EB-E27-A60-RGBW', vendor: 'EssentielB', description: 'E27 A60 RGBW light bulb', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['EB-E27-G95-CCT-FV'], model: 'EB-E27-G95-CCT-FV', vendor: 'EssentielB', description: 'Filament vintage globe light bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['EB-E27-ST64-CCT-FV'], model: 'EB-E27-ST64-CCT-FV', vendor: 'EssentielB', description: 'Filament vintage edison light bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['EB-GU10-MR16-CCT'], model: 'EB-GU10-MR16-CCT', vendor: 'EssentielB', description: 'GU10 MR16 CCT light bulb', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['EB-GU10-MR16-RGBW'], model: 'EB-GU10-MR16-RGBW', vendor: 'EssentielB', description: 'GU10 MR16 RGBW light bulb', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { zigbeeModel: ['EB-SB-1B'], diff --git a/src/devices/essentials.ts b/src/devices/essentials.ts index 1d38e57edb7f4..a46700201ea6c 100644 --- a/src/devices/essentials.ts +++ b/src/devices/essentials.ts @@ -67,7 +67,7 @@ const localValueConverters = { const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_i48qyn9s'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_i48qyn9s']), model: '_TZE200_i48qyn9s', vendor: 'Essentials', description: 'Thermostat Zigbee smart home', diff --git a/src/devices/eucontrols.ts b/src/devices/eucontrols.ts index d9d3b7ee564ca..70bba5cc8d980 100644 --- a/src/devices/eucontrols.ts +++ b/src/devices/eucontrols.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LCM-1C09-ZB', vendor: 'EuControls', description: '0-10V Zigbee Dimmer', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/evanell.ts b/src/devices/evanell.ts index 491be1480e4e6..330c9c3947663 100644 --- a/src/devices/evanell.ts +++ b/src/devices/evanell.ts @@ -9,10 +9,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_dmfguuli'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_rxypyjkw'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_dmfguuli', '_TZE200_rxypyjkw']), model: 'EZ200', vendor: 'Evanell', description: 'Thermostatic radiator valve', diff --git a/src/devices/evn.ts b/src/devices/evn.ts index 41d80735a13e9..1c120776efe2d 100644 --- a/src/devices/evn.ts +++ b/src/devices/evn.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -51,7 +51,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB24100VS', vendor: 'EVN', description: 'Zigbee multicolor controller with power supply', - extend: [light({colorTemp: {range: [160, 450]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [160, 450]}, color: {modes: ['xy', 'hs']}})], }, ]; diff --git a/src/devices/evvr.ts b/src/devices/evvr.ts index 6d87c69e5c8ad..a7fddcd53605a 100644 --- a/src/devices/evvr.ts +++ b/src/devices/evvr.ts @@ -1,4 +1,4 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SRB01', vendor: 'Evvr', description: 'In-wall relay switch', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/ewelink.ts b/src/devices/ewelink.ts index cbeec15656c10..3d42106d212ab 100644 --- a/src/devices/ewelink.ts +++ b/src/devices/ewelink.ts @@ -4,16 +4,7 @@ import fz from '../converters/fromZigbee'; import {modernExtend as ewelinkModernExtend} from '../lib/ewelink'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import { - battery, - deviceAddCustomCluster, - deviceEndpoints, - forcePowerSource, - iasZoneAlarm, - onOff, - setupAttributes, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz} from '../lib/types'; @@ -47,7 +38,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'CK-BL702-MSW-01(7010)', vendor: 'eWeLink', description: 'CMARS Zigbee smart plug', - extend: [onOff({skipDuplicateTransaction: true})], + extend: [m.onOff({skipDuplicateTransaction: true})], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; }, @@ -57,7 +48,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SA-003-Zigbee', vendor: 'eWeLink', description: 'Zigbee smart plug', - extend: [onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], + extend: [m.onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; }, @@ -76,7 +67,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SA-030-1', vendor: 'eWeLink', description: 'Zigbee 3.0 smart plug 13A (3120W)(UK version)', - extend: [onOff({skipDuplicateTransaction: true})], + extend: [m.onOff({skipDuplicateTransaction: true})], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; }, @@ -86,7 +77,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SWITCH-ZR02', vendor: 'eWeLink', description: 'Zigbee smart switch', - extend: [onOff({powerOnBehavior: false, skipDuplicateTransaction: true})], + extend: [m.onOff({powerOnBehavior: false, skipDuplicateTransaction: true})], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; }, @@ -96,7 +87,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SWITCH-ZR03-1', vendor: 'eWeLink', description: 'Zigbee smart switch', - extend: [onOff({skipDuplicateTransaction: true})], + extend: [m.onOff({skipDuplicateTransaction: true})], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; }, @@ -106,7 +97,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-SW01', vendor: 'eWeLink', description: 'Smart light switch - 1 gang', - extend: [onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], + extend: [m.onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; }, @@ -116,7 +107,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-SW02', vendor: 'eWeLink', description: 'Smart light switch/2 gang relay', - extend: [deviceEndpoints({endpoints: {left: 1, right: 2}}), onOff({endpointNames: ['left', 'right'], configureReporting: false})], + extend: [m.deviceEndpoints({endpoints: {left: 1, right: 2}}), m.onOff({endpointNames: ['left', 'right'], configureReporting: false})], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; }, @@ -127,8 +118,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'eWeLink', description: 'Smart light switch - 3 gang', extend: [ - deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), - onOff({endpointNames: ['left', 'center', 'right'], configureReporting: false}), + m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), + m.onOff({endpointNames: ['left', 'center', 'right'], configureReporting: false}), ], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; @@ -140,8 +131,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'eWeLink', description: 'Smart light switch - 4 gang', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), - onOff({endpointNames: ['l1', 'l2', 'l3', 'l4'], configureReporting: false}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4'], configureReporting: false}), ], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; @@ -153,8 +144,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'eWeLink', description: 'Smart light switch - 5 gang', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), - onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5'], configureReporting: false}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5'], configureReporting: false}), ], onEvent: async (type, data, device) => { device.skipDefaultResponse = true; @@ -174,7 +165,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SNZB-05', vendor: 'eWeLink', description: 'Zigbee water sensor', - extend: [battery(), iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'battery_low']})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'battery_low']})], }, { zigbeeModel: ['CK-MG22-JLDJ-01(7015)', 'CK-MG22-Z310EE07DOOYA-01(7015)', 'MYDY25Z-1', 'Grandekor Smart Curtain Grandekor'], @@ -188,7 +179,7 @@ const definitions: DefinitionWithExtend[] = [ ], description: 'Dooya Curtain', extend: [ - deviceAddCustomCluster('customClusterEwelink', { + m.deviceAddCustomCluster('customClusterEwelink', { ID: 0xef00, attributes: {}, commands: { @@ -199,9 +190,9 @@ const definitions: DefinitionWithExtend[] = [ }, commandsResponse: {}, }), - forcePowerSource({powerSource: 'Battery'}), + m.forcePowerSource({powerSource: 'Battery'}), ewelinkModernExtend.ewelinkBattery(), - windowCovering({ + m.windowCovering({ controls: ['lift'], configureReporting: false, coverMode: false, @@ -215,7 +206,7 @@ const definitions: DefinitionWithExtend[] = [ ], configure: async (device, coordinatorEndpoint) => { const windowCoveringAttributes = [{attribute: 'currentPositionLiftPercentage', min: 0, max: 3600, change: 10}]; - await setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes); + await m.setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes); }, onEvent: async (type, data, device, settings, state) => { if (type === 'deviceInterview') { @@ -239,7 +230,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [{fingerprint: [{modelID: 'MYRX25Z-1'}], vendor: 'eWeLink', model: 'MYRX25Z-1'}], description: 'Reax Curtain', extend: [ - deviceAddCustomCluster('customClusterEwelink', { + m.deviceAddCustomCluster('customClusterEwelink', { ID: 0xef00, attributes: {}, commands: { @@ -250,9 +241,9 @@ const definitions: DefinitionWithExtend[] = [ }, commandsResponse: {}, }), - forcePowerSource({powerSource: 'Battery'}), + m.forcePowerSource({powerSource: 'Battery'}), ewelinkModernExtend.ewelinkBattery(), - windowCovering({ + m.windowCovering({ controls: ['lift'], configureReporting: false, coverMode: false, @@ -268,7 +259,7 @@ const definitions: DefinitionWithExtend[] = [ await reporting.bind(endpoint, coordinatorEndpoint, ['customClusterEwelink']); const windowCoveringAttributes = [{attribute: 'currentPositionLiftPercentage', min: 0, max: 3600, change: 10}]; - await setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes); + await m.setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes); }, ota: true, }, @@ -283,7 +274,7 @@ const definitions: DefinitionWithExtend[] = [ ], description: 'AK Curtain', extend: [ - deviceAddCustomCluster('customClusterEwelink', { + m.deviceAddCustomCluster('customClusterEwelink', { ID: 0xef00, attributes: {}, commands: { @@ -294,9 +285,9 @@ const definitions: DefinitionWithExtend[] = [ }, commandsResponse: {}, }), - forcePowerSource({powerSource: 'Battery'}), + m.forcePowerSource({powerSource: 'Battery'}), ewelinkModernExtend.ewelinkBattery(), - windowCovering({ + m.windowCovering({ controls: ['lift'], configureReporting: false, coverMode: false, @@ -308,7 +299,7 @@ const definitions: DefinitionWithExtend[] = [ ], configure: async (device, coordinatorEndpoint) => { const windowCoveringAttributes = [{attribute: 'currentPositionLiftPercentage', min: 0, max: 3600, change: 10}]; - await setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes); + await m.setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes); }, ota: true, }, diff --git a/src/devices/ezex.ts b/src/devices/ezex.ts index b6f327dca9f71..16e947d7f80d2 100644 --- a/src/devices/ezex.ts +++ b/src/devices/ezex.ts @@ -1,4 +1,4 @@ -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ECW-100-A03', vendor: 'eZEX', description: 'Zigbee switch 3 gang', - extend: [deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), onOff({endpointNames: ['top', 'center', 'bottom']})], + extend: [m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), m.onOff({endpointNames: ['top', 'center', 'bottom']})], }, ]; diff --git a/src/devices/fantem.ts b/src/devices/fantem.ts index 788fe93e42921..c2204222dc49f 100644 --- a/src/devices/fantem.ts +++ b/src/devices/fantem.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -10,14 +10,11 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS110F', manufacturerName: '_TZ3210_lfbz816s'}, - {modelID: 'TS110F', manufacturerName: '_TZ3210_ebbfkvoy'}, - ], + fingerprint: tuya.fingerprint('TS110F', ['_TZ3210_lfbz816s', '_TZ3210_ebbfkvoy']), model: 'ZB006-X', vendor: 'Fantem', description: 'Smart dimmer module', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], fromZigbee: [fz.command_on, fz.command_off, fz.command_move, fz.command_stop, legacy.fz.ZB006X_settings], toZigbee: [legacy.tz.ZB006X_settings], exposes: [ @@ -44,13 +41,12 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB003-X', vendor: 'Fantem', description: '4 in 1 multi sensor', - fromZigbee: [fz.battery, fz.ignore_basic_report, fz.illuminance, legacy.fz.ZB003X, fz.ZB003X_attr, fz.ZB003X_occupancy], + fromZigbee: [fz.battery, fz.ignore_basic_report, legacy.fz.ZB003X, fz.ZB003X_attr, fz.ZB003X_occupancy], toZigbee: [legacy.tz.ZB003X], whiteLabel: [tuya.whitelabel('EFK', 'is-thpl-zb', '4 in 1 multi sensor', ['_TZ3210_0aqbrnts'])], exposes: [ e.occupancy(), e.tamper(), - e.illuminance(), e.temperature(), e.humidity(), e.battery(), @@ -76,6 +72,7 @@ const definitions: DefinitionWithExtend[] = [ e.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high']).withDescription('PIR sensor sensitivity'), e.enum('keep_time', ea.STATE_SET, ['0', '30', '60', '120', '240', '480']).withDescription('PIR keep time in seconds'), ], + extend: [m.illuminance()], }, ]; diff --git a/src/devices/feibit.ts b/src/devices/feibit.ts index f6ae55d35e817..c6f72bbb96c62 100644 --- a/src/devices/feibit.ts +++ b/src/devices/feibit.ts @@ -1,17 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import { - battery, - commandsLevelCtrl, - commandsOnOff, - deviceEndpoints, - electricityMeter, - identify, - light, - onOff, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {philipsLight} from '../lib/philips'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -24,14 +14,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'TZSW22FW-L4', vendor: 'Feibit', description: 'Smart light switch - 2 gang', - extend: [deviceEndpoints({endpoints: {top: 16, bottom: 17}}), onOff({endpointNames: ['top', 'bottom']})], + extend: [m.deviceEndpoints({endpoints: {top: 16, bottom: 17}}), m.onOff({endpointNames: ['top', 'bottom']})], }, { zigbeeModel: ['FB56+ZSW1GKJ2.3'], model: 'SKY01-TS1-101', vendor: 'Feibit', description: 'Smart light switch - 1 gang', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['FNB56-SOS03FB1.5'], @@ -129,21 +119,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'SFS01ZB', vendor: 'Feibit', description: 'Power plug', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['FB56+ZSW1HKJ2.2', 'FB56+ZSW1HKJ1.1'], model: 'SLS301ZB_2', vendor: 'Feibit', description: 'Smart light switch - 2 gang', - extend: [deviceEndpoints({endpoints: {left: 16, right: 17}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 16, right: 17}}), m.onOff({endpointNames: ['left', 'right']})], }, { zigbeeModel: ['FB56+ZSW1IKJ2.2', 'FB56+ZSW1IKJ1.1'], model: 'SLS301ZB_3', vendor: 'Feibit', description: 'Smart light switch - 3 gang', - extend: [deviceEndpoints({endpoints: {left: 16, center: 17, right: 18}}), onOff({endpointNames: ['left', 'center', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 16, center: 17, right: 18}}), m.onOff({endpointNames: ['left', 'center', 'right']})], }, { zigbeeModel: ['FB56+ZSN08KJ2.2'], @@ -159,7 +149,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TSKT106W-M1', vendor: 'Feibit', description: 'Portable Smart Socket', - extend: [deviceEndpoints({endpoints: {holes: 16, usb: 17}}), onOff({powerOnBehavior: false, endpointNames: ['holes', 'usb']})], + extend: [m.deviceEndpoints({endpoints: {holes: 16, usb: 17}}), m.onOff({powerOnBehavior: false, endpointNames: ['holes', 'usb']})], }, { zigbeeModel: ['FEB56-ZSN25YS1.3'], @@ -175,7 +165,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TZSN408W-V1', vendor: 'Feibit', description: 'Four-Gang Scene Switch', - extend: [deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), commandsOnOff({endpointNames: ['1', '2', '3', '4']})], + extend: [m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), m.commandsOnOff({endpointNames: ['1', '2', '3', '4']})], }, { zigbeeModel: ['FNB56-ZRC06FB2.0'], @@ -201,7 +191,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SZT211_AW-P1', vendor: 'Feibit', description: 'Curtain Motor', - extend: [windowCovering({controls: ['lift', 'tilt']})], + extend: [m.windowCovering({controls: ['lift', 'tilt']})], }, { zigbeeModel: ['FB56+TMT01ZY1.6'], @@ -241,14 +231,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'TZSC302W-V1', vendor: 'Feibit', description: 'Dimmer Switch', - extend: [light({powerOnBehavior: false})], + extend: [m.light({powerOnBehavior: false})], }, { zigbeeModel: ['FTB56+SKT22HY1.1'], model: 'TSKT222W-H4', vendor: 'Feibit', description: 'Power Socket with Metering', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['FB56+CUR18SB2.0'], @@ -256,9 +246,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Feibit', description: 'Dual Track Curtain Panel', extend: [ - deviceEndpoints({endpoints: {top: 15, bottom: 14}}), - identify(), - windowCovering({controls: ['lift', 'tilt'], endpointNames: ['top', 'bottom']}), + m.deviceEndpoints({endpoints: {top: 15, bottom: 14}}), + m.identify(), + m.windowCovering({controls: ['lift', 'tilt'], endpointNames: ['top', 'bottom']}), ], }, { @@ -266,42 +256,46 @@ const definitions: DefinitionWithExtend[] = [ model: 'FMRC209W', vendor: 'Feibit', description: '2-Button Dimmer Switch', - extend: [battery(), identify(), commandsOnOff(), commandsLevelCtrl()], + extend: [m.battery(), m.identify(), m.commandsOnOff(), m.commandsLevelCtrl()], }, { zigbeeModel: ['FZT56-ZCW2LBW1.2'], model: 'FZCWF2LW-BW', vendor: 'Feibit', description: 'Smart LED Retrofit Light', - extend: [identify(), philipsLight({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + extend: [m.identify(), philipsLight({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], }, { zigbeeModel: ['FZT56-ZCW2HYH1.3'], model: 'FZCWD2HW-YH', vendor: 'Feibit', description: 'Smart LED Recessed Light', - extend: [identify(), philipsLight({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + extend: [m.identify(), philipsLight({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], }, { zigbeeModel: ['FNB56-ZSN21YM1.0'], model: 'NZSN421W-Q', vendor: 'Feibit', description: 'Four-Gang Battery-Powered Scene Switch', - extend: [deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), battery(), commandsOnOff({endpointNames: ['1', '2', '3', '4']})], + extend: [ + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.battery(), + m.commandsOnOff({endpointNames: ['1', '2', '3', '4']}), + ], }, { zigbeeModel: ['FEB56-STK2AYS1.1'], model: 'TSKT113W-H4', vendor: 'Feibit', description: 'In-wall Power plug', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['FEB61-SKT1IFB1.2'], model: 'SSKT11IW-F1', vendor: 'Feibit', description: 'Power plug', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, ]; diff --git a/src/devices/frankever.ts b/src/devices/frankever.ts index 81a24e5e67b3f..c2f768d06f549 100644 --- a/src/devices/frankever.ts +++ b/src/devices/frankever.ts @@ -1,5 +1,6 @@ import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -7,11 +8,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_wt9agwf3'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_5uodvhgc'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_1n2zev06'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_wt9agwf3', '_TZE200_5uodvhgc', '_TZE200_1n2zev06']), model: 'FK_V02', vendor: 'FrankEver', description: 'Zigbee smart water valve', diff --git a/src/devices/frient.ts b/src/devices/frient.ts index 2e6e232dc2577..3e7983212fbd5 100644 --- a/src/devices/frient.ts +++ b/src/devices/frient.ts @@ -1,5 +1,5 @@ import {develcoModernExtend} from '../lib/develco'; -import {battery, electricityMeter, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; // NOTE! Develco and Frient is the same company, therefore we use develco specific things in here. @@ -11,8 +11,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Frient', description: 'Electricity meter interface 2 LED', extend: [ - electricityMeter({cluster: 'metering', power: {divisor: 1000, multiplier: 1}, energy: {divisor: 1000, multiplier: 1}}), - battery(), + m.electricityMeter({cluster: 'metering', power: {divisor: 1000, multiplier: 1}, energy: {divisor: 1000, multiplier: 1}}), + m.battery(), develcoModernExtend.addCustomClusterManuSpecificDevelcoGenBasic(), develcoModernExtend.readGenBasicPrimaryVersions(), develcoModernExtend.pulseConfiguration(), @@ -25,7 +25,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SMRZB-153', vendor: 'Frient', description: 'Smart Cable - Power switch with power measurement', - extend: [onOff({configureReporting: false}), electricityMeter()], + extend: [m.onOff({configureReporting: false}), m.electricityMeter()], endpoint: () => { return {default: 2}; }, @@ -35,7 +35,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'EMIZB-151', vendor: 'Frient', description: 'HAN P1 power-meter sensor', - extend: [electricityMeter({threePhase: true})], + extend: [m.electricityMeter({threePhase: true})], }, ]; diff --git a/src/devices/futurehome.ts b/src/devices/futurehome.ts index 6a732b0b8c549..a25521e0b8408 100644 --- a/src/devices/futurehome.ts +++ b/src/devices/futurehome.ts @@ -1,7 +1,7 @@ import {DefinitionWithExtend} from 'src/lib/types'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as tuya from '../lib/tuya'; const e = exposes.presets; @@ -89,7 +89,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Futurehome', description: 'Smart puck', ota: true, - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/ge.ts b/src/devices/ge.ts index b4694bb1ddaaf..6909bae386550 100644 --- a/src/devices/ge.ts +++ b/src/devices/ge.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -13,28 +13,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'PSB19-SW27', vendor: 'GE', description: 'Link smart LED light bulb, A19 soft white (2700K)', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZLL Light'], model: '22670', vendor: 'GE', description: 'Link smart LED light bulb, A19/BR30 soft white (2700K)', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['Daylight'], model: 'PQC19-DY01', vendor: 'GE', description: 'Link smart LED light bulb, A19/BR30 cold white (5000K)', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['45852'], model: '45852GE', vendor: 'GE', description: 'ZigBee plug-in smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['45853'], @@ -74,14 +74,14 @@ const definitions: DefinitionWithExtend[] = [ model: '45857GE', vendor: 'GE', description: 'ZigBee in-wall smart dimmer', - extend: [light({configureReporting: true}), electricityMeter({cluster: 'metering'})], + extend: [m.light({configureReporting: true}), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['Smart Switch'], model: 'PTAPT-WH02', vendor: 'GE', description: 'Quirky smart switch', - extend: [onOff()], + extend: [m.onOff()], endpoint: (device) => { return {default: 2}; }, @@ -91,7 +91,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'POTLK-WH02', vendor: 'GE', description: 'Outlink smart remote outlet', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/gewiss.ts b/src/devices/gewiss.ts index 73bd77212d007..2d7562de546ce 100644 --- a/src/devices/gewiss.ts +++ b/src/devices/gewiss.ts @@ -1,26 +1,34 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; const definitions: DefinitionWithExtend[] = [ + { + zigbeeModel: ['GWA1201_TWO_WAY_SWITCH'], + model: 'GWA1201_TWO_WAY_SWITCH', + vendor: 'Gewiss', + description: 'GWA1201', + extend: [m.onOff(), m.electricityMeter(), m.identify()], + ota: true, + }, { zigbeeModel: ['GWA1521_Actuator_1_CH_PF'], model: 'GWA1521', description: 'Switch actuator 1 channel with input', vendor: 'Gewiss', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['GWA1522_Actuator_2_CH'], model: 'GWA1522', description: 'Switch actuator 2 channels with input', vendor: 'Gewiss', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['GWA1531_Shutter'], diff --git a/src/devices/gidealed.ts b/src/devices/gidealed.ts index 44f005cbedb44..74e43a889749a 100644 --- a/src/devices/gidealed.ts +++ b/src/devices/gidealed.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZC05M', vendor: 'GIDEALED', description: 'Smart Zigbee RGB LED strip controller', - extend: [light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], }, ]; diff --git a/src/devices/giderwel.ts b/src/devices/giderwel.ts index 1ae208c744aa9..b29f00ea13410 100644 --- a/src/devices/giderwel.ts +++ b/src/devices/giderwel.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'GD-ZCRGB012', vendor: 'GIDERWEL', description: 'Smart Zigbee RGB LED strip controller', - extend: [light({color: {modes: ['xy', 'hs']}})], + extend: [m.light({color: {modes: ['xy', 'hs']}})], }, ]; diff --git a/src/devices/giex.ts b/src/devices/giex.ts index e43fc5eb15f7c..ef0abe8d82412 100644 --- a/src/devices/giex.ts +++ b/src/devices/giex.ts @@ -39,7 +39,7 @@ const definitions: DefinitionWithExtend[] = [ { ...exportTemplates.giexWaterValve, model: 'QT06_1', - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_sh1btabb'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_sh1btabb']), exposes: [ ...exportTemplates.giexWaterValve.exposes, e @@ -60,13 +60,7 @@ const definitions: DefinitionWithExtend[] = [ { ...exportTemplates.giexWaterValve, model: 'QT06_2', - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_a7sghmms'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_a7sghmms'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_7ytb3h8u'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_7ytb3h8u'}, - {modelID: 'TS0601', manufacturerName: '_TZE284_7ytb3h8u'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_a7sghmms', '_TZE204_a7sghmms', '_TZE204_7ytb3h8u', '_TZE200_7ytb3h8u', '_TZE284_7ytb3h8u']), exposes: [ ...exportTemplates.giexWaterValve.exposes, e diff --git a/src/devices/girier.ts b/src/devices/girier.ts index 0f829ad4d714c..529510e8929a5 100644 --- a/src/devices/girier.ts +++ b/src/devices/girier.ts @@ -4,11 +4,7 @@ import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0001', manufacturerName: '_TZ3000_majwnphg'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_6axxqqi2'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_zw7yf6yk'}, - ], + fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_majwnphg', '_TZ3000_6axxqqi2', '_TZ3000_zw7yf6yk']), model: 'JR-ZDS01', vendor: 'Girier', description: '1 gang mini switch', diff --git a/src/devices/gledopto.ts b/src/devices/gledopto.ts index aa5d1f5a420c4..b1ac0abaec168 100644 --- a/src/devices/gledopto.ts +++ b/src/devices/gledopto.ts @@ -2,7 +2,7 @@ import tz from '../converters/toZigbee'; import * as libColor from '../lib/color'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import {identify, light, LightArgs, onOff, OnOffArgs} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as globalStore from '../lib/store'; import {Configure, DefinitionWithExtend, KeyValue, ModernExtend, OnEventType, Tz, Zh} from '../lib/types'; import * as utils from '../lib/utils'; @@ -112,10 +112,10 @@ const tzLocal = { } satisfies Tz.Converter, }; -function gledoptoLight(args?: LightArgs) { +function gledoptoLight(args?: m.LightArgs) { args = {powerOnBehavior: false, ...args}; if (args.color) args.color = {modes: ['xy', 'hs'], ...(utils.isObject(args.color) ? args.color : {})}; - const result = light(args); + const result = m.light(args); result.toZigbee = utils.replaceToZigbeeConvertersInArray( result.toZigbee, [tz.light_onoff_brightness, tz.light_colortemp, tz.light_color, tz.light_color_colortemp], @@ -130,8 +130,8 @@ function gledoptoLight(args?: LightArgs) { return result; } -function gledoptoOnOff(args?: OnOffArgs) { - const result = onOff({powerOnBehavior: false, ...args}); +function gledoptoOnOff(args?: m.OnOffArgs) { + const result = m.onOff({powerOnBehavior: false, ...args}); result.onEvent = async (type: OnEventType, data: KeyValue, device: Zh.Device) => { // This device doesn't support reporting. // Therefore we read the on/off state every 5 seconds. @@ -174,7 +174,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'GL-SD-003P', vendor: 'Gledopto', description: 'Zigbee DIN Rail triac AC dimmer', - extend: [light()], + extend: [m.light({configureReporting: true})], meta: {disableDefaultResponse: true}, }, { @@ -206,7 +206,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'GL-SD-001', vendor: 'Gledopto', description: 'Zigbee triac AC dimmer', - extend: [gledoptoLight({})], + extend: [gledoptoLight({configureReporting: true})], meta: {disableDefaultResponse: true}, }, { @@ -245,7 +245,7 @@ const definitions: DefinitionWithExtend[] = [ {vendor: 'Gledopto', model: 'GL-C-003P_1', description: 'Zigbee 2in1 LED Controller CCT/DIM (pro)'}, {vendor: 'Gledopto', model: 'GL-C-203P', description: 'Zigbee 2in1 LED Controller CCT/DIM (pro+)'}, ], - extend: [light({colorTemp: {range: [158, 500]}}), identify(), gledoptoConfigureReadModelID()], + extend: [m.light({colorTemp: {range: [158, 500]}}), m.identify(), gledoptoConfigureReadModelID()], }, { zigbeeModel: ['GL-G-003P'], @@ -357,8 +357,8 @@ const definitions: DefinitionWithExtend[] = [ description: 'Zigbee LED Controller RGBW (pro)', whiteLabel: [{vendor: 'Gledopto', model: 'GL-C-007P_mini', description: 'Zigbee LED Controller RGBW (pro) (mini)'}], extend: [ - light({colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}}), - identify(), + m.light({colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}}), + m.identify(), gledoptoConfigureReadModelID(), ], }, @@ -434,7 +434,7 @@ const definitions: DefinitionWithExtend[] = [ ota: true, description: 'Zigbee LED Controller RGB (pro)', // Supports color: https://github.com/Koenkk/zigbee2mqtt/issues/24091 - extend: [light({color: {modes: ['xy', 'hs'], enhancedHue: true}}), identify(), gledoptoConfigureReadModelID()], + extend: [m.light({color: {modes: ['xy', 'hs'], enhancedHue: true}}), m.identify(), gledoptoConfigureReadModelID()], }, { zigbeeModel: ['GL-C-008P'], @@ -453,8 +453,8 @@ const definitions: DefinitionWithExtend[] = [ {vendor: 'Gledopto', model: 'GL-C-301P', description: 'Zigbee 5in1 LED Controller (pro+) (ultra-mini)'}, ], extend: [ - light({colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}}), - identify(), + m.light({colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}}), + m.identify(), gledoptoConfigureReadModelID(), ], meta: {disableDefaultResponse: true}, @@ -484,7 +484,7 @@ const definitions: DefinitionWithExtend[] = [ ota: true, description: 'Zigbee LED Controller W (pro)', whiteLabel: [{vendor: 'Gledopto', model: 'GL-C-009P_mini', description: 'Zigbee LED Controller W (pro) (mini)'}], - extend: [light(), identify(), gledoptoConfigureReadModelID()], + extend: [m.light(), m.identify(), gledoptoConfigureReadModelID()], }, { zigbeeModel: ['GL-C-009S'], @@ -649,7 +649,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'GL-C-103P', vendor: 'Gledopto', description: 'Zigbee LED controller (pro)', - extend: [light({colorTemp: {range: [158, 495]}, color: true})], + extend: [m.light({colorTemp: {range: [158, 495]}, color: true})], }, { zigbeeModel: ['GL-G-004P'], @@ -799,7 +799,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Gledopto', ota: true, description: 'Zigbee 6W Downlight RGB+CCT (pro)', - extend: [light({colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}}), identify()], + extend: [m.light({colorTemp: {range: [158, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}}), m.identify()], }, { zigbeeModel: ['GL-D-006P'], @@ -881,7 +881,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'GL-SD-001P', vendor: 'Gledopto', description: 'Triac-dimmer', - extend: [light()], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['GL-FL-005TZS'], @@ -1012,7 +1012,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'GL-C-310P', vendor: 'Gledopto', description: 'Zigbee relay switch', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/gmmts.ts b/src/devices/gmmts.ts index 403a1e9fc0f2b..b80c8c2bf9c73 100644 --- a/src/devices/gmmts.ts +++ b/src/devices/gmmts.ts @@ -1983,7 +1983,6 @@ const definitions: DefinitionWithExtend[] = [ exposes: (device, options) => { let endpoint: Zh.Endpoint; const exposes: Expose[] = []; - exposes.push(e.linkquality()); let currentContract: string = ''; let currentElec: string = ''; diff --git a/src/devices/gmy.ts b/src/devices/gmy.ts index f248b3f706c46..59e859caaae33 100644 --- a/src/devices/gmy.ts +++ b/src/devices/gmy.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'B07KG5KF5R', vendor: 'GMY Smart Bulb', description: 'GMY Smart bulb, 470lm, vintage dimmable, 2700-6500k, E27', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, ]; diff --git a/src/devices/gs.ts b/src/devices/gs.ts index 5974200c4af9d..bc3e6a8e2eb85 100644 --- a/src/devices/gs.ts +++ b/src/devices/gs.ts @@ -1,15 +1,4 @@ -import { - battery, - electricityMeter, - humidity, - iasWarning, - iasZoneAlarm, - identify, - ignoreClusterReport, - light, - onOff, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -18,35 +7,35 @@ const definitions: DefinitionWithExtend[] = [ model: 'BRHM8E27W70-I1', vendor: 'GS', description: 'Smart color light bulb', - extend: [light({colorTemp: {range: undefined}, color: true}), identify()], + extend: [m.light({colorTemp: {range: undefined}, color: true}), m.identify()], }, { zigbeeModel: ['BDHM8E27W70-I1'], model: 'BDHM8E27W70-I1', vendor: 'GS', description: 'Smart light bulb', - extend: [light({colorTemp: {range: [153, 370]}}), identify()], + extend: [m.light({colorTemp: {range: [153, 370]}}), m.identify()], }, { zigbeeModel: ['SGMHM-I1'], model: 'SGMHM-I1', vendor: 'GS', description: 'Methane gas sensor', - extend: [iasZoneAlarm({zoneType: 'gas', zoneAttributes: ['alarm_2']})], + extend: [m.iasZoneAlarm({zoneType: 'gas', zoneAttributes: ['alarm_2']})], }, { zigbeeModel: ['SGPHM-I1'], model: 'SGPHM-I1', vendor: 'GS', description: 'Propane gas sensor', - extend: [iasZoneAlarm({zoneType: 'gas', zoneAttributes: ['alarm_2']})], + extend: [m.iasZoneAlarm({zoneType: 'gas', zoneAttributes: ['alarm_2']})], }, { zigbeeModel: ['SKHMP30-I1'], model: 'SKHMP30-I1', vendor: 'GS', description: 'Smart socket', - extend: [onOff({powerOnBehavior: false}), electricityMeter(), identify()], + extend: [m.onOff({powerOnBehavior: false}), m.electricityMeter(), m.identify()], }, { zigbeeModel: ['SMHM-I1'], @@ -54,8 +43,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'GS', description: 'Motion sensor', extend: [ - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), - battery({voltageToPercentage: {min: 2500, max: 3000}, voltage: true}), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({voltageToPercentage: {min: 2500, max: 3000}, voltage: true}), ], }, { @@ -63,7 +52,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SOHM-I1', vendor: 'GS', description: 'Open and close sensor', - extend: [iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), battery({voltage: true})], + extend: [m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), m.battery({voltage: true})], }, { zigbeeModel: ['SRHMP-I1'], @@ -71,28 +60,28 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'GS', description: 'Siren', meta: {disableDefaultResponse: true}, - extend: [ignoreClusterReport({cluster: 'genBasic'}), iasWarning(), battery()], + extend: [m.ignoreClusterReport({cluster: 'genBasic'}), m.iasWarning(), m.battery()], }, { zigbeeModel: ['SSHM-I1'], model: 'SSHM-I1', vendor: 'GS', description: 'Smoke detector', - extend: [iasZoneAlarm({zoneType: 'smoke', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), battery()], + extend: [m.iasZoneAlarm({zoneType: 'smoke', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), m.battery()], }, { zigbeeModel: ['STHM-I1H'], model: 'STHM-I1H', vendor: 'GS', description: 'Temperature and humidity sensor', - extend: [temperature(), humidity(), battery({voltageToPercentage: {min: 2500, max: 3000}, voltage: true})], + extend: [m.temperature(), m.humidity(), m.battery({voltageToPercentage: {min: 2500, max: 3000}, voltage: true})], }, { zigbeeModel: ['SWHM-I1'], model: 'SWHM-I1', vendor: 'GS', description: 'Water leakage sensor', - extend: [iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), battery({voltage: true})], + extend: [m.iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), m.battery({voltage: true})], }, ]; diff --git a/src/devices/gumax.ts b/src/devices/gumax.ts index dcf09193dcaaa..763e4d2fb3348 100644 --- a/src/devices/gumax.ts +++ b/src/devices/gumax.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LST103', vendor: 'Gumax', description: 'Gumax lighting system', - extend: [light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], }, ]; diff --git a/src/devices/halemeier.ts b/src/devices/halemeier.ts index 0abe524130e45..577a18bf6d62f 100644 --- a/src/devices/halemeier.ts +++ b/src/devices/halemeier.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {battery, identify, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -14,21 +14,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'HA-ZM12/24-1K', vendor: 'Halemeier', description: '1-channel smart receiver', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['HA-ZM12/24-mw2'], model: 'HA-ZM12/24-mw2', vendor: 'Halemeier', description: 'MultiWhite 1-channel smart receiver 12V', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, { zigbeeModel: ['HA-ZGMW2-E'], model: 'HA-ZGMW2-E', vendor: 'Halemeier', description: 'LED driver', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, { zigbeeModel: ['HA-ZSM-MW2'], @@ -84,7 +84,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HA-ZX1', vendor: 'Halemeier', description: 'X-Mitter smart remote control', - extend: [battery(), identify()], + extend: [m.battery(), m.identify()], fromZigbee: [fz.command_off, fz.command_on, fz.command_stop, fz.command_move], exposes: [e.action(['recall_*', 'on', 'off', 'brightness_move_up', 'brightness_move_down'])], }, diff --git a/src/devices/hampton_bay.ts b/src/devices/hampton_bay.ts index fe95b22f33736..a0a21464754aa 100644 --- a/src/devices/hampton_bay.ts +++ b/src/devices/hampton_bay.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {forcePowerSource, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -17,7 +17,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [tz.fan_mode], exposes: [e.fan().withModes(['low', 'medium', 'high', 'on', 'smart'])], meta: {disableDefaultResponse: true}, - extend: [light({configureReporting: true}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.light({configureReporting: true}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['hvacFanCtrl']); @@ -29,7 +29,7 @@ const definitions: DefinitionWithExtend[] = [ model: '54668161', vendor: 'Hampton Bay', description: '12 in. LED smart puff', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, ]; diff --git a/src/devices/heatit.ts b/src/devices/heatit.ts index 6350c908f27a9..d6c90f8bc10fd 100644 --- a/src/devices/heatit.ts +++ b/src/devices/heatit.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '1444420', vendor: 'Heatit', description: 'Zig Dim 250W', - extend: [light({configureReporting: true, powerOnBehavior: false})], + extend: [m.light({configureReporting: true, powerOnBehavior: false})], }, ]; diff --git a/src/devices/heiman.ts b/src/devices/heiman.ts index 849782b428c3c..f5527470b9e57 100644 --- a/src/devices/heiman.ts +++ b/src/devices/heiman.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {battery, iasZoneAlarm, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend, Reporting, Zh} from '../lib/types'; @@ -16,20 +16,18 @@ const definitions: DefinitionWithExtend[] = [ model: 'HS1MIS-3.0', vendor: 'HEIMAN', description: 'Smart occupancy sensor', - fromZigbee: [fz.occupancy, fz.battery, fz.illuminance], - toZigbee: [], - exposes: [e.occupancy(), e.battery(), e.illuminance()], + fromZigbee: [fz.occupancy, fz.battery], + exposes: [e.occupancy(), e.battery()], configure: async (device, cordinatorEndpoint) => { const endpoint1 = device.getEndpoint(1); await reporting.bind(endpoint1, cordinatorEndpoint, ['msOccupancySensing', 'genPowerCfg']); await reporting.batteryPercentageRemaining(endpoint1); await reporting.occupancy(endpoint1); - await reporting.bind(endpoint1, cordinatorEndpoint, ['msIlluminanceMeasurement']); - await reporting.illuminance(endpoint1); }, + extend: [m.illuminance()], }, { - fingerprint: [{modelID: 'TS0212', manufacturerName: '_TYZB01_wpmo3ja3'}], + fingerprint: tuya.fingerprint('TS0212', ['_TYZB01_wpmo3ja3']), zigbeeModel: ['CO_V15', 'CO_YDLV10', 'CO_V16', '1ccaa94c49a84abaa9e38687913947ba', 'CO_CTPG'], model: 'HS1CA-M', description: 'Smart carbon monoxide sensor', @@ -289,10 +287,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.carbon_monoxide(), e.battery_low(), e.battery()], }, { - fingerprint: [ - {modelID: 'TS0216', manufacturerName: '_TYZB01_8scntis1'}, - {modelID: 'TS0216', manufacturerName: '_TYZB01_4obovpbi'}, - ], + fingerprint: tuya.fingerprint('TS0216', ['_TYZB01_8scntis1', '_TYZB01_4obovpbi']), zigbeeModel: ['WarningDevice', 'WarningDevice-EF-3.0'], model: 'HS2WD-E', vendor: 'HEIMAN', @@ -668,7 +663,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HS2WDS', vendor: 'HEIMAN', description: 'LED 9W CCT E27', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['CurtainMo-EF-3.0', 'CurtainMo-EF'], @@ -768,8 +763,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'HEIMAN', description: 'Motion sensor', extend: [ - battery({voltageToPercentage: {min: 2500, max: 3000}, voltage: true}), - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({voltageToPercentage: {min: 2500, max: 3000}, voltage: true}), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), ], }, ]; diff --git a/src/devices/heimgard_technologies.ts b/src/devices/heimgard_technologies.ts index 9fdbd170aaaf4..6f4c708d4bc00 100644 --- a/src/devices/heimgard_technologies.ts +++ b/src/devices/heimgard_technologies.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {battery} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -149,7 +149,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Indoor siren', toZigbee: [tz.warning], meta: {disableDefaultResponse: true}, - extend: [battery()], + extend: [m.battery()], exposes: [e.warning()], }, ]; diff --git a/src/devices/hej.ts b/src/devices/hej.ts index c35b3cd7cf28f..35f6ef84683a7 100644 --- a/src/devices/hej.ts +++ b/src/devices/hej.ts @@ -1,4 +1,4 @@ -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'GLSK3ZB-1711', vendor: 'Hej', description: 'Goqual 1 gang Switch', - extend: [onOff({configureReporting: false, powerOnBehavior: false})], + extend: [m.onOff({configureReporting: false, powerOnBehavior: false})], }, { zigbeeModel: ['HejSW02'], @@ -15,8 +15,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Hej', description: 'Goqual 2 gang Switch', extend: [ - deviceEndpoints({endpoints: {top: 1, bottom: 2}}), - onOff({configureReporting: false, endpointNames: ['top', 'bottom'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), + m.onOff({configureReporting: false, endpointNames: ['top', 'bottom'], powerOnBehavior: false}), ], }, { @@ -25,8 +25,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Hej', description: 'Goqual 3 gang Switch', extend: [ - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), - onOff({configureReporting: false, endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.onOff({configureReporting: false, endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), ], }, { @@ -35,8 +35,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Hej', description: 'Goqual 4 gang Switch', extend: [ - deviceEndpoints({endpoints: {top_left: 1, bottom_left: 2, top_right: 3, bottom_right: 4}}), - onOff({configureReporting: false, endpointNames: ['top_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top_left: 1, bottom_left: 2, top_right: 3, bottom_right: 4}}), + m.onOff({configureReporting: false, endpointNames: ['top_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), ], }, { @@ -45,8 +45,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Hej', description: 'Goqual 5 gang Switch', extend: [ - deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, bottom_right: 5}}), - onOff({ + m.deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, bottom_right: 5}}), + m.onOff({ configureReporting: false, endpointNames: ['top_left', 'center_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false, @@ -59,8 +59,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Hej', description: 'Goqual 6 gang Switch', extend: [ - deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, center_right: 5, bottom_right: 6}}), - onOff({ + m.deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, center_right: 5, bottom_right: 6}}), + m.onOff({ configureReporting: false, endpointNames: ['top_left', 'center_left', 'bottom_left', 'top_right', 'center_right', 'bottom_right'], powerOnBehavior: false, diff --git a/src/devices/hfh.ts b/src/devices/hfh.ts index 253b67c635d7e..f47061543ad68 100644 --- a/src/devices/hfh.ts +++ b/src/devices/hfh.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '303-0136', vendor: 'HFH Solutions', description: 'LED controller', - extend: [light({colorTemp: {range: [155, 495]}})], + extend: [m.light({colorTemp: {range: [155, 495]}})], }, ]; diff --git a/src/devices/hilux.ts b/src/devices/hilux.ts index 4a239e1e38b0d..a50a3db076a67 100644 --- a/src/devices/hilux.ts +++ b/src/devices/hilux.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'DZ8', vendor: 'Hilux', description: 'Spot 7W', - extend: [light({colorTemp: {range: [153, 370]}, powerOnBehavior: false})], + extend: [m.light({colorTemp: {range: [153, 370]}, powerOnBehavior: false})], }, { fingerprint: [{modelID: 'Dimmer-Switch-ZB3.0', manufacturerName: 'Hilux'}], model: 'D160-ZG', vendor: 'Hilux', description: 'Zigbee LED dimmer smart switch', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/hive.ts b/src/devices/hive.ts index 081feb7d1a49c..06c767997b615 100644 --- a/src/devices/hive.ts +++ b/src/devices/hive.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend} from '../lib/types'; @@ -15,7 +15,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'FWGU10Bulb02UK', vendor: 'Hive', description: 'GU10 warm white', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['MOT003'], @@ -63,35 +63,35 @@ const definitions: DefinitionWithExtend[] = [ model: 'HALIGHTDIMWWE27', vendor: 'Hive', description: 'Active smart bulb white LED (E27)', - extend: [light({powerOnBehavior: false})], + extend: [m.light({powerOnBehavior: false})], }, { zigbeeModel: ['FWCLBulb01UK'], model: 'HALIGHTDIMWWE14', vendor: 'Hive', description: 'Active smart bulb white LED (E14)', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['FWBulb02UK'], model: 'HALIGHTDIMWWB22', vendor: 'Hive', description: 'Active smart bulb white LED (B22)', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['TWBulb02UK'], model: 'HV-GSCXZB229B', vendor: 'Hive', description: 'Active light, warm to cool white (E27 & B22)', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['TWCLBulb01UK'], model: 'HV-CE14CXZB6', vendor: 'Hive', description: 'Active light, warm to cool white (E14)', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['SLP2', 'SLP2b', 'SLP2c'], @@ -115,21 +115,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'HV-GSCXZB269', vendor: 'Hive', description: 'Active light cool to warm white (E26) ', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['TWBulb01UK'], model: 'HV-GSCXZB279_HV-GSCXZB229_HV-GSCXZB229K', vendor: 'Hive', description: 'Active light, warm to cool white (E27 & B22)', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['TWGU10Bulb01UK'], model: 'HV-GUCXZB5', vendor: 'Hive', description: 'Active light, warm to cool white (GU10)', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['KEYPAD001'], diff --git a/src/devices/honyar.ts b/src/devices/honyar.ts index 0067c02ce709f..e83b089172dee 100644 --- a/src/devices/honyar.ts +++ b/src/devices/honyar.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -14,7 +14,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'U86K31ND6', vendor: 'Honyar', description: '3 gang switch ', - extend: [deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), onOff({endpointNames: ['left', 'center', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), m.onOff({endpointNames: ['left', 'center', 'right']})], }, { zigbeeModel: ['HY0043'], diff --git a/src/devices/hornbach.ts b/src/devices/hornbach.ts index 093fa9efbf4cd..9030b32540b60 100644 --- a/src/devices/hornbach.ts +++ b/src/devices/hornbach.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,91 +7,91 @@ const definitions: DefinitionWithExtend[] = [ model: '10011725', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED bulb RGB E27', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['VIYU_A60_806_RGBW_10454471'], model: '10454471', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED bulb RGBW E27', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['VIYU_C35_470_RGBW_10454467'], model: '10454467', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED candle RGB E14', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['VIYU_C35_470_RGBW_10297667'], model: '10297667', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED bulb RGB E14', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['VIYU-A60-806-CCT-10011723'], model: '10011723', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED bulb CCT E27', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['VIYU-C35-470-CCT-10011722'], model: '10011722', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED candle CCT E14', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['VIYU_GU10_350_RGBW_10297666'], model: '10297666', vendor: 'HORNBACH', description: 'FLAIR Viyu smart GU10 RGBW lamp', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['VIYU_GU10_350_RGBW_10454466'], model: '10454466', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED GU10 RGBW lamp', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['VIYU-GU10-350-CCT-10011724'], model: '10011724', vendor: 'HORNBACH', description: 'FLAIR Viyu smart GU10 CCT lamp', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['VIYU_A60_470_FI_D_CCT_10297665'], model: '10297665', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED bulb CCT E27 filament', - extend: [light({colorTemp: {range: [250, 454]}})], + extend: [m.light({colorTemp: {range: [250, 454]}})], }, { zigbeeModel: ['VIYU_A60_806_CCT_10454469'], model: '10454469', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED bulb CCT E27', - extend: [light({colorTemp: {range: [220, 500]}})], + extend: [m.light({colorTemp: {range: [220, 500]}})], }, { zigbeeModel: ['VIYU_C35_470_CCT_10454468'], model: '10454468', vendor: 'HORNBACH', description: 'FLAIR Viyu smart LED bulb CCT E27', - extend: [light({colorTemp: {range: [200, 454]}})], + extend: [m.light({colorTemp: {range: [200, 454]}})], }, { zigbeeModel: ['VIYU_GU10_350_CCT_10454470'], model: '10454470', vendor: 'HORNBACH', description: 'FLAIR Viyu smart GU10 CCT lamp', - extend: [light({colorTemp: {range: [200, 454]}})], + extend: [m.light({colorTemp: {range: [200, 454]}})], }, ]; diff --git a/src/devices/hzc_electric.ts b/src/devices/hzc_electric.ts index f48c1f22ed632..0acbaaaa56e35 100644 --- a/src/devices/hzc_electric.ts +++ b/src/devices/hzc_electric.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, electricityMeter, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -12,7 +12,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'D086-ZG', vendor: 'HZC Electric', description: 'Zigbee dual dimmer', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), light({endpointNames: ['l1', 'l2'], configureReporting: true})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.light({endpointNames: ['l1', 'l2'], configureReporting: true})], }, { zigbeeModel: ['TempAndHumSensor-ZB3.0'], @@ -42,16 +42,17 @@ const definitions: DefinitionWithExtend[] = [ model: 'S902M-ZG', vendor: 'HZC Electric', description: 'Motion sensor', - fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.illuminance], + fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery], toZigbee: [], - exposes: [e.occupancy(), e.battery_low(), e.battery(), e.illuminance(), e.tamper()], + exposes: [e.occupancy(), e.battery_low(), e.battery(), e.tamper()], + extend: [m.illuminance()], }, { fingerprint: [{type: 'Router', manufacturerName: 'Shyugj', modelID: 'Dimmer-Switch-ZB3.0'}], model: 'D077-ZG', vendor: 'HZC Electric', description: 'Zigbee dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['Meter-Dimmer-Switch-ZB3.0'], @@ -59,8 +60,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'HZC Electric', description: 'Rotary dimmer with screen', extend: [ - light({effect: false, configureReporting: true, powerOnBehavior: false}), - electricityMeter({voltage: false, current: false, configureReporting: true}), + m.light({effect: false, configureReporting: true, powerOnBehavior: false}), + m.electricityMeter({voltage: false, current: false, configureReporting: true}), ], meta: {}, }, diff --git a/src/devices/icasa.ts b/src/devices/icasa.ts index 5c6852146e76f..54c9d14c332bc 100644 --- a/src/devices/icasa.ts +++ b/src/devices/icasa.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -11,21 +11,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'ICZB-IW11D', vendor: 'iCasa', description: 'ZigBee AC dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ICZB-DC11'], model: 'ICZB-DC11', vendor: 'iCasa', description: 'ZigBee 12-36V DC LED dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ICZB-IW11SW'], model: 'ICZB-IW11SW', vendor: 'iCasa', description: 'Zigbee 3.0 AC switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['ICZB-KPD12'], @@ -110,21 +110,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'ICZB-B1FC60/B3FC64/B2FC95/B2FC125', vendor: 'iCasa', description: 'Zigbee 3.0 Filament Lamp 60/64/95/125 mm, 806 lumen, dimmable, clear', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['ICZB-R11D'], model: 'ICZB-R11D', vendor: 'iCasa', description: 'Zigbee AC dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ICZB-R12D'], model: 'ICZB-R12D', vendor: 'iCasa', description: 'Zigbee AC dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/idinio.ts b/src/devices/idinio.ts index 5616f9f00c9b5..8267849452eeb 100644 --- a/src/devices/idinio.ts +++ b/src/devices/idinio.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '0140302', vendor: 'Idinio', description: 'Zigbee LED foot dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/ihorn.ts b/src/devices/ihorn.ts index 8152e2e7fd66e..4f29b11f55ef7 100644 --- a/src/devices/ihorn.ts +++ b/src/devices/ihorn.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {battery, iasZoneAlarm} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -66,7 +66,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LH03121', vendor: 'iHORN', description: 'Door contact DNAKE SH-DM-S01', - extend: [iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']}), battery()], + extend: [m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']}), m.battery()], }, ]; diff --git a/src/devices/ikea.ts b/src/devices/ikea.ts index 403d27e832451..264f4aa765818 100644 --- a/src/devices/ikea.ts +++ b/src/devices/ikea.ts @@ -21,26 +21,7 @@ import { tradfriOccupancy, tradfriRequestedBrightness, } from '../lib/ikea'; -import { - battery, - bindCluster, - commandsLevelCtrl, - commandsOnOff, - commandsWindowCovering, - deviceAddCustomCluster, - deviceEndpoints, - electricityMeter, - humidity, - iasZoneAlarm, - identify, - illuminance, - linkQuality, - occupancy, - onOff, - pm25, - temperature, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -52,7 +33,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, white spectrum, globe, opal, 980 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: [ @@ -64,21 +45,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2109G6', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, color/white spectrum, globe, opal, 800/806/810 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: {modes: ['xy', 'hs']}}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: {modes: ['xy', 'hs']}}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm', 'TRADFRI bulb E26 WS clear 950lm', 'TRADFRI bulb E27 WS\uFFFDclear 950lm'], model: 'LED1546G12', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, white spectrum, globe, clear, 950 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], model: 'LED1623G12', vendor: 'IKEA', description: 'TRADFRI bulb E27, white, globe, opal, 1000 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: [ @@ -90,14 +71,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2103G5', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, warm white, globe, 806/810 lumen', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRIbulbE26WWglobeclear250lm'], model: 'LED2008G3', vendor: 'IKEA', description: 'TRADFRI bulb E26, warm white, globe, clear, 250 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: [ @@ -109,7 +90,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2102G3', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, warm white, globe, clear, 440/450/470 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: [ @@ -121,7 +102,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED1936G5', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, white spectrum, globe, opal, 440/450/470 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: [ @@ -133,14 +114,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2003G10', vendor: 'IKEA', description: 'TRADFRI bulb E26/27, white spectrum, globe, opal, 1055/1100/1160 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRIbulbE26WSglobeclear800lm', 'TRADFRIbulbE27WSglobeclear806lm', 'TRADFRIbulbE26WSglobeclear806lm'], model: 'LED2004G8', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, white spectrum, globe, clear, 800/806 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: [ @@ -153,56 +134,56 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED1937T5', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, white spectrum, T120 cylinder, opal, 450/470 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E27 WW clear 250lm', 'TRADFRI bulb E26 WW clear 250lm'], model: 'LED1842G3', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, warm white, globe, clear, 250 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRIbulbE27WWclear250lm', 'TRADFRIbulbE26WWclear250lm'], model: 'LED1934G3', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, warm white, globe, clear, 250 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E26 opal 1000lm', 'TRADFRI bulb E26 W opal 1000lm'], model: 'LED1622G12', vendor: 'IKEA', description: 'TRADFRI bulb E26, white, globe, opal, 1000 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E26 CWS 800lm', 'TRADFRI bulb E27 CWS 806lm', 'TRADFRI bulb E26 CWS 806lm', 'TRADFRI bulb E26 CWS 810lm'], model: 'LED1924G9', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, color/white spectrum, globe, opal, 800/806/810 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true, turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true, turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E27 WS opal 1000lm', 'TRADFRI bulb E26 WS opal 1000lm'], model: 'LED1732G11', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, white spectrum, globe, opal, 1000 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E27 WW 806lm', 'TRADFRI bulb E26 WW 806lm'], model: 'LED1836G9', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, warm white, globe, opal, 806 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E27 WS clear 806lm', 'TRADFRI bulb E26 WS clear 806lm'], model: 'LED1736G9', vendor: 'IKEA', description: 'TRADFRI bulb E26/E27, white spectrum, globe, clear, 806 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: [ @@ -214,21 +195,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2201G8', vendor: 'IKEA', description: 'TRADFRI bulb E26/27, white spectrum, globe, opal, 1055/1100/1160 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRIbulbPAR38WS900lm'], model: 'LED2006R9', vendor: 'IKEA', description: 'TRADFRI bulb E26, white spectrum, PAR38 downlight, clear, 900 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRIbulbB22WSglobeopal1055lm', 'TRADFRIbulbB22WSglobeopal1055lm'], model: 'LED2035G10', vendor: 'IKEA', description: 'TRADFRI bulb B22, white spectrum, globe, opal, 1055 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, // #endregion E26/E27/B22 { @@ -245,7 +226,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: {range: [153, 500], viaColor: true}, color: true}), // light is pure RGB (XY), advertise 2000K-6500K - identify(), + m.identify(), ], }, // #region E12/E14/E17 @@ -254,42 +235,42 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2107C4', vendor: 'IKEA', description: 'TRADFRI bulb E14, white spectrum, candle, opal, 470 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E14 WS opal 400lm', 'TRADFRI bulb E12 WS opal 400lm'], model: 'LED1536G5', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14, white spectrum, globe, opal, 400 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E14 WS 470lm', 'TRADFRI bulb E12 WS 450lm', 'TRADFRI bulb E17 WS 440lm', 'TRADFRI bulb E17 WS candle 440lm'], model: 'LED1835C6', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14/E17, white spectrum, candle, opal, 450/470/440 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E14 WS globe 470lm', 'TRADFRI bulb E12 WS globe 450lm'], model: 'LED2101G4', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14, white spectrum, globe, opal, 450/470 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E14 WS opal 600lm'], model: 'LED1733G7', vendor: 'IKEA', description: 'TRADFRI bulb E14, white spectrum, globe, opal, 600 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E14 W op/ch 400lm', 'TRADFRI bulb E12 W op/ch 400lm', 'TRADFRI bulb E17 W op/ch 400lm'], model: 'LED1649C5', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14/E17, white, candle, opal, 400 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: [ @@ -301,49 +282,49 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2002G5', vendor: 'IKEA', description: 'TRADFRI bulb E14/E12/E17, white spectrum, globe, clear, 440/470 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E12 WS opal 600lm', 'TRADFRI bulb E17 WS opal 600lm'], model: 'LED1738G7', vendor: 'IKEA', description: 'TRADFRI bulb E12/E17, white spectrum, globe, opal, 600 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E14 CWS 470lm', 'TRADFRI bulb E12 CWS 450lm', 'TRADFRI bulb E17 CWS 440lm'], model: 'LED1925G6', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14/E17, color/white spectrum, globe, opal, 440/450/470 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true, turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true, turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['TRADFRIbulbE14WWclear250lm', 'TRADFRIbulbE12WWclear250lm', 'TRADFRIbulbE17WWclear250lm'], model: 'LED1935C3', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14/E17, warm white, candle, clear, 250 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRIbulbE12WWcandleclear250lm'], model: 'LED2009C3', vendor: 'IKEA', description: 'TRADFRI bulb E12, warm white, candle, clear, 250 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRIbulbE14WScandleopal470lm', 'TRADFRIbulbE12WScandleopal450lm', 'TRADFRIbulbE17WScandleopal440lm'], model: 'LED1949C5', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14/E17, white spectrum, candle, opal, 450/470/440 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb E14 CWS globe 806lm', 'TRADFRI bulb E12 CWS globe 800lm', 'TRADFRI bulb E17 CWS globe 810lm'], model: 'LED2111G6', vendor: 'IKEA', description: 'TRADFRI bulb E12/E14/E17, color/white spectrum, globe, opal, 800/806/810 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: {modes: ['xy', 'hs']}}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: {modes: ['xy', 'hs']}}), m.identify()], }, // #endregion E12/E14/E17 // #region GU10 @@ -358,28 +339,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2104R3', vendor: 'IKEA', description: 'TRADFRI bulb GU10, warm white, 345/380 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRI bulb GU10 WS 400lm'], model: 'LED1537R6/LED1739R5', vendor: 'IKEA', description: 'TRADFRI bulb GU10, white spectrum, 400 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI bulb GU10 W 400lm'], model: 'LED1650R5', vendor: 'IKEA', description: 'TRADFRI bulb GU10, white, 400 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRI bulb GU10 WW 400lm'], model: 'LED1837R5', vendor: 'IKEA', description: 'TRADFRI bulb GU10, warm white, 400 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['TRADFRI bulb GU10 CWS 345lm', 'TRADFRI bulb GU10 CWS 380lm'], @@ -389,7 +370,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: {range: [153, 500], viaColor: true}, color: true}), // light is pure RGB (XY), advertise 2000K-6500K - identify(), + m.identify(), ], }, { @@ -403,7 +384,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LED2005R5/LED2106R3', vendor: 'IKEA', description: 'TRADFRI bulb GU10, white spectrum, 345/380 lm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, // #endregion GU10 // #region light panels @@ -412,119 +393,119 @@ const definitions: DefinitionWithExtend[] = [ model: 'T1820', vendor: 'IKEA', description: 'LEPTITER recessed spot light, white spectrum', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['STOFTMOLN ceiling/wall lamp WW37'], model: 'T2037', vendor: 'IKEA', description: 'STOFTMOLN ceiling/wall lamp, warm white, 37 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['STOFTMOLN ceiling/wall lamp WW24'], model: 'T2035', vendor: 'IKEA', description: 'STOFTMOLN ceiling/wall lamp, warm white, 24 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['STOFTMOLN ceiling/wall lamp WW10'], model: 'T2105', vendor: 'IKEA', description: 'STOFTMOLN ceiling/wall lamp, warm white, 10 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['STOFTMOLN ceiling/wall lamp WW15'], model: 'T2106', vendor: 'IKEA', description: 'STOFTMOLN ceiling/wall lamp, warm white, 15 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['JETSTROM 40100'], model: 'L2208', vendor: 'IKEA', description: 'JETSTROM ceiling light panel, white spectrum, 100x40 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['JETSTROM 6060'], model: 'L2207', vendor: 'IKEA', description: 'JETSTROM ceiling light panel, white spectrum, 60x60 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['JETSTROM 3030 wall'], model: 'L2205', vendor: 'IKEA', description: 'JETSTROM wall light panel, color/white spectrum, 30x30 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true}), m.identify()], }, { zigbeeModel: ['JETSTROM 3030 ceiling'], model: 'L2206', vendor: 'IKEA', description: 'JETSTROM ceiling light panel, color/white spectrum, 30x30 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true}), m.identify()], }, { zigbeeModel: ['JORMLIEN door WS 40x80'], model: 'L1530', vendor: 'IKEA', description: 'JORMLIEN door light panel, white spectrum, 40x80 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['FLOALT panel WS 30x30'], model: 'L1527', vendor: 'IKEA', description: 'FLOALT light panel, white spectrum, 30x30 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['FLOALT panel WS 60x60'], model: 'L1529', vendor: 'IKEA', description: 'FLOALT light panel, white spectrum, 60x60 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['FLOALT panel WS 30x90'], model: 'L1528', vendor: 'IKEA', description: 'FLOALT light panel, white spectrum, 30x90 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['SURTE door WS 38x64'], model: 'L1531', vendor: 'IKEA', description: 'SURTE door light panel, white spectrum, 38x64 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['GUNNARP panel round'], model: 'T1828', vendor: 'IKEA', description: 'GUNNARP light panel, round', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['GUNNARP panel 40*40'], model: 'T1829', vendor: 'IKEA', description: 'GUNNARP light panel, 40x40 cm', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['TRADFRI Light Engine'], model: 'T2011', vendor: 'IKEA', description: 'OSVALLA panel round', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, // #endregion light panels // #region other lights @@ -533,49 +514,49 @@ const definitions: DefinitionWithExtend[] = [ model: '90504044', vendor: 'IKEA', description: 'NYMANE pendant lamp', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()], }, { zigbeeModel: ['Pendant lamp WW'], model: 'T2030', vendor: 'IKEA', description: 'PILSKOTT pendant lamp, warm white', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['Floor lamp WW'], model: 'G2015', vendor: 'IKEA', description: 'PILSKOTT floor lamp, warm white', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight(), m.identify()], }, { zigbeeModel: ['ORMANAS LED Strip'], model: 'L2112', vendor: 'IKEA', description: 'ORMANAS LED strip', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true, color: true}), m.identify()], }, { zigbeeModel: ['TRADFRI transformer 10W', 'TRADFRI Driver 10W'], model: 'ICPSHC24-10EU-IL-1/ICPSHC24-10EU-IL-2', vendor: 'IKEA', description: 'TRADFRI LED driver, 10 w', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['TRADFRI transformer 30W', 'TRADFRI Driver 30W'], model: 'ICPSHC24-30EU-IL-1/ICPSHC24-10EU-IL-2', vendor: 'IKEA', description: 'TRADFRI LED driver, 30 w', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), m.identify()], }, { zigbeeModel: ['SILVERGLANS IP44 LED driver'], model: 'ICPSHC24-30-IL44-1', vendor: 'IKEA', description: 'SILVERGLANS LED driver, 30 w, IP44', - extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({turnsOffAtBrightness1: true}), m.identify()], }, // #endregion other lights // #endregion light @@ -585,7 +566,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E1603/E1702/E1708', vendor: 'IKEA', description: 'TRADFRI control outlet', - extend: [addCustomClusterManuSpecificIkeaUnknown(), onOff(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), m.onOff(), m.identify()], ota: true, }, { @@ -593,7 +574,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E1836', vendor: 'IKEA', description: 'ASKVADER on/off switch', - extend: [addCustomClusterManuSpecificIkeaUnknown(), onOff(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), m.onOff(), m.identify()], ota: true, }, { @@ -601,7 +582,12 @@ const definitions: DefinitionWithExtend[] = [ model: 'E1842', vendor: 'IKEA', description: 'KNYCKLAN electronic dishwasher shut-off unit', - extend: [addCustomClusterManuSpecificIkeaUnknown(), onOff(), iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1']}), identify()], + extend: [ + addCustomClusterManuSpecificIkeaUnknown(), + m.onOff(), + m.iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1']}), + m.identify(), + ], ota: true, }, { @@ -609,7 +595,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E2204', vendor: 'IKEA', description: 'TRETAKT smart plug', - extend: [addCustomClusterManuSpecificIkeaUnknown(), onOff(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), m.onOff(), m.identify()], ota: true, }, { @@ -617,7 +603,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E2206', vendor: 'IKEA', description: 'INSPELNING smart plug', - extend: [addCustomClusterManuSpecificIkeaUnknown(), onOff(), identify(), electricityMeter()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), m.onOff(), m.identify(), m.electricityMeter()], ota: true, configure: async (device) => { const endpoint = device.getEndpoint(1); @@ -638,8 +624,8 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureGenPollCtrl(), - windowCovering({controls: ['lift']}), - identify(), + m.windowCovering({controls: ['lift']}), + m.identify(), ikeaBattery(), ], ota: true, @@ -652,8 +638,8 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureGenPollCtrl(), - windowCovering({controls: ['lift']}), - identify(), + m.windowCovering({controls: ['lift']}), + m.identify(), ikeaBattery(), ], ota: true, @@ -666,8 +652,8 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureGenPollCtrl(), - windowCovering({controls: ['lift']}), - identify(), + m.windowCovering({controls: ['lift']}), + m.identify(), ikeaBattery(), ], ota: true, @@ -680,8 +666,8 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureGenPollCtrl(), - windowCovering({controls: ['lift']}), - identify(), + m.windowCovering({controls: ['lift']}), + m.identify(), ikeaBattery(), ], ota: true, @@ -696,7 +682,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [ {vendor: 'IKEA', model: 'E2006', description: 'STARKVIND air purifier table', fingerprint: [{modelID: 'STARKVIND Air purifier table'}]}, ], - extend: [addCustomClusterManuSpecificIkeaUnknown(), addCustomClusterManuSpecificIkeaAirPurifier(), ikeaAirPurifier(), identify()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), addCustomClusterManuSpecificIkeaAirPurifier(), ikeaAirPurifier(), m.identify()], ota: true, }, { @@ -704,7 +690,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E1746', vendor: 'IKEA', description: 'TRADFRI signal repeater', - extend: [addCustomClusterManuSpecificIkeaUnknown(), identify(), linkQuality({reporting: true})], + extend: [addCustomClusterManuSpecificIkeaUnknown(), m.identify(), m.linkQuality({reporting: true})], ota: true, }, // #endregion appliances @@ -716,11 +702,11 @@ const definitions: DefinitionWithExtend[] = [ description: 'TRADFRI wireless dimmer', extend: [ addCustomClusterManuSpecificIkeaUnknown(), - identify({isSleepy: true}), - commandsLevelCtrl({ + m.identify({isSleepy: true}), + m.commandsLevelCtrl({ commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop', 'brightness_move_to_level'], }), - battery({dontDividePercentage: true}), + m.battery({dontDividePercentage: true}), ], ota: true, }, @@ -732,7 +718,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureRemote(), - identify({isSleepy: true}), + m.identify({isSleepy: true}), tradfriCommandsOnOff(), tradfriCommandsLevelCtrl(), ikeaArrowClick(), @@ -748,10 +734,10 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureStyrbar(), - identify({isSleepy: true}), + m.identify({isSleepy: true}), styrbarCommandOn(), - commandsOnOff({commands: ['off'], bind: false}), - commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop'], bind: false}), + m.commandsOnOff({commands: ['off'], bind: false}), + m.commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop'], bind: false}), ikeaArrowClick({styrbar: true, bind: false}), ikeaBattery(), ], @@ -766,9 +752,9 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureRemote(), - identify({isSleepy: true}), - commandsOnOff({commands: ['on', 'off']}), - commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop']}), + m.identify({isSleepy: true}), + m.commandsOnOff({commands: ['on', 'off']}), + m.commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop']}), ikeaBattery(), ], ota: true, @@ -782,8 +768,8 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), ikeaConfigureRemote(), - identify({isSleepy: true}), - commandsOnOff({commands: ['on', 'off']}), + m.identify({isSleepy: true}), + m.commandsOnOff({commands: ['on', 'off']}), ikeaBattery(), ], ota: true, @@ -796,9 +782,9 @@ const definitions: DefinitionWithExtend[] = [ meta: {disableActionGroup: true}, extend: [ addCustomClusterManuSpecificIkeaUnknown(), - identify({isSleepy: true}), - commandsOnOff({commands: ['on', 'off']}), - commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_stop']}), + m.identify({isSleepy: true}), + m.commandsOnOff({commands: ['on', 'off']}), + m.commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_stop']}), ikeaBattery(), ], ota: true, @@ -809,9 +795,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'IKEA', description: 'SYMFONISK sound remote, gen 1', extend: [ - identify({isSleepy: true}), - commandsOnOff({commands: ['toggle']}), - commandsLevelCtrl({ + m.identify({isSleepy: true}), + m.commandsOnOff({commands: ['toggle']}), + m.commandsLevelCtrl({ commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop', 'brightness_step_up', 'brightness_step_down'], }), ikeaBattery(), @@ -823,7 +809,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E1766', vendor: 'IKEA', description: 'TRADFRI open/close remote', - extend: [ikeaConfigureRemote(), identify({isSleepy: true}), commandsWindowCovering(), ikeaBattery()], + extend: [ikeaConfigureRemote(), m.identify({isSleepy: true}), m.commandsWindowCovering(), ikeaBattery()], ota: true, }, { @@ -832,13 +818,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'IKEA', description: 'SYMFONISK sound remote, gen 2', extend: [ - bindCluster({cluster: 'genPollCtrl', clusterType: 'input'}), - deviceEndpoints({endpoints: {'1': 2, '2': 3}}), - identify({isSleepy: true}), - commandsOnOff({commands: ['toggle']}), + m.bindCluster({cluster: 'genPollCtrl', clusterType: 'input'}), + m.deviceEndpoints({endpoints: {'1': 2, '2': 3}}), + m.identify({isSleepy: true}), + m.commandsOnOff({commands: ['toggle']}), ikeaMediaCommands(), ikeaDotsClick({endpointNames: ['1', '2'], dotsPrefix: true}), - battery({voltage: true}), + m.battery({voltage: true}), ], ota: true, }, @@ -849,11 +835,11 @@ const definitions: DefinitionWithExtend[] = [ description: 'RODRET wireless dimmer/power switch', extend: [ addCustomClusterManuSpecificIkeaUnknown(), - bindCluster({cluster: 'genPollCtrl', clusterType: 'input'}), - identify({isSleepy: true}), - commandsOnOff({commands: ['on', 'off']}), - commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop']}), - battery(), + m.bindCluster({cluster: 'genPollCtrl', clusterType: 'input'}), + m.identify({isSleepy: true}), + m.commandsOnOff({commands: ['on', 'off']}), + m.commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop']}), + m.battery(), ], ota: true, }, @@ -864,11 +850,11 @@ const definitions: DefinitionWithExtend[] = [ description: 'SOMRIG shortcut button', extend: [ addCustomClusterManuSpecificIkeaUnknown(), - bindCluster({cluster: 'genPollCtrl', clusterType: 'input'}), - deviceEndpoints({endpoints: {'1': 1, '2': 2}}), - identify({isSleepy: true}), + m.bindCluster({cluster: 'genPollCtrl', clusterType: 'input'}), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2}}), + m.identify({isSleepy: true}), ikeaDotsClick({endpointNames: ['1', '2']}), - battery(), + m.battery(), ], ota: true, }, @@ -883,7 +869,7 @@ const definitions: DefinitionWithExtend[] = [ addCustomClusterManuSpecificIkeaUnknown(), tradfriOccupancy(), tradfriRequestedBrightness(), - identify({isSleepy: true}), + m.identify({isSleepy: true}), ikeaBattery(), ], ota: true, @@ -896,7 +882,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ addCustomClusterManuSpecificIkeaUnknown(), addCustomClusterManuSpecificIkeaVocIndexMeasurement(), - deviceAddCustomCluster('pm25Measurement', { + m.deviceAddCustomCluster('pm25Measurement', { ID: 0x042a, attributes: { measuredValue: {ID: 0x0000, type: Zcl.DataType.SINGLE_PREC}, @@ -904,11 +890,11 @@ const definitions: DefinitionWithExtend[] = [ commands: {}, commandsResponse: {}, }), - temperature(), - humidity(), - pm25({reporting: {min: '1_MINUTE', max: '2_MINUTES', change: 2}}), + m.temperature(), + m.humidity(), + m.pm25({reporting: {min: '1_MINUTE', max: '2_MINUTES', change: 2}}), ikeaVoc(), - identify(), + m.identify(), ], ota: true, }, @@ -917,7 +903,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E2134', vendor: 'IKEA', description: 'VALLHORN wireless motion sensor', - extend: [addCustomClusterManuSpecificIkeaUnknown(), occupancy(), illuminance(), identify({isSleepy: true}), battery()], + extend: [addCustomClusterManuSpecificIkeaUnknown(), m.occupancy(), m.illuminance(), m.identify({isSleepy: true}), m.battery()], ota: true, }, { @@ -927,16 +913,16 @@ const definitions: DefinitionWithExtend[] = [ description: 'PARASOLL door/window sensor', extend: [ addCustomClusterManuSpecificIkeaUnknown(), - deviceEndpoints({endpoints: {'1': 1, '2': 2}}), - bindCluster({cluster: 'ssIasZone', clusterType: 'input', endpointNames: ['2']}), - iasZoneAlarm({ + m.deviceEndpoints({endpoints: {'1': 1, '2': 2}}), + m.bindCluster({cluster: 'ssIasZone', clusterType: 'input', endpointNames: ['2']}), + m.iasZoneAlarm({ zoneType: 'contact', zoneAttributes: ['alarm_1'], // This is required to prevent the device's reported state being stuck after it quickly changed back and forth: zoneStatusReporting: true, }), - identify({isSleepy: true}), - battery(), + m.identify({isSleepy: true}), + m.battery(), ], ota: true, }, @@ -947,15 +933,15 @@ const definitions: DefinitionWithExtend[] = [ description: 'BADRING water leakage sensor', extend: [ addCustomClusterManuSpecificIkeaUnknown(), - bindCluster({cluster: 'ssIasZone', clusterType: 'input'}), - iasZoneAlarm({ + m.bindCluster({cluster: 'ssIasZone', clusterType: 'input'}), + m.iasZoneAlarm({ zoneType: 'water_leak', zoneAttributes: ['alarm_1'], // This is required to prevent the device's reported state being stuck after it quickly changed back and forth: zoneStatusReporting: true, }), - identify({isSleepy: true}), - battery(), + m.identify({isSleepy: true}), + m.battery(), ], ota: true, }, diff --git a/src/devices/ilightsin.ts b/src/devices/ilightsin.ts index 120c709320c96..1d881b585cb5d 100644 --- a/src/devices/ilightsin.ts +++ b/src/devices/ilightsin.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HLC610', vendor: 'iLightsIn', description: '1-10V dimming LED controller', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/iluminize.ts b/src/devices/iluminize.ts index 9704a347fbb2f..2fa2794cd95eb 100644 --- a/src/devices/iluminize.ts +++ b/src/devices/iluminize.ts @@ -1,17 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import { - battery, - commandsColorCtrl, - commandsLevelCtrl, - commandsOnOff, - commandsScenes, - deviceEndpoints, - identify, - light, - onOff, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -23,42 +13,42 @@ const definitions: DefinitionWithExtend[] = [ model: '5144.01', vendor: 'Iluminize', description: 'RGB CCT 3 in 1 Remote Controller', - extend: [battery(), identify(), commandsOnOff(), commandsLevelCtrl(), commandsColorCtrl()], + extend: [m.battery(), m.identify(), m.commandsOnOff(), m.commandsLevelCtrl(), m.commandsColorCtrl()], }, { zigbeeModel: ['ZGRC-KEY-001'], model: '5144.11', vendor: 'Iluminize', description: 'Zigbee 3.0 wall dimmer with switches', - extend: [battery(), identify(), commandsOnOff(), commandsLevelCtrl()], + extend: [m.battery(), m.identify(), m.commandsOnOff(), m.commandsLevelCtrl()], }, { zigbeeModel: ['ZGRC-KEY-002'], model: '5144.21', vendor: 'Iluminize', description: 'Single color wall mounted push button remote', - extend: [battery(), identify(), commandsOnOff(), commandsLevelCtrl(), commandsColorCtrl()], + extend: [m.battery(), m.identify(), m.commandsOnOff(), m.commandsLevelCtrl(), m.commandsColorCtrl()], }, { zigbeeModel: ['5121.10'], model: '5121.10', vendor: 'Iluminize', description: 'Rotary dimmer with integrated Zigbee 3.0 dimming actuator', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['5120.2210'], model: '5120.2210', vendor: 'Iluminize', description: 'Zigbee 3.0 actuator mini 1x 230V', - extend: [onOff()], + extend: [m.onOff()], }, { fingerprint: [{modelID: '511.050'}, {modelID: 'RGBWW Lighting', manufacturerName: 'Iluminize'}], model: '511.050', vendor: 'Iluminize', description: 'Zigbee 3.0 LED controller for 5in1 RGB+CCT LEDs', - extend: [light({colorTemp: {range: [155, 450]}, color: true})], + extend: [m.light({colorTemp: {range: [155, 450]}, color: true})], }, { fingerprint: [ @@ -68,77 +58,84 @@ const definitions: DefinitionWithExtend[] = [ model: '511.10', vendor: 'Iluminize', description: 'Zigbee LED-Controller', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['511.201'], model: '511.201', vendor: 'Iluminize', description: 'ZigBee 3.0 dimming actuator mini 1x 230V', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], + }, + { + zigbeeModel: ['511.020'], + model: '511.020', + vendor: 'iluminize', + description: 'Zigbee 3.0 LED controller multi 4 - 5A, CCT WW/CW LED', + extend: [m.light({colorTemp: {range: [155, 450]}})], }, { zigbeeModel: ['5120.1100'], model: '5120.1100', vendor: 'Iluminize', description: 'ZigBee 3.0 dimming actuator mini 1x 230V', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['5120.1110'], model: '5120.1110', vendor: 'Iluminize', description: 'ZigBee 3.0 dimming actuator mini 1x 230V', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['5120.2110'], model: '5120.2110', vendor: 'Iluminize', description: 'ZigBee 3.0 dimming actuator mini 1x 230V', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['5123.1110'], model: '5123.1110', vendor: 'Iluminize', description: 'Zigbee 3.0 controller with adjustable current 250-1500mA, max. 50W / 48V SELV', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['511.010'], model: '511.010', vendor: 'Iluminize', description: 'Zigbee LED-Controller', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['511.012'], model: '511.012', vendor: 'Iluminize', description: 'Zigbee LED-Controller', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['511.202'], model: '511.202', vendor: 'Iluminize', description: 'Zigbee 3.0 switch mini 1x230V, 200W/400W', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['5120.1200'], model: '5120.1200', vendor: 'Iluminize', description: 'Zigbee 3.0 switch mini 1x230V with neutral, 200W/400W', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['5120.1210'], model: '5120.1210', vendor: 'Iluminize', description: 'Zigbee 3.0 switch mini 1x230V without neutral, 200W/400W', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['5128.10'], @@ -164,14 +161,14 @@ const definitions: DefinitionWithExtend[] = [ model: '511.040', vendor: 'Iluminize', description: 'ZigBee 3.0 LED-controller, 4 channel 5A, RGBW LED', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['HK-ZD-RGB-A', '5110.40'], model: '5110.40', vendor: 'Iluminize', description: 'Zigbee 3.0 LED controller multi 5 - 4A,RGB W/CCT LED', - extend: [light({colorTemp: {range: [160, 450]}, color: true})], + extend: [m.light({colorTemp: {range: [160, 450]}, color: true})], }, { zigbeeModel: ['HK-ZD-RGBCCT-A', '511.000'], @@ -179,7 +176,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Iluminize', whiteLabel: [{vendor: 'Sunricher', model: 'HK-ZD-RGBCCT-A'}], description: 'Zigbee 3.0 universal LED-controller, 5 channel, RGBCCT LED', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['ZG2819S-RGBW'], @@ -187,13 +184,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Iluminize', description: 'Zigbee handheld remote RGBW 4 channels', extend: [ - deviceEndpoints({endpoints: {ep1: 1, ep2: 2, ep3: 3, ep4: 4}}), - battery(), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsColorCtrl(), - commandsScenes(), + m.deviceEndpoints({endpoints: {ep1: 1, ep2: 2, ep3: 3, ep4: 4}}), + m.battery(), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsColorCtrl(), + m.commandsScenes(), ], meta: {multiEndpoint: true}, }, @@ -285,7 +282,7 @@ const definitions: DefinitionWithExtend[] = [ model: '5112.80', vendor: 'Iluminize', description: 'Zigbee 3.0 LED-controller 1x 8A', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZGRC-TEUR-001'], diff --git a/src/devices/ilux.ts b/src/devices/ilux.ts index ed89bfde6fe74..71535d4ee351b 100644 --- a/src/devices/ilux.ts +++ b/src/devices/ilux.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '900008-WW', vendor: 'ilux', description: 'Dimmable A60 E27 LED Bulb', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/imhotepcreation.ts b/src/devices/imhotepcreation.ts index 3b7edf22c4593..1b7a1946127a9 100644 --- a/src/devices/imhotepcreation.ts +++ b/src/devices/imhotepcreation.ts @@ -38,9 +38,7 @@ const definitions: DefinitionWithExtend[] = [ tz.thermostat_setpoint_raise_lower, ], exposes: [ - e.enum('system_mode', ea.ALL, ['off', 'heat']).withDescription('Heater mode (Off or Heat)'), - e.local_temperature(), - e.climate().withSetpoint('occupied_heating_setpoint', 5, 30, 0.5, ea.ALL).withLocalTemperature(), + e.climate().withSystemMode(['off', 'heat']).withLocalTemperature().withSetpoint('occupied_heating_setpoint', 5, 30, 0.5, ea.ALL), e .numeric('min_heat_setpoint_limit', ea.ALL) .withUnit('°C') @@ -122,17 +120,8 @@ const definitions: DefinitionWithExtend[] = [ const endpoint = device?.getEndpoint(i); if (endpoint !== undefined) { const epName = `l${i}`; - features.push( - e - .enum('system mode', ea.ALL, ['off', 'cool', 'heat']) - .withProperty('system_mode') - .withEndpoint(epName) - .withDescription('Thermostat ' + i + ' mode (Off, Heating or Cooling)'), - ); - features.push(e.local_temperature().withEndpoint(epName)); - features.push( - e.climate().withSetpoint('occupied_heating_setpoint', 5, 30, 0.5, ea.ALL).withEndpoint(epName).withLocalTemperature(), - ); + features.push(e.climate().withSystemMode(['off', 'cool', 'heat']).withLocalTemperature().withEndpoint(epName)); + features.push(e.climate().withSetpoint('occupied_heating_setpoint', 5, 30, 0.5, ea.ALL).withEndpoint(epName)); features.push( e .numeric('min_heat_setpoint_limit', ea.ALL) @@ -178,8 +167,6 @@ const definitions: DefinitionWithExtend[] = [ } } - features.push(e.linkquality()); - return features; }, configure: async (device, coordinatorEndpoint) => { diff --git a/src/devices/immax.ts b/src/devices/immax.ts index 46364e81cb968..2a032c54d1030 100644 --- a/src/devices/immax.ts +++ b/src/devices/immax.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -56,49 +56,49 @@ const definitions: DefinitionWithExtend[] = [ model: '07089L', vendor: 'Immax', description: 'NEO SMART LED E27 5W', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['E27-filament-Dim-ZB3.0'], model: '07088L', vendor: 'Immax', description: 'Neo SMART LED filament E27 6.3W warm white, dimmable, Zigbee 3.0', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['IM-Z3.0-DIM'], model: '07001L/07005B', vendor: 'Immax', description: 'Neo SMART LED E14 5W warm white, dimmable, Zigbee 3.0', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['IM-Z3.0-RGBW'], model: '07004D/07005L', vendor: 'Immax', description: 'Neo SMART LED E27/E14 color, dimmable, Zigbee 3.0', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['IM-Z3.0-RGBCCT'], model: '07008L', vendor: 'Immax', description: 'Neo SMART LED strip RGB + CCT, color, dimmable, Zigbee 3.0', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { - fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_pwauw3g2'}], + fingerprint: tuya.fingerprint('TS0505B', ['_TZ3210_pwauw3g2']), model: '07743L', vendor: 'Immax', description: 'Neo Smart LED E27 11W RGB + CCT, color, dimmable, Zigbee 3.0', extend: [tuya.modernExtend.tuyaLight({colorTemp: {range: [153, 500]}, color: true})], }, { - fingerprint: [{modelID: 'TS0502C', manufacturerName: '_TZ3210_6pwpez2j'}], + fingerprint: tuya.fingerprint('TS0502C', ['_TZ3210_6pwpez2j']), model: 'TS0502C', vendor: 'Immax', description: 'Neo FINO Smart pendant light black 80cm CCT 60W, Zigbee 3.0', - extend: [light({colorTemp: {range: [153, 500]}})], + extend: [m.light({colorTemp: {range: [153, 500]}})], }, { zigbeeModel: ['Keyfob-ZB3.0'], @@ -138,7 +138,7 @@ const definitions: DefinitionWithExtend[] = [ }, { zigbeeModel: ['losfena'], - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_wlosfena'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_wlosfena']), model: '07703L', vendor: 'Immax', description: 'Radiator valve', @@ -176,24 +176,24 @@ const definitions: DefinitionWithExtend[] = [ model: '07115L', vendor: 'Immax', description: 'Neo SMART LED E27 9W RGB + CCT, dimmable, Zigbee 3.0', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['4in1-Sensor-ZB3.0'], model: '07047L', vendor: 'Immax', description: 'Intelligent motion sensor', - fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.temperature, fz.illuminance, fz.humidity, fz.ignore_iaszone_report], + fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.temperature, fz.humidity, fz.ignore_iaszone_report], toZigbee: [], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - const binds = ['msTemperatureMeasurement', 'msRelativeHumidity', 'msIlluminanceMeasurement']; + const binds = ['msTemperatureMeasurement', 'msRelativeHumidity']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.temperature(endpoint); await reporting.humidity(endpoint); - await reporting.illuminance(endpoint); }, - exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery(), e.temperature(), e.illuminance(), e.humidity()], + exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery(), e.temperature(), e.humidity()], + extend: [m.illuminance()], }, { zigbeeModel: ['ColorTemperature'], @@ -201,27 +201,26 @@ const definitions: DefinitionWithExtend[] = [ model: '07073L', vendor: 'Immax', description: 'Neo CANTO/HIPODROMO SMART, color temp, dimmable, Zigbee 3.0', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['IM-Z3.0-CCT'], model: '07042L', vendor: 'Immax', description: 'Neo RECUADRO SMART, color temp, dimmable, Zigbee 3.0', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { fingerprint: tuya.fingerprint('TS0202', ['_TZ3210_jijr1sss', '_TZ3210_m3mxv66l']), model: '07502L', vendor: 'Immax', description: '4 in 1 multi sensor', - fromZigbee: [fz.battery, fz.ignore_basic_report, fz.illuminance, legacy.fz.ZB003X, fz.ZB003X_attr, fz.ZB003X_occupancy], + fromZigbee: [fz.battery, fz.ignore_basic_report, legacy.fz.ZB003X, fz.ZB003X_attr, fz.ZB003X_occupancy], toZigbee: [legacy.tz.ZB003X], exposes: [ e.occupancy(), e.tamper(), e.battery(), - e.illuminance(), e.temperature(), e.humidity(), e.numeric('reporting_time', ea.STATE_SET).withDescription('Reporting interval in minutes').withValueMin(0).withValueMax(1440), @@ -234,6 +233,7 @@ const definitions: DefinitionWithExtend[] = [ e.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high']).withDescription('PIR sensor sensitivity'), e.enum('keep_time', ea.STATE_SET, ['0', '30', '60', '120', '240']).withDescription('PIR keep time in seconds'), ], + extend: [m.illuminance()], }, { fingerprint: tuya.fingerprint('TS0601', ['_TZE200_n9clpsht', '_TZE200_nyvavzbj', '_TZE200_moycceze']), @@ -254,7 +254,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_krwtzhfd'}], + fingerprint: tuya.fingerprint('TS004F', ['_TZ3000_krwtzhfd']), model: '07767L', vendor: 'Immax', description: 'NEO Smart outdoor button', diff --git a/src/devices/imou.ts b/src/devices/imou.ts index ec2ab59477150..ecd5eabf2dae9 100644 --- a/src/devices/imou.ts +++ b/src/devices/imou.ts @@ -1,4 +1,4 @@ -import {battery, forceDeviceType, iasWarning, iasZoneAlarm} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZP1-EN', vendor: 'IMOU', description: 'Zigbee ZP1 PIR motion sensor', - extend: [battery(), iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low'], alarmTimeout: true})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low'], alarmTimeout: true})], }, { zigbeeModel: ['ZR1-EN'], @@ -15,10 +15,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'IMOU', description: 'Zigbee ZR1 siren', extend: [ - battery(), - forceDeviceType({type: 'EndDevice'}), - iasWarning(), - iasZoneAlarm({zoneType: 'alarm', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery(), + m.forceDeviceType({type: 'EndDevice'}), + m.iasWarning(), + m.iasZoneAlarm({zoneType: 'alarm', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), ], meta: {disableDefaultResponse: true}, }, diff --git a/src/devices/innr.ts b/src/devices/innr.ts index 7d72bfc8e402d..eaa6f4c7dd7f6 100644 --- a/src/devices/innr.ts +++ b/src/devices/innr.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {electricityMeter, light, onOff, reconfigureReportingsOnDeviceAnnounce} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -48,14 +48,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'AE 262', vendor: 'Innr', description: 'Smart E26 LED bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RCL 240 T'], model: 'RCL 240 T', vendor: 'Innr', description: 'Smart round ceiling lamp comfort', - extend: [light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -63,14 +63,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'FL 142 C', vendor: 'Innr', description: 'Color Flex LED strip 4m 2000lm', - extend: [light({colorTemp: {range: [150, 500], startup: false}, color: {modes: ['xy', 'hs']}, powerOnBehavior: false})], + extend: [m.light({colorTemp: {range: [150, 500], startup: false}, color: {modes: ['xy', 'hs']}, powerOnBehavior: false})], }, { zigbeeModel: ['FL 140 C'], model: 'FL 140 C', vendor: 'Innr', description: 'Color Flex LED strip 4m 1200lm', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['FL 130 C'], @@ -78,7 +78,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'Color Flex LED strip', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, powerOnBehavior: false, @@ -92,7 +92,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'Color Flex LED strip', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, powerOnBehavior: false, @@ -105,7 +105,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'BF 263', vendor: 'Innr', description: 'B22 filament bulb dimmable', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -113,7 +113,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'OLS 210', vendor: 'Innr', description: 'Smart outdoor light string', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -121,7 +121,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'OGL 130 C', vendor: 'Innr', description: 'Outdoor smart globe lights', - extend: [light({colorTemp: {range: [100, 1000]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [100, 1000]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['OPL 130 C'], @@ -129,7 +129,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'Outdoor smart pedestal light colour', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555], startup: false}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true, @@ -141,14 +141,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 185 C', vendor: 'Innr', description: 'E27 bulb RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['BY 185 C'], model: 'BY 185 C', vendor: 'Innr', description: 'B22 bulb RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 250 C'], @@ -156,7 +156,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'E14 bulb RGBW', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: false, applyRedFix: true}, turnsOffAtBrightness1: true, @@ -169,7 +169,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'E14 bulb RGBW', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: false, applyRedFix: true}, turnsOffAtBrightness1: true, @@ -182,21 +182,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 262', vendor: 'Innr', description: 'E27 bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 265'], model: 'RB 265', vendor: 'Innr', description: 'E27 bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['BY 266'], model: 'BY 266', vendor: 'Innr', description: 'B22 (Bayonet) bulb, dimmable', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, endpoint: (device) => { return {default: 1}; @@ -207,7 +207,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 266', vendor: 'Innr', description: 'E27 bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, endpoint: (device) => { return {default: 1}; @@ -218,7 +218,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 267', vendor: 'Innr', description: 'E27 smart bulb white 1100', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, endpoint: (device) => { return {default: 1}; @@ -229,7 +229,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RF 262', vendor: 'Innr', description: 'E27 smart filament LED light bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -237,7 +237,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RF 265', vendor: 'Innr', description: 'E27 bulb filament clear', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -245,7 +245,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'BF 265', vendor: 'Innr', description: 'B22 bulb filament clear', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -253,7 +253,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 272 T', vendor: 'Innr', description: 'Smart bulb tunable white E27', - extend: [light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -261,14 +261,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 278 T', vendor: 'Innr', description: 'Smart bulb tunable white E27', - extend: [light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 279 T'], model: 'RB 279 T', vendor: 'Innr', description: 'Smart bulb tunable white E27', - extend: [light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], ota: true, endpoint: (device) => { return {default: 1}; @@ -280,7 +280,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'E27 bulb RGBW', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: false, applyRedFix: true}, turnsOffAtBrightness1: true, @@ -292,7 +292,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 286 C', vendor: 'Innr', description: 'E27 bulb RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -300,14 +300,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'BY 285 C', vendor: 'Innr', description: 'B22 bulb RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['BY 286 C'], model: 'BY 286 C', vendor: 'Innr', description: 'B22 bulb RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -315,70 +315,70 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 165', vendor: 'Innr', description: 'E27 bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 162'], model: 'RB 162', vendor: 'Innr', description: 'E27 bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 172 W'], model: 'RB 172 W', vendor: 'Innr', description: 'ZigBee E27 retrofit bulb, warm dimmable 2200-2700K, 806 Lm', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 175 W'], model: 'RB 175 W', vendor: 'Innr', description: 'E27 bulb warm dimming', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 178 T'], model: 'RB 178 T', vendor: 'Innr', description: 'Smart bulb tunable white E27', - extend: [light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['BY 178 T'], model: 'BY 178 T', vendor: 'Innr', description: 'Smart bulb tunable white B22', - extend: [light({colorTemp: {range: [153, 555]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RS 122'], model: 'RS 122', vendor: 'Innr', description: 'GU10 spot', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RS 125'], model: 'RS 125', vendor: 'Innr', description: 'GU10 spot', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RS 225'], model: 'RS 225', vendor: 'Innr', description: 'GU10 Spot', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RS 226'], model: 'RS 226', vendor: 'Innr', description: 'GU10 Spot', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -386,7 +386,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RS 227 T', vendor: 'Innr', description: 'GU10 spot 420 lm, dimmable, white spectrum', - extend: [light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], ota: true, endpoint: (device) => { return {default: 1}; @@ -397,21 +397,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'RS 128 T', vendor: 'Innr', description: 'GU10 spot 350 lm, dimmable, white spectrum', - extend: [light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RS 228 T'], model: 'RS 228 T', vendor: 'Innr', description: 'GU10 spot 350 lm, dimmable, white spectrum', - extend: [light({colorTemp: {range: [200, 454]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [200, 454]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RS 229 T'], model: 'RS 229 T', vendor: 'Innr', description: 'GU10 spot 350 lm, dimmable, white spectrum', - extend: [light({colorTemp: {range: [200, 454]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [200, 454]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -420,7 +420,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'GU10 spot 350 lm, dimmable, RGBW', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: false, applyRedFix: true}, turnsOffAtBrightness1: true, @@ -434,7 +434,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'GU10 spot, dimmable, RGBW', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: false, applyRedFix: true}, turnsOffAtBrightness1: true, @@ -447,14 +447,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 145', vendor: 'Innr', description: 'E14 candle', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 245'], model: 'RB 245', vendor: 'Innr', description: 'E14 candle', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -462,7 +462,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 243', vendor: 'Innr', description: 'E14 candle', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -470,7 +470,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 248 T', vendor: 'Innr', description: 'E14 candle with white spectrum', - extend: [light({colorTemp: {range: [153, 555]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -478,7 +478,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 247 T', vendor: 'Innr', description: 'E14 candle, dimmable with, color temp', - extend: [light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -486,7 +486,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 249 T', vendor: 'Innr', description: 'E14 candle, dimmable with, color temp', - extend: [light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [200, 454]}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -494,14 +494,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'RB 148 T', vendor: 'Innr', description: 'E14 candle with white spectrum', - extend: [light({colorTemp: {range: [153, 555]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RF 261'], model: 'RF 261', vendor: 'Innr', description: 'E27 filament bulb dimmable', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -509,7 +509,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RF 263', vendor: 'Innr', description: 'E27 filament bulb dimmable', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -517,7 +517,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RF 264', vendor: 'Innr', description: 'E27 filament bulb dimmable', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], ota: true, }, { @@ -525,105 +525,105 @@ const definitions: DefinitionWithExtend[] = [ model: 'BY 165', vendor: 'Innr', description: 'B22 bulb dimmable', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RCL 110'], model: 'RCL 110', vendor: 'Innr', description: 'Round ceiling light', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RSL 110'], model: 'RSL 110', vendor: 'Innr', description: 'Recessed spot light', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RSL 115'], model: 'RSL 115', vendor: 'Innr', description: 'Recessed spot light', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['PL 110'], model: 'PL 110', vendor: 'Innr', description: 'Puck Light', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['PL 115'], model: 'PL 115', vendor: 'Innr', description: 'Puck Light', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['ST 110'], model: 'ST 110', vendor: 'Innr', description: 'Strip Light', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['UC 110'], model: 'UC 110', vendor: 'Innr', description: 'Under cabinet light', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['DL 110 N'], model: 'DL 110 N', vendor: 'Innr', description: 'Spot narrow', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['DL 110 W'], model: 'DL 110 W', vendor: 'Innr', description: 'Spot wide', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['SL 110 N'], model: 'SL 110 N', vendor: 'Innr', description: 'Spot Flex narrow', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['SL 110 M'], model: 'SL 110 M', vendor: 'Innr', description: 'Spot Flex medium', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['SL 110 W'], model: 'SL 110 W', vendor: 'Innr', description: 'Spot Flex wide', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['AE 260'], model: 'AE 260', vendor: 'Innr', description: 'E26/24 bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['AE 270 T'], model: 'AE 270 T', vendor: 'Innr', description: 'E26/24 bulb 1100lm, dimmable, white spectrum', - extend: [light({colorTemp: {range: [154, 500]}, turnsOffAtBrightness1: true, powerOnBehavior: false})], + extend: [m.light({colorTemp: {range: [154, 500]}, turnsOffAtBrightness1: true, powerOnBehavior: false})], ota: true, }, { @@ -631,14 +631,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'AE 270 T-2', vendor: 'Innr', description: 'E26/24 bulb 1100lm, dimmable, white spectrum', - extend: [light({colorTemp: {range: [154, 500]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [154, 500]}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['AE 280 C'], model: 'AE 280 C', vendor: 'Innr', description: 'E26 bulb RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], ota: true, }, { @@ -647,8 +647,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'Smart plug', extend: [ - onOff({powerOnBehavior: false}), - electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}}), + m.onOff({powerOnBehavior: false}), + m.electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}}), ], }, { @@ -656,21 +656,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP 110', vendor: 'Innr', description: 'Smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['SP 220'], model: 'SP 220', vendor: 'Innr', description: 'Smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['SP 222'], model: 'SP 222', vendor: 'Innr', description: 'Smart plug', - extend: [onOff()], + extend: [m.onOff()], ota: true, }, { @@ -678,7 +678,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP 224', vendor: 'Innr', description: 'Smart plug', - extend: [onOff()], + extend: [m.onOff()], ota: true, }, { @@ -686,7 +686,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP 234', vendor: 'Innr', description: 'Smart plug', - extend: [onOff(), electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}})], + extend: [m.onOff(), m.electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}})], ota: true, }, { @@ -694,28 +694,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'OSP 210', vendor: 'Innr', description: 'Outdoor smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['OFL 120 C'], model: 'OFL 120 C', vendor: 'Innr', description: 'Outdoor flex light colour LED strip 2m, 550lm, RGBW', - extend: [light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['OFL 140 C'], model: 'OFL 140 C', vendor: 'Innr', description: 'Outdoor flex light colour LED strip 4m, 1000lm, RGBW', - extend: [light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['OFL 142 C'], model: 'OFL 142 C', vendor: 'Innr', description: 'Outdoor flex light colour LED strip 4m, 1440lm, RGBW', - extend: [light({colorTemp: {range: [100, 350]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [100, 350]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RB 255 C'], @@ -723,7 +723,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'E14 mini bulb RGBW', extend: [ - light({ + m.light({ colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: false, applyRedFix: true}, turnsOffAtBrightness1: true, @@ -736,35 +736,35 @@ const definitions: DefinitionWithExtend[] = [ model: 'OFL 122 C', vendor: 'Innr', description: 'Outdoor flex light colour LED strip 2m, 1440lm, RGBW', - extend: [light({colorTemp: {range: [100, 350]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [100, 350]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['FL 122 C'], model: 'FL 122 C', vendor: 'Innr', description: 'Flex light colour LED strip 2m, 1440lm, RGBW', - extend: [light({colorTemp: {range: [100, 350]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [100, 350]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['OSL 130 C'], model: 'OSL 130 C', vendor: 'Innr', description: 'Outdoor smart spot colour, 230lm/spot, RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], applyRedFix: true}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['OSL 132 C'], model: 'OSL 132 C', vendor: 'Innr', description: 'Outdoor smart spot color', - extend: [light({colorTemp: {range: [100, 1000]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + extend: [m.light({colorTemp: {range: [100, 1000]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], }, { zigbeeModel: ['BE 220'], model: 'BE 220', vendor: 'Innr', description: 'E26/E24 white bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RC 110'], @@ -791,7 +791,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP 240', vendor: 'Innr', description: 'Smart plug', - extend: [onOff(), electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}})], + extend: [m.onOff(), m.electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}})], ota: true, }, { @@ -800,11 +800,11 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Innr', description: 'Smart plug', extend: [ - onOff(), - electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}}), + m.onOff(), + m.electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}}), // Device looses reporting config on power cycle // https://github.com/Koenkk/zigbee-herdsman-converters/issues/6747 - reconfigureReportingsOnDeviceAnnounce(), + m.reconfigureReportingsOnDeviceAnnounce(), ], ota: true, }, @@ -813,7 +813,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP 244', vendor: 'Innr', description: 'Smart plug', - extend: [onOff(), electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}})], + extend: [m.onOff(), m.electricityMeter({current: {divisor: 1000}, voltage: {divisor: 1}, power: {divisor: 1}, energy: {divisor: 100}})], ota: true, }, { @@ -821,21 +821,29 @@ const definitions: DefinitionWithExtend[] = [ model: 'AE 264', vendor: 'Innr', description: 'Smart E26 LED bulb', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RF 271 T'], model: 'RF 271 T', vendor: 'Innr', description: 'Smart E27 filament LED globe light bulb', - extend: [light({colorTemp: {range: [153, 556]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 556]}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['RF 273 T'], model: 'RF 273 T', vendor: 'Innr', description: 'Smart E27 filament LED light bulb', - extend: [light({colorTemp: {range: [153, 556]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 556]}, turnsOffAtBrightness1: true})], + }, + { + zigbeeModel: ['RF 274 T'], + model: 'RF 274 T', + vendor: 'innr', + description: 'Smart filament bulb E27 tunable edison', + extend: [m.light({colorTemp: {range: [153, 556]}})], + ota: true, }, ]; diff --git a/src/devices/inovelli.ts b/src/devices/inovelli.ts index 62635f3fd2c3d..cf73dd52bac39 100644 --- a/src/devices/inovelli.ts +++ b/src/devices/inovelli.ts @@ -3,7 +3,7 @@ import {Zcl} from 'zigbee-herdsman'; import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceAddCustomCluster, deviceEndpoints, electricityMeter, humidity, identify, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend, Expose, Fz, Tz, Zh} from '../lib/types'; @@ -69,7 +69,7 @@ const individualLedEffects: {[key: string]: number} = { const inovelliExtend = { addCustomClusterInovelli: () => - deviceAddCustomCluster('manuSpecificInovelli', { + m.deviceAddCustomCluster('manuSpecificInovelli', { ID: 64561, manufacturerCode: 0x122f, attributes: { @@ -1978,16 +1978,16 @@ const definitions: DefinitionWithExtend[] = [ model: 'VZM30-SN', vendor: 'Inovelli', description: 'On/off switch', - exposes: exposesListVZM30.concat(identify().exposes as Expose[]), + exposes: exposesListVZM30.concat(m.identify().exposes as Expose[]), extend: [ - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}, multiEndpointSkip: ['state', 'voltage', 'power', 'current', 'energy', 'brightness', 'temperature', 'humidity'], }), inovelliExtend.addCustomClusterInovelli(), - temperature(), - humidity(), - electricityMeter(), + m.temperature(), + m.humidity(), + m.electricityMeter(), ], toZigbee: [ tzLocal.light_onoff_brightness_inovelli, @@ -2016,14 +2016,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'VZM31-SN', vendor: 'Inovelli', description: '2-in-1 switch + dimmer', - exposes: exposesListVZM31.concat(identify().exposes as Expose[]), + exposes: exposesListVZM31.concat(m.identify().exposes as Expose[]), extend: [ - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {'1': 1, '2': 2, '3': 3}, multiEndpointSkip: ['state', 'power', 'energy', 'brightness'], }), inovelliExtend.addCustomClusterInovelli(), - electricityMeter({ + m.electricityMeter({ current: false, voltage: false, power: {min: 15, max: 3600, change: 1}, @@ -2068,7 +2068,7 @@ const definitions: DefinitionWithExtend[] = [ tzLocal.inovelli_parameters_readOnly(VZM35_ATTRIBUTES), tzLocal.breezeMode, ], - exposes: exposesListVZM35.concat(identify().exposes as Expose[]), + exposes: exposesListVZM35.concat(m.identify().exposes as Expose[]), extend: [inovelliExtend.addCustomClusterInovelli()], ota: true, configure: async (device, coordinatorEndpoint) => { @@ -2094,7 +2094,7 @@ const definitions: DefinitionWithExtend[] = [ tzLocal.inovelli_parameters_readOnly(VZM36_ATTRIBUTES), tzLocal.vzm36_breezeMode, ], - exposes: exposesListVZM36.concat(identify().exposes as Expose[]), + exposes: exposesListVZM36.concat(m.identify().exposes as Expose[]), extend: [inovelliExtend.addCustomClusterInovelli()], ota: true, // The configure method below is needed to make the device reports on/off state changes diff --git a/src/devices/iolloi.ts b/src/devices/iolloi.ts index 8405f9c717167..8aeff1ee28326 100644 --- a/src/devices/iolloi.ts +++ b/src/devices/iolloi.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ID-UK21FW09', vendor: 'Iolloi', description: 'Zigbee LED smart dimmer switch', - extend: [light({effect: false, configureReporting: true})], + extend: [m.light({effect: false, configureReporting: true})], whiteLabel: [{vendor: 'Iolloi', model: 'ID-EU20FW09'}], }, ]; diff --git a/src/devices/iotperfect.ts b/src/devices/iotperfect.ts index ab118f8d2cc62..95e28ca7536cd 100644 --- a/src/devices/iotperfect.ts +++ b/src/devices/iotperfect.ts @@ -1,6 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -8,12 +9,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_vrjkcam9'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_d0ypnbvn'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_v5xjyphj'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_d0ypnbvn'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_vrjkcam9', '_TZE200_d0ypnbvn', '_TZE204_v5xjyphj', '_TZE204_d0ypnbvn']), model: 'PF-PM02D-TYZ', vendor: 'IOTPerfect', description: 'Smart water/gas valve', diff --git a/src/devices/iris.ts b/src/devices/iris.ts index fe763dcd83b83..e3ea4103fdc05 100644 --- a/src/devices/iris.ts +++ b/src/devices/iris.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {forcePowerSource, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -152,7 +152,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'iL03_1', vendor: 'Iris', description: 'Smart plug', - extend: [onOff(), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff(), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['3315-L'], diff --git a/src/devices/istar.ts b/src/devices/istar.ts index 047e685b384df..06b523cfb865f 100644 --- a/src/devices/istar.ts +++ b/src/devices/istar.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'SCCV2401-1', vendor: 'iStar', description: 'Zigbee 3.0 LED controller, dimmable white 12-36V DC max. 5A', - extend: [light({turnsOffAtBrightness1: true})], + extend: [m.light({turnsOffAtBrightness1: true})], }, { zigbeeModel: ['iStar CCT Light'], model: 'SCCV2403-2', vendor: 'iStar', description: 'Zigbee 3.0 LED controller, dimmable white spectrum', - extend: [light({colorTemp: {range: [153, 370]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, turnsOffAtBrightness1: true})], }, ]; diff --git a/src/devices/jasco.ts b/src/devices/jasco.ts index e3ee2a506d4ef..9a4fe7185993b 100644 --- a/src/devices/jasco.ts +++ b/src/devices/jasco.ts @@ -1,5 +1,5 @@ import fz from '../converters/fromZigbee'; -import {electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -8,14 +8,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB3102', vendor: 'Jasco Products', description: 'Zigbee plug-in smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['43132'], model: '43132', vendor: 'Jasco', description: 'Zigbee smart outlet', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['43095'], @@ -23,7 +23,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Jasco Products', description: 'Zigbee smart plug-in switch with energy metering', fromZigbee: [fz.command_on_state, fz.command_off_state], - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, ]; diff --git a/src/devices/javis.ts b/src/devices/javis.ts index f829b8200c8bf..3e2d3a7934927 100644 --- a/src/devices/javis.ts +++ b/src/devices/javis.ts @@ -1,6 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -22,11 +23,7 @@ const definitions: DefinitionWithExtend[] = [ }, { zigbeeModel: ['JAVISSENSOR'], - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_lgstepha'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_kagkgk0i'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_i0b1dbqu'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_lgstepha', '_TZE200_kagkgk0i', '_TZE200_i0b1dbqu']), model: 'JS-MC-SENSOR-ZB', vendor: 'JAVIS', description: 'Microwave sensor', diff --git a/src/devices/jiawen.ts b/src/devices/jiawen.ts index 5b3f23ca2b71e..1134464303eff 100644 --- a/src/devices/jiawen.ts +++ b/src/devices/jiawen.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'K2RGBW01', vendor: 'JIAWEN', description: 'Wireless Bulb E27 9W RGBW', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['FB56-ZBW02KU1.5'], model: 'JW-A04-CT', vendor: 'JIAWEN', description: 'LED strip light controller', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/jumitech.ts b/src/devices/jumitech.ts index 6dfbc19328c75..92adc7eb8df9b 100644 --- a/src/devices/jumitech.ts +++ b/src/devices/jumitech.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'J2182548', vendor: 'JUMITECH APS', description: 'ZigBee AC phase-cut dimmer single-line', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/klikaanklikuit.ts b/src/devices/klikaanklikuit.ts index 33f0c61ef0834..bb334e370e3a3 100644 --- a/src/devices/klikaanklikuit.ts +++ b/src/devices/klikaanklikuit.ts @@ -1,4 +1,4 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZCC-3500', vendor: 'KlikAanKlikUit', description: 'Zigbee socket switch', - extend: [onOff()], + extend: [m.onOff()], }, { fingerprint: [{modelID: 'Built-in Switch', manufacturerName: 'KlikAanKlikUit'}], model: 'ZCM-1800', vendor: 'KlikAanKlikUit', description: 'Zigbee switch module', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/kmpcil.ts b/src/devices/kmpcil.ts index 150e363f834e7..e1b505355cb01 100644 --- a/src/devices/kmpcil.ts +++ b/src/devices/kmpcil.ts @@ -4,6 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend, Fz, KeyValue, Publish} from '../lib/types'; @@ -84,9 +85,9 @@ const definitions: DefinitionWithExtend[] = [ model: 'KMPCIL_RES005', vendor: 'KMPCIL', description: 'Environment sensor', - exposes: [e.battery(), e.temperature(), e.humidity(), e.pressure(), e.illuminance().withAccess(ea.STATE_GET), e.occupancy(), e.switch()], - fromZigbee: [fz.battery, fz.temperature, fz.humidity, fz.pressure, fz.illuminance, fz.kmpcil_res005_occupancy, fz.kmpcil_res005_on_off], - toZigbee: [tz.kmpcil_res005_on_off, tz.illuminance], + exposes: [e.battery(), e.temperature(), e.humidity(), e.pressure(), e.occupancy(), e.switch()], + fromZigbee: [fz.battery, fz.temperature, fz.humidity, fz.pressure, fz.kmpcil_res005_occupancy, fz.kmpcil_res005_on_off], + toZigbee: [tz.kmpcil_res005_on_off], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(8); const binds = [ @@ -94,7 +95,6 @@ const definitions: DefinitionWithExtend[] = [ 'msTemperatureMeasurement', 'msRelativeHumidity', 'msPressureMeasurement', - 'msIlluminanceMeasurement', 'genBinaryInput', 'genBinaryOutput', ]; @@ -110,10 +110,6 @@ const definitions: DefinitionWithExtend[] = [ }, ]; await endpoint.configureReporting('genPowerCfg', payloadBattery); - const payload = [ - {attribute: 'measuredValue', minimumReportInterval: 5, maximumReportInterval: constants.repInterval.HOUR, reportableChange: 200}, - ]; - await endpoint.configureReporting('msIlluminanceMeasurement', payload); const payloadPressure = [ { // 0 = measuredValue, override dataType from int16 to uint16 @@ -148,6 +144,7 @@ const definitions: DefinitionWithExtend[] = [ ]; await endpoint.configureReporting('genBinaryOutput', payloadBinaryOutput); }, + extend: [m.illuminance()], }, { zigbeeModel: ['tagv1'], diff --git a/src/devices/konke.ts b/src/devices/konke.ts index f4f94c477dd0f..a25a1113439c6 100644 --- a/src/devices/konke.ts +++ b/src/devices/konke.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -101,9 +101,10 @@ const definitions: DefinitionWithExtend[] = [ model: 'KK-ES-J01W', vendor: 'Konke', description: 'Temperature, relative humidity and illuminance sensor', - fromZigbee: [fz.battery, fz.illuminance, fz.humidity, fz.temperature], + fromZigbee: [fz.battery, fz.humidity, fz.temperature], toZigbee: [], - exposes: [e.battery(), e.battery_voltage(), e.illuminance(), e.humidity(), e.temperature()], + exposes: [e.battery(), e.battery_voltage(), e.humidity(), e.temperature()], + extend: [m.illuminance()], }, { zigbeeModel: ['3AFE241000040002'], @@ -147,28 +148,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'KK-LP-Q01D', vendor: 'Konke', description: 'Light years switch 1 gang', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['3AFE292000068622'], model: 'KK-LP-Q02D', vendor: 'Konke', description: 'Light years switch 2 gangs', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['3AFE292000068623'], model: 'KK-LP-Q03D', vendor: 'Konke', description: 'Light years switch 3 gangs', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), onOff({endpointNames: ['l1', 'l2', 'l3']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), m.onOff({endpointNames: ['l1', 'l2', 'l3']})], }, { zigbeeModel: ['3AFE2610010C0021'], model: 'KK-QD-Y01w', vendor: 'Konke', description: 'Spotlight driver (cw mode)', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, ]; diff --git a/src/devices/ksentry.ts b/src/devices/ksentry.ts index db4d0f535f717..8353078ab903e 100644 --- a/src/devices/ksentry.ts +++ b/src/devices/ksentry.ts @@ -1,4 +1,4 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'KS-SM001', vendor: 'Ksentry Electronics', description: 'Zigbee on/off controller', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, ]; diff --git a/src/devices/kurvia.ts b/src/devices/kurvia.ts index dcc6a2568afb7..276a720ae98ab 100644 --- a/src/devices/kurvia.ts +++ b/src/devices/kurvia.ts @@ -1,5 +1,5 @@ import tz from '../converters/toZigbee'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -8,7 +8,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-CL01', vendor: 'KURVIA', description: 'GU10 GRBWC built from AliExpress', - extend: [light({colorTemp: {range: [250, 454]}, color: {applyRedFix: true, enhancedHue: false}})], + extend: [m.light({colorTemp: {range: [250, 454]}, color: {applyRedFix: true, enhancedHue: false}})], toZigbee: [tz.on_off], }, ]; diff --git a/src/devices/lanesto.ts b/src/devices/lanesto.ts index 0c61fd087f4c7..81bd76dddb0a6 100644 --- a/src/devices/lanesto.ts +++ b/src/devices/lanesto.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '322054', vendor: 'Lanesto', description: 'Dimmable led driver', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/lds.ts b/src/devices/lds.ts index a2586f574d8a1..736f8d634c210 100644 --- a/src/devices/lds.ts +++ b/src/devices/lds.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZBT-RGBWLight-A0000', vendor: 'LDS', description: 'Ynoa smart LED E27', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, ]; diff --git a/src/devices/led_trading.ts b/src/devices/led_trading.ts index bdf48f8b50138..40a4cee1fb223 100644 --- a/src/devices/led_trading.ts +++ b/src/devices/led_trading.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -46,14 +46,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'HK-LN-DIM-A', vendor: 'LED-Trading', description: 'ZigBee AC phase-cut dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['HK-LN-SOCKET-A'], model: '9134', vendor: 'LED-Trading', description: 'Powerstrip with 4 sockets and USB', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5']})], }, { zigbeeModel: ['HK-ZCC-ZLL-A'], diff --git a/src/devices/ledvance.ts b/src/devices/ledvance.ts index 51d6782843bfe..d971ad7e5db3c 100644 --- a/src/devices/ledvance.ts +++ b/src/devices/ledvance.ts @@ -1,5 +1,5 @@ import {ledvanceLight, ledvanceOnOff} from '../lib/ledvance'; -import {electricityMeter, forcePowerSource, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -15,7 +15,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'AC26940/AC31266', vendor: 'LEDVANCE', description: 'Smart Zigbee outdoor plug', - extend: [ledvanceOnOff({powerOnBehavior: false}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [ledvanceOnOff({powerOnBehavior: false}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['Panel TW Z3'], @@ -43,14 +43,14 @@ const definitions: DefinitionWithExtend[] = [ model: '4099854295232', vendor: 'LEDVANCE', description: 'SMART+ indoor plug EU with energy meter ', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['PLUG COMPACT OUTDOOR EU EM T', 'PLUG COMPACT EU EM T'], model: '4099854293276', vendor: 'LEDVANCE', description: 'SMART+ Compact outdoor plug EU with energy meter', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['PL HCL300x1200 01'], diff --git a/src/devices/leedarson.ts b/src/devices/leedarson.ts index bd7d8d0ff65fa..22c92ea0c196e 100644 --- a/src/devices/leedarson.ts +++ b/src/devices/leedarson.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -12,56 +12,56 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZBT-DIMLight-GLS0800', vendor: 'Leedarson', description: 'LED E27 warm white', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZBT-CCTLight-GLS0904'], model: 'ZBT-CCTLight-GLS0904', vendor: 'Leedarson', description: 'LED E27 tunable white', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['ZBT-CCTLight-Candle0904'], model: 'ZBT-CCTLight-Candle0904', vendor: 'Leedarson', description: 'LED E14 tunable white', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['LED_GU10_OWDT'], model: 'ZM350STW1TCF', vendor: 'Leedarson', description: 'LED PAR16 50 GU10 tunable white', - extend: [light({colorTemp: {range: undefined, startup: false}})], + extend: [m.light({colorTemp: {range: undefined, startup: false}})], }, { zigbeeModel: ['M350ST-W1R-01', 'A470S-A7R-04'], model: 'M350STW1', vendor: 'Leedarson', description: 'LED PAR16 50 GU10', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['LED_E27_ORD'], model: 'A806S-Q1G', vendor: 'Leedarson', description: 'LED E27 color', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['ZHA-DimmableLight'], model: 'A806S-Q1R', vendor: 'Leedarson', description: 'LED E27 tunable white', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['LED_E27_OWDT'], model: 'ZA806SQ1TCF', vendor: 'Leedarson', description: 'LED E27 tunable white', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['ZBT-CCTSwitch-D0001'], @@ -96,25 +96,27 @@ const definitions: DefinitionWithExtend[] = [ model: '6xy-M350ST-W1Z', vendor: 'Leedarson', description: 'PAR16 tunable white', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { fingerprint: [{modelID: 'ZHA-PIRSensor', manufacturerName: 'Leedarson'}], model: '5AA-SS-ZA-H0', vendor: 'Leedarson', description: 'Motion sensor', - fromZigbee: [fz.occupancy, fz.illuminance, fz.ignore_occupancy_report], + fromZigbee: [fz.occupancy, fz.ignore_occupancy_report], toZigbee: [], - exposes: [e.occupancy(), e.illuminance()], + exposes: [e.occupancy()], + extend: [m.illuminance()], }, { zigbeeModel: ['ZB-SMART-PIRTH-V1'], model: '7A-SS-ZABC-H0', vendor: 'Leedarson', description: '4-in-1-Sensor', - fromZigbee: [fz.battery, fz.ias_occupancy_alarm_1, fz.illuminance, fz.temperature, fz.humidity, fz.ignore_occupancy_report], + fromZigbee: [fz.battery, fz.ias_occupancy_alarm_1, fz.temperature, fz.humidity, fz.ignore_occupancy_report], toZigbee: [], - exposes: [e.battery(), e.occupancy(), e.temperature(), e.illuminance(), e.humidity()], + exposes: [e.battery(), e.occupancy(), e.temperature(), e.humidity()], + extend: [m.illuminance()], }, { zigbeeModel: ['ZB-MotionSensor-S0000'], diff --git a/src/devices/legrand.ts b/src/devices/legrand.ts index e51f67e8aef89..781cc60c343f5 100644 --- a/src/devices/legrand.ts +++ b/src/devices/legrand.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import {eLegrand, fzLegrand, legrandOptions, readInitialBatteryState, tzLegrand} from '../lib/legrand'; -import {deviceEndpoints, electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -37,7 +37,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Legrand', description: 'DIN dry contactor module', whiteLabel: [{vendor: 'BTicino', model: 'FC80AC'}], - extend: [onOff()], + extend: [m.onOff()], ota: true, fromZigbee: [fz.identify, fz.electrical_measurement, fzLegrand.cluster_fc01, fz.ignore_basic_report, fz.ignore_genOta], toZigbee: [tz.legrand_device_mode, tzLegrand.identify, tz.electrical_measurement_power], @@ -66,7 +66,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Legrand', description: 'DIN contactor module', whiteLabel: [{vendor: 'BTicino', model: 'FC80CC'}], - extend: [onOff(), electricityMeter({cluster: 'electrical', voltage: false, current: false})], + extend: [m.onOff(), m.electricityMeter({cluster: 'electrical', voltage: false, current: false})], ota: true, fromZigbee: [fz.identify, fzLegrand.cluster_fc01, fz.ignore_basic_report, fz.ignore_genOta, fz.electrical_measurement], toZigbee: [tz.legrand_device_mode, tzLegrand.identify, tzLegrand.auto_mode, tz.electrical_measurement_power], @@ -88,7 +88,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Legrand', description: 'DIN smart relay for light control', whiteLabel: [{vendor: 'BTicino', model: 'FC80RC'}], - extend: [onOff()], + extend: [m.onOff()], ota: true, fromZigbee: [fz.identify, fz.electrical_measurement, fzLegrand.cluster_fc01, fz.ignore_basic_report, fz.ignore_genOta], toZigbee: [tz.legrand_device_mode, tzLegrand.identify, tz.electrical_measurement_power], @@ -158,7 +158,6 @@ const definitions: DefinitionWithExtend[] = [ eLegrand.ledInDark(), eLegrand.ledIfOn(), eLegrand.getCalibrationModes(false), - e.linkquality(), ]; }, configure: async (device, coordinatorEndpoint) => { @@ -230,7 +229,6 @@ const definitions: DefinitionWithExtend[] = [ eLegrand.ledInDark(), eLegrand.ledIfOn(), eLegrand.getCalibrationModes(true), - e.linkquality(), ]; }, configure: async (device, coordinatorEndpoint) => { @@ -313,7 +311,7 @@ const definitions: DefinitionWithExtend[] = [ eLegrand.ledIfOn(), ], extend: [ - light({ + m.light({ configureReporting: true, levelConfig: { disabledFeatures: [ @@ -346,7 +344,7 @@ const definitions: DefinitionWithExtend[] = [ eLegrand.ledInDark(), eLegrand.ledIfOn(), ], - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genIdentify', 'genBinaryInput', 'lightingBallastCfg']); @@ -393,7 +391,7 @@ const definitions: DefinitionWithExtend[] = [ {vendor: 'Legrand', description: 'Micromodule switch', model: '199142'}, {vendor: 'BTicino', description: 'Connected lighting micromodule', model: '3584C'}, ], - extend: [onOff()], + extend: [m.onOff()], ota: true, fromZigbee: [fz.identify], toZigbee: [tzLegrand.identify], @@ -613,7 +611,7 @@ const definitions: DefinitionWithExtend[] = [ eLegrand.ledInDark(), eLegrand.ledIfOn(), ], - extend: [deviceEndpoints({endpoints: {left: 2, right: 1}}), light({configureReporting: true, endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 2, right: 1}}), m.light({configureReporting: true, endpointNames: ['left', 'right']})], }, { zigbeeModel: [' Mobile outlet\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'], @@ -662,7 +660,7 @@ const definitions: DefinitionWithExtend[] = [ eLegrand.ledInDark(), eLegrand.ledIfOn(), ], - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genIdentify', 'genBinaryInput', 'lightingBallastCfg']); diff --git a/src/devices/lellki.ts b/src/devices/lellki.ts index 055a9d48f9ed9..facfc64ac35d3 100644 --- a/src/devices/lellki.ts +++ b/src/devices/lellki.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -11,11 +11,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS011F', manufacturerName: '_TZ3000_air9m6af'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_9djocypn'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_bppxj3sf'}, - ], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_air9m6af', '_TZ3000_9djocypn', '_TZ3000_bppxj3sf']), zigbeeModel: ['JZ-ZB-005', 'E220-KR5N0Z0-HA', 'E220-KR5N0Z0-HA'], model: 'WP33-EU/WP34-EU', vendor: 'LELLKI', @@ -25,8 +21,8 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.power_on_behavior()], configure: tuya.configureMagicPacket, extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), - onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5'], powerOnBehavior: false}), ], }, { @@ -45,24 +41,24 @@ const definitions: DefinitionWithExtend[] = [ model: 'JZ-ZB-003', vendor: 'LELLKI', description: '3 gang switch', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), onOff({endpointNames: ['l1', 'l2', 'l3']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), m.onOff({endpointNames: ['l1', 'l2', 'l3']})], }, { zigbeeModel: ['JZ-ZB-002'], model: 'JZ-ZB-002', vendor: 'LELLKI', description: '2 gang touch switch', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_twqctvna'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_twqctvna']), model: 'CM001', vendor: 'LELLKI', description: 'Circuit switch', - extend: [onOff()], + extend: [m.onOff()], }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_z6fgd73r'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_z6fgd73r']), model: 'XF-EU-S100-1-M', description: 'Touch switch 1 gang (with power monitoring)', vendor: 'LELLKI', @@ -78,7 +74,7 @@ const definitions: DefinitionWithExtend[] = [ onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options), }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_0yxeawjt'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_0yxeawjt']), model: 'WK34-EU', description: 'Power socket EU (with power monitoring)', vendor: 'LELLKI', @@ -95,7 +91,7 @@ const definitions: DefinitionWithExtend[] = [ onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options), }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_c7nc9w3c'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_c7nc9w3c']), model: 'WP30-EU', description: 'Power cord 4 sockets EU (with power monitoring)', vendor: 'LELLKI', diff --git a/src/devices/letsled.ts b/src/devices/letsled.ts index 05357036ba1cc..4538666486356 100644 --- a/src/devices/letsled.ts +++ b/src/devices/letsled.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HLC929-Z-RGBW-4C-IA-OTA-3.0', vendor: 'Letsleds', description: 'RGBW down light (color temp is inverted)', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, ]; diff --git a/src/devices/leviton.ts b/src/devices/leviton.ts index 7e291912e73e6..585b7b30651a7 100644 --- a/src/devices/leviton.ts +++ b/src/devices/leviton.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -29,35 +29,35 @@ const definitions: DefinitionWithExtend[] = [ model: 'DL15S-1BZ', vendor: 'Leviton', description: 'Lumina RF 15A switch, 120/277V', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['DG6HD'], model: 'DG6HD-1BW', vendor: 'Leviton', description: 'Zigbee in-wall smart dimmer', - extend: [light({effect: false, configureReporting: true})], + extend: [m.light({effect: false, configureReporting: true})], }, { zigbeeModel: ['DG3HL'], model: 'DG3HL-1BW', vendor: 'Leviton', description: 'Indoor Decora smart Zigbee 3.0 certified plug-in dimmer', - extend: [light({effect: false, configureReporting: true})], + extend: [m.light({effect: false, configureReporting: true})], }, { zigbeeModel: ['DG15A'], model: 'DG15A-1BW', vendor: 'Leviton', description: 'Indoor Decora smart Zigbee 3.0 certified plug-in outlet', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['DG15S'], model: 'DG15S-1BW', vendor: 'Leviton', description: 'Decora smart Zigbee 3.0 certified 15A switch', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['65A01-1'], @@ -114,7 +114,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Leviton', description: 'Wall switch, 0-10V dimmer, 120-277V, Lumina™ RF', meta: {disableDefaultResponse: true}, - extend: [light({effect: false, configureReporting: true})], + extend: [m.light({effect: false, configureReporting: true})], fromZigbee: [fzLocal.on_off_via_brightness, fz.lighting_ballast_configuration], toZigbee: [tz.ballast_config], exposes: [ diff --git a/src/devices/lg.ts b/src/devices/lg.ts index 299f097747e4e..10ace71b8023d 100644 --- a/src/devices/lg.ts +++ b/src/devices/lg.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,21 +7,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'B1027EB0Z01', vendor: 'LG Electronics', description: 'Smart bulb 1', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['B1027EB0Z02'], model: 'B1027EB0Z02', vendor: 'LG Electronics', description: 'Smart bulb 2', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['B1027EB4Z01'], model: 'B1027EB4Z01', vendor: 'LG Electronics', description: 'Smart bulb 3', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/lidl.ts b/src/devices/lidl.ts index 06f266f3c0a53..14e5a134cca01 100644 --- a/src/devices/lidl.ts +++ b/src/devices/lidl.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {battery, iasZoneAlarm} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import * as tuya from '../lib/tuya'; @@ -248,7 +248,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Lidl', 'HG08673-BS', 'Silvercrest smart plug with power monitoring (BS)', ['_TZ3000_3uimvkn6'])], }, { - fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_rco1yzb1'}], + fingerprint: tuya.fingerprint('TS004F', ['_TZ3000_rco1yzb1']), model: 'HG08164', vendor: 'Lidl', description: 'Silvercrest smart button', @@ -271,7 +271,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.action(['on', 'off', 'brightness_stop', 'brightness_step_up', 'brightness_step_down', 'single', 'double']), e.battery()], }, { - fingerprint: [{modelID: 'TS0211', manufacturerName: '_TZ1800_ladpngdx'}], + fingerprint: tuya.fingerprint('TS0211', ['_TZ1800_ladpngdx']), model: 'HG06668', vendor: 'Lidl', description: 'Silvercrest smart wireless door bell button', @@ -285,24 +285,24 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.battery(), e.action(['pressed']), e.battery_low(), e.tamper()], }, { - fingerprint: [{modelID: 'TY0202', manufacturerName: '_TZ1800_fcdjzz3s'}], + fingerprint: tuya.fingerprint('TY0202', ['_TZ1800_fcdjzz3s']), model: 'HG06335/HG07310', vendor: 'Lidl', description: 'Silvercrest smart motion sensor', - extend: [iasZoneAlarm({zoneType: 'occupancy', zoneStatusReporting: true, zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), battery()], + extend: [ + m.iasZoneAlarm({zoneType: 'occupancy', zoneStatusReporting: true, zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery(), + ], }, { - fingerprint: [ - {modelID: 'TY0203', manufacturerName: '_TZ1800_ejwkn2h2'}, - {modelID: 'TY0203', manufacturerName: '_TZ1800_ho6i0zk9'}, - ], + fingerprint: tuya.fingerprint('TY0203', ['_TZ1800_ejwkn2h2', '_TZ1800_ho6i0zk9']), model: 'HG06336', vendor: 'Lidl', description: 'Silvercrest smart window and door sensor', - extend: [iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper']}), battery()], + extend: [m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper']}), m.battery()], }, { - fingerprint: [{modelID: 'TS1001', manufacturerName: '_TYZB01_bngwdjsr'}], + fingerprint: tuya.fingerprint('TS1001', ['_TYZB01_bngwdjsr']), model: 'FB20-002', vendor: 'Lidl', description: 'Livarno Lux switch and dimming light remote control', @@ -313,7 +313,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [], }, { - fingerprint: [{modelID: 'TS1001', manufacturerName: '_TYZB01_hww2py6b'}], + fingerprint: tuya.fingerprint('TS1001', ['_TYZB01_hww2py6b']), model: 'FB21-001', vendor: 'Lidl', description: 'Livarno Lux switch and dimming light remote control', @@ -333,14 +333,14 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [], }, { - fingerprint: [ - {modelID: 'TS011F', manufacturerName: '_TZ3000_wzauvbcs'}, // EU - {modelID: 'TS011F', manufacturerName: '_TZ3000_oznonj5q'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_1obwwnmq'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_4uf3d0ax'}, // FR - {modelID: 'TS011F', manufacturerName: '_TZ3000_vzopcetz'}, // CZ - {modelID: 'TS011F', manufacturerName: '_TZ3000_vmpbygs5'}, // BS - ], + fingerprint: tuya.fingerprint('TS011F', [ + '_TZ3000_wzauvbcs', + '_TZ3000_oznonj5q', + '_TZ3000_1obwwnmq', + '_TZ3000_4uf3d0ax', + '_TZ3000_vzopcetz', + '_TZ3000_vmpbygs5', + ]), model: 'HG06338', vendor: 'Lidl', description: 'Silvercrest 3 gang switch, with 4 USB (EU, FR, CZ, BS)', @@ -357,7 +357,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_s8gkrkxk'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_s8gkrkxk']), model: 'HG06467', vendor: 'Lidl', description: 'Melinera smart LED string lights', @@ -366,7 +366,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.light_brightness_colorhs().setAccess('brightness', ea.STATE_SET).setAccess('color_hs', ea.STATE_SET)], }, { - fingerprint: [{modelID: 'TS0504B', manufacturerName: '_TZ3210_sroezl0s'}], + fingerprint: tuya.fingerprint('TS0504B', ['_TZ3210_sroezl0s']), model: '14153806L', vendor: 'Lidl', description: 'Livarno smart LED ceiling light', @@ -376,7 +376,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_htnnfasr']), model: 'PSBZS A1', vendor: 'Lidl', description: 'Parkside smart watering timer', @@ -509,7 +509,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0101', manufacturerName: '_TZ3000_br3laukf'}], + fingerprint: tuya.fingerprint('TS0101', ['_TZ3000_br3laukf']), model: 'HG06620', vendor: 'Lidl', description: 'Silvercrest garden spike with 2 sockets', @@ -521,7 +521,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0101', manufacturerName: '_TZ3000_pnzfdr9y'}], + fingerprint: tuya.fingerprint('TS0101', ['_TZ3000_pnzfdr9y']), model: 'HG06619', vendor: 'Lidl', description: 'Silvercrest outdoor plug', @@ -533,14 +533,14 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3000_lxw3zcdk'}], + fingerprint: tuya.fingerprint('TS0505B', ['_TZ3000_lxw3zcdk']), model: 'HG08633', vendor: 'Lidl', description: 'Livarno gardenspot RGB', extend: [tuya.modernExtend.tuyaLight({colorTemp: {range: [153, 500]}, color: {modes: ['hs', 'xy']}})], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_chyvmhay'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_chyvmhay']), model: '368308_2010', vendor: 'Lidl', description: 'Silvercrest radiator valve with thermostat', diff --git a/src/devices/lifecontrol.ts b/src/devices/lifecontrol.ts index 44bba72c5046a..dc6d8e01ffad4 100644 --- a/src/devices/lifecontrol.ts +++ b/src/devices/lifecontrol.ts @@ -1,14 +1,5 @@ import * as exposes from '../lib/exposes'; -import { - battery, - electricityMeter, - iasZoneAlarm, - light, - onOff, - setupConfigureForBinding, - setupConfigureForReading, - setupConfigureForReporting, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as globalStore from '../lib/store'; import {Configure, DefinitionWithExtend, Expose, Fz, ModernExtend, OnEvent} from '../lib/types'; @@ -36,8 +27,8 @@ function airQuality(): ModernExtend { function electricityMeterPoll(): ModernExtend { const configure: Configure[] = [ - setupConfigureForBinding('haElectricalMeasurement', 'input'), - setupConfigureForReading('haElectricalMeasurement', [ + m.setupConfigureForBinding('haElectricalMeasurement', 'input'), + m.setupConfigureForReading('haElectricalMeasurement', [ 'acVoltageMultiplier', 'acVoltageDivisor', 'acCurrentMultiplier', @@ -45,8 +36,8 @@ function electricityMeterPoll(): ModernExtend { 'acPowerMultiplier', 'acPowerDivisor', ]), - setupConfigureForReading('seMetering', ['multiplier', 'divisor']), - setupConfigureForReporting('seMetering', 'currentSummDelivered', {min: '5_SECONDS', max: '1_HOUR', change: 257}, exposes.access.STATE_GET), + m.setupConfigureForReading('seMetering', ['multiplier', 'divisor']), + m.setupConfigureForReporting('seMetering', 'currentSummDelivered', {min: '5_SECONDS', max: '1_HOUR', change: 257}, exposes.access.STATE_GET), ]; const onEvent: OnEvent = async (type, data, device) => { @@ -79,8 +70,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'LifeControl', description: 'Water leakage sensor', extend: [ - iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), - battery({dontDividePercentage: true, percentageReporting: false}), + m.iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({dontDividePercentage: true, percentageReporting: false}), ], }, { @@ -89,8 +80,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'LifeControl', description: 'Open and close sensor', extend: [ - iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), - battery({dontDividePercentage: true, percentageReporting: false}), + m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({dontDividePercentage: true, percentageReporting: false}), ], }, { @@ -98,14 +89,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'MCLH-02', vendor: 'LifeControl', description: 'Smart light bulb', - extend: [light({colorTemp: {range: [167, 333]}, color: true})], + extend: [m.light({colorTemp: {range: [167, 333]}, color: true})], }, { zigbeeModel: ['RICI01'], model: 'MCLH-03', vendor: 'LifeControl', description: 'Smart socket', - extend: [onOff({powerOnBehavior: false}), electricityMeter({configureReporting: false}), electricityMeterPoll()], + extend: [m.onOff({powerOnBehavior: false}), m.electricityMeter({configureReporting: false}), electricityMeterPoll()], }, { zigbeeModel: ['Motion_Sensor'], @@ -113,8 +104,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'LifeControl', description: 'Motion sensor', extend: [ - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), - battery({dontDividePercentage: true, percentageReporting: false}), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({dontDividePercentage: true, percentageReporting: false}), ], }, { @@ -122,7 +113,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'MCLH-08', vendor: 'LifeControl', description: 'Air quality sensor', - extend: [airQuality(), battery({dontDividePercentage: true, percentageReporting: false})], + extend: [airQuality(), m.battery({dontDividePercentage: true, percentageReporting: false})], }, ]; diff --git a/src/devices/lightsolutions.ts b/src/devices/lightsolutions.ts index 65d06797985d3..a3dbc5f17063e 100644 --- a/src/devices/lightsolutions.ts +++ b/src/devices/lightsolutions.ts @@ -1,4 +1,4 @@ -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,28 +7,28 @@ const definitions: DefinitionWithExtend[] = [ model: '200403V2-B', vendor: 'Light Solutions', description: 'Mini dimmer 200W', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['91-948'], model: '200106V3', vendor: 'Light Solutions', description: 'Zigbee switch 200W', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['42-032'], model: '42-032', vendor: 'Light Solutions', description: 'LED driver CCT 12V - 30W - CCT', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, { fingerprint: [{modelID: 'Dimmer-Switch-ZB3.0', manufacturerName: 'Light Solutions'}], model: '3004482/3137308/3137309', vendor: 'Light Solutions', description: 'Zigbee dimmer for wire', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/linkind.ts b/src/devices/linkind.ts index f6b6b9eb59238..5c50dd315119f 100644 --- a/src/devices/linkind.ts +++ b/src/devices/linkind.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend} from '../lib/types'; @@ -99,56 +99,56 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZL1000100-CCT-US-V1A02', vendor: 'Linkind', description: 'Zigbee LED 9W A19 bulb, dimmable & tunable', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['ZBT-CCTLight-C4700107'], model: 'ZL1000400-CCT-EU-2-V1A02', vendor: 'Linkind', description: 'Zigbee LED 5.4W C35 bulb E14, dimmable & tunable', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['ZBT-CCTLight-M3500107'], model: 'ZL00030014', vendor: 'Linkind', description: 'Zigbee LED 4.8W GU10 bulb, dimmable & tunable', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['ZBT-CCTLight-D115'], model: 'ZL13100314', vendor: 'Linkind', description: 'Ceiling light 28W, 3000 lm, Ø40CM CCT', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['ZBT-CCTLight-BR300107'], model: 'ZL100050004', vendor: 'Linkind', description: 'Zigbee LED 7.4W BR30 bulb E26, dimmable & tunable', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['ZBT-DIMLight-GLS0010'], model: 'ZL100010008', vendor: 'Linkind', description: 'Zigbee LED 9W 2700K A19 bulb, dimmable', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZBT-DIMLight-D0120'], model: 'ZL1000701-27-EU-V1A02', vendor: 'Linkind', description: 'Zigbee A60 filament bulb 6.3W', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZBT-DIMLight-A4700003'], model: 'ZL1000700-22-EU-V1A02', vendor: 'Linkind', description: 'Zigbee A60 led filament, dimmable warm light (2200K), E27. 4.2W, 420lm', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZB-MotionSensor-D0003'], @@ -197,7 +197,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZS190000118', vendor: 'Linkind', description: 'Control outlet', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['ZB-KeyfodGeneric-D0001'], diff --git a/src/devices/livingwise.ts b/src/devices/livingwise.ts index cc48847d5617f..a566fee57a814 100644 --- a/src/devices/livingwise.ts +++ b/src/devices/livingwise.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -11,14 +11,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'LVS-ZB500D', vendor: 'LivingWise', description: 'ZigBee smart dimmer switch', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['545df2981b704114945f6df1c780515a'], model: 'LVS-ZB15S', vendor: 'LivingWise', description: 'ZigBee smart in-wall switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['e70f96b3773a4c9283c6862dbafb6a99'], @@ -43,7 +43,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LVS-ZB15R', vendor: 'LivingWise', description: 'Zigbee smart outlet', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['75d430d66c164c26ac8601c05932dc94'], diff --git a/src/devices/lixee.ts b/src/devices/lixee.ts index 81c96526d8d10..466828b526e61 100644 --- a/src/devices/lixee.ts +++ b/src/devices/lixee.ts @@ -1766,7 +1766,6 @@ const definitions: DefinitionWithExtend[] = [ exposes = getCurrentConfig(device, options).map((e) => e.exposes); } - exposes.push(e.linkquality()); return exposes; }, options: [ diff --git a/src/devices/lonsonho.ts b/src/devices/lonsonho.ts index 62d923dce1d9f..bace561b6147b 100644 --- a/src/devices/lonsonho.ts +++ b/src/devices/lonsonho.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {deviceEndpoints, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -12,10 +12,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS130F', manufacturerName: '_TZ3000_vd43bbfq'}, - {modelID: 'TS130F', manufacturerName: '_TZ3000_fccpjz5z'}, - ], + fingerprint: tuya.fingerprint('TS130F', ['_TZ3000_vd43bbfq', '_TZ3000_fccpjz5z']), model: 'QS-Zigbee-C01', vendor: 'Lonsonho', description: 'Curtain/blind motor controller', @@ -31,7 +28,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS130F', manufacturerName: '_TZ3000_egq7y6pr'}], + fingerprint: tuya.fingerprint('TS130F', ['_TZ3000_egq7y6pr']), model: '11830304', vendor: 'Lonsonho', description: 'Curtain switch', @@ -72,7 +69,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0001', manufacturerName: '_TZ3000_t3s9qmmg'}], + fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_t3s9qmmg']), model: 'X701A', vendor: 'Lonsonho', description: '1 gang switch with backlight', @@ -83,10 +80,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_8vxj8khv'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_7tdtqgwv'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_8vxj8khv', '_TZE200_7tdtqgwv']), model: 'X711A', vendor: 'Lonsonho', description: '1 gang switch', @@ -95,7 +89,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [legacy.tz.tuya_switch_state], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_dhdstcqc'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_dhdstcqc']), model: 'X712A', vendor: 'Lonsonho', description: '2 gang switch', @@ -109,7 +103,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_fqytfymk'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_fqytfymk']), model: 'X713A', vendor: 'Lonsonho', description: '3 gang switch', @@ -127,19 +121,19 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS110F', manufacturerName: '_TYZB01_qezuin6k'}], + fingerprint: tuya.fingerprint('TS110F', ['_TYZB01_qezuin6k']), model: 'QS-Zigbee-D02-TRIAC-LN', vendor: 'Lonsonho', description: '1 gang smart dimmer switch module with neutral', extend: [tuya.modernExtend.tuyaLight({minBrightness: 'attribute'})], }, { - fingerprint: [{modelID: 'TS110F', manufacturerName: '_TYZB01_v8gtiaed'}], + fingerprint: tuya.fingerprint('TS110F', ['_TYZB01_v8gtiaed']), model: 'QS-Zigbee-D02-TRIAC-2C-LN', vendor: 'Lonsonho', description: '2 gang smart dimmer switch module with neutral', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), tuya.modernExtend.tuyaLight({minBrightness: 'attribute', endpointNames: ['l1', 'l2']}), ], meta: {multiEndpoint: true}, @@ -150,18 +144,18 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS110F', manufacturerName: '_TZ3000_92chsky7'}], + fingerprint: tuya.fingerprint('TS110F', ['_TZ3000_92chsky7']), model: 'QS-Zigbee-D02-TRIAC-2C-L', vendor: 'Lonsonho', description: '2 gang smart dimmer switch module without neutral', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), light({endpointNames: ['l1', 'l2'], configureReporting: true})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.light({endpointNames: ['l1', 'l2'], configureReporting: true})], }, { zigbeeModel: ['Plug_01'], model: '4000116784070', vendor: 'Lonsonho', description: 'Smart plug EU', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['ZB-RGBCW'], @@ -175,13 +169,10 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-RGBCW', vendor: 'Lonsonho', description: 'Zigbee 3.0 LED-bulb, RGBW LED', - extend: [light({colorTemp: {range: [153, 500], startup: false}, color: true, effect: false, powerOnBehavior: false})], + extend: [m.light({colorTemp: {range: [153, 500], startup: false}, color: true, effect: false, powerOnBehavior: false})], }, { - fingerprint: [ - {modelID: 'TS0003', manufacturerName: '_TYZB01_zsl6z0pw'}, - {modelID: 'TS0003', manufacturerName: '_TYZB01_uqkphoed'}, - ], + fingerprint: tuya.fingerprint('TS0003', ['_TYZB01_zsl6z0pw', '_TYZB01_uqkphoed']), model: 'QS-Zigbee-S04-2C-LN', vendor: 'Lonsonho', description: '2 gang switch module with neutral wire', @@ -198,18 +189,15 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0003', manufacturerName: '_TYZB01_ncutbjdi'}], + fingerprint: tuya.fingerprint('TS0003', ['_TYZB01_ncutbjdi']), model: 'QS-Zigbee-S05-LN', vendor: 'Lonsonho', description: '1 gang switch module with neutral wire', - extend: [onOff({powerOnBehavior: false, configureReporting: false})], + extend: [m.onOff({powerOnBehavior: false, configureReporting: false})], toZigbee: [tz.TYZB01_on_off], }, { - fingerprint: [ - {modelID: 'TS130F', manufacturerName: '_TZ3000_zirycpws'}, - {modelID: 'TS130F', manufacturerName: '_TZ3210_ol1uhvza'}, - ], + fingerprint: tuya.fingerprint('TS130F', ['_TZ3000_zirycpws', '_TZ3210_ol1uhvza']), model: 'QS-Zigbee-C03', vendor: 'Lonsonho', description: 'Curtain/blind motor controller', @@ -225,7 +213,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0603', manufacturerName: '_TZE600_wxq8dpha\u0000'}], + fingerprint: tuya.fingerprint('TS0603', ['_TZE600_wxq8dpha\u0000']), model: 'VM-Zigbee-S02-0-10V', vendor: 'Lonsonho', description: '2 channel Zigbee 0-10V dimmer module', diff --git a/src/devices/ls.ts b/src/devices/ls.ts index 4ac57c2eb8548..b50f9c72c0b62 100644 --- a/src/devices/ls.ts +++ b/src/devices/ls.ts @@ -1,5 +1,5 @@ import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -10,13 +10,12 @@ const definitions: DefinitionWithExtend[] = [ model: 'A319463', vendor: 'LS Deutschland GmbH', description: 'Home base', - fromZigbee: light({colorTemp: {range: [153, 454]}, color: true}).fromZigbee, - toZigbee: light({colorTemp: {range: [153, 454]}, color: true}).toZigbee, - configure: light({colorTemp: {range: [153, 454]}, color: true}).configure[0], + fromZigbee: m.light({colorTemp: {range: [153, 454]}, color: true}).fromZigbee, + toZigbee: m.light({colorTemp: {range: [153, 454]}, color: true}).toZigbee, + configure: m.light({colorTemp: {range: [153, 454]}, color: true}).configure[0], exposes: (device, options) => { - if (!device) return [e.light_brightness_colortemp_colorxy([153, 454]), e.linkquality()]; + if (!device) return [e.light_brightness_colortemp_colorxy([153, 454])]; return [ - e.linkquality(), ...device.endpoints .filter((ep) => ep.ID !== 242) .map((ep) => { diff --git a/src/devices/lubeez.ts b/src/devices/lubeez.ts index 847649b2bdc9f..5ad08905a0ae1 100644 --- a/src/devices/lubeez.ts +++ b/src/devices/lubeez.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '12AB', vendor: 'Lubeez', description: 'zigbee 3.0 AC dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/lumi.ts b/src/devices/lumi.ts index 06abeed29e956..cb23e30bc7f4a 100644 --- a/src/devices/lumi.ts +++ b/src/devices/lumi.ts @@ -1,27 +1,9 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; -import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; import * as lumi from '../lib/lumi'; -import { - battery, - binary, - customTimeResponse, - deviceEndpoints, - enumLookup, - forceDeviceType, - forcePowerSource, - humidity, - identify, - light, - numeric, - onOff, - quirkAddEndpointCluster, - quirkCheckinInterval, - temperature, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend} from '../lib/types'; @@ -89,7 +71,7 @@ const definitions: DefinitionWithExtend[] = [ const endpoint = device.getEndpoint(1); await endpoint.read('genPowerCfg', ['batteryVoltage']); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.airm.fhac01'], @@ -115,7 +97,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('genPowerCfg', ['batteryVoltage']); }, extend: [ - quirkCheckinInterval('1_HOUR'), + m.quirkCheckinInterval('1_HOUR'), // OTA request: "fieldControl":0, "manufacturerCode":4447, "imageType":10635, no available for now // https://github.com/Koenkk/zigbee-OTA/pull/138 // lumiZigbeeOTA(), @@ -138,18 +120,18 @@ const definitions: DefinitionWithExtend[] = [ .enum('detection_distance', ea.ALL, ['10mm', '20mm', '30mm']) .withDescription('The sensor will be considered "off" within the set distance. Please press the device button before setting'), ], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.dimmer.rcbac1'], model: 'ZNDDMK11LM', vendor: 'Aqara', description: 'Smart lightstrip driver', - fromZigbee: [lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_specific, ...light({colorTemp: {range: undefined}, color: true}).fromZigbee], + fromZigbee: [lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_specific, ...m.light({colorTemp: {range: undefined}, color: true}).fromZigbee], toZigbee: [ lumi.toZigbee.lumi_dimmer_mode, lumi.toZigbee.lumi_switch_power_outage_memory, - ...light({colorTemp: {range: undefined}, color: true}).toZigbee, + ...m.light({colorTemp: {range: undefined}, color: true}).toZigbee, ], exposes: [ e.power(), @@ -163,7 +145,7 @@ const definitions: DefinitionWithExtend[] = [ e.light_brightness_colortemp([153, 370]).removeFeature('color_temp_startup').withEndpoint('l2'), e.enum('dimmer_mode', ea.ALL, ['rgbw', 'dual_ct']).withDescription('Switch between rgbw mode or dual color temperature mode'), ], - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), lumiZigbeeOTA()], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.light.aqcn02'], @@ -188,8 +170,8 @@ const definitions: DefinitionWithExtend[] = [ extend: [ lumiZigbeeOTA(), lumiLight({colorTemp: true, powerOutageMemory: 'switch'}), - forceDeviceType({type: 'Router'}), - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.forceDeviceType({type: 'Router'}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), ], }, { @@ -250,7 +232,7 @@ const definitions: DefinitionWithExtend[] = [ e.power_outage_count(false), ], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.sensor_switch.aq2', 'lumi.remote.b1acn01'], @@ -267,7 +249,7 @@ const definitions: DefinitionWithExtend[] = [ ], fromZigbee: [lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_basic], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.sensor_switch.aq3', 'lumi.sensor_swit'], @@ -278,7 +260,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.battery(), e.action(['single', 'double', 'hold', 'release', 'shake']), e.battery_voltage()], fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_action_multistate], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.sensor_86sw1'], @@ -289,7 +271,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.battery(), e.action(['single']), e.battery_voltage()], fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_basic], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR'), lumiPreventReset()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiPreventReset()], }, { zigbeeModel: ['lumi.remote.b186acn01'], @@ -300,7 +282,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.battery(), e.action(['single', 'double', 'hold']), e.battery_voltage()], fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_basic], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR'), lumiPreventReset()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiPreventReset()], }, { zigbeeModel: ['lumi.remote.b186acn02'], @@ -311,7 +293,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [], exposes: [e.battery(), e.action(['single', 'double', 'hold']), e.battery_voltage()], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR'), lumiPreventReset()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiPreventReset()], configure: async (device, coordinatorEndpoint) => { try { const endpoint = device.endpoints[1]; @@ -328,9 +310,9 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [{vendor: 'Aqara', model: 'RLS-K01D'}], description: 'Light strip T1', extend: [ - light({effect: false, powerOnBehavior: false, colorTemp: {startup: false, range: [153, 370]}, color: true}), + m.light({effect: false, powerOnBehavior: false, colorTemp: {startup: false, range: [153, 370]}, color: true}), lumiPowerOnBehavior(), - numeric({ + m.numeric({ name: 'length', valueMin: 1, valueMax: 10, @@ -342,7 +324,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'LED strip length', zigbeeCommandOptions: {manufacturerCode}, }), - numeric({ + m.numeric({ name: 'min_brightness', valueMin: 0, valueMax: 99, @@ -352,7 +334,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Minimum brightness level', zigbeeCommandOptions: {manufacturerCode}, }), - numeric({ + m.numeric({ name: 'max_brightness', valueMin: 1, valueMax: 100, @@ -362,7 +344,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Maximum brightness level', zigbeeCommandOptions: {manufacturerCode}, }), - binary({ + m.binary({ name: 'audio', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -371,7 +353,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Enabling audio', zigbeeCommandOptions: {manufacturerCode}, }), - enumLookup({ + m.enumLookup({ name: 'audio_sensitivity', lookup: {low: 0, medium: 1, high: 2}, cluster: 'manuSpecificLumi', @@ -379,7 +361,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Audio sensitivity', zigbeeCommandOptions: {manufacturerCode}, }), - enumLookup({ + m.enumLookup({ name: 'audio_effect', lookup: {random: 0, blink: 1, rainbow: 2, wave: 3}, cluster: 'manuSpecificLumi', @@ -387,7 +369,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Audio effect', zigbeeCommandOptions: {manufacturerCode}, }), - numeric({ + m.numeric({ name: 'preset', valueMin: 1, valueMax: 32, @@ -396,7 +378,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Preset index (0-6 default presets)', zigbeeCommandOptions: {manufacturerCode}, }), - numeric({ + m.numeric({ name: 'speed', valueMin: 1, valueMax: 100, @@ -417,7 +399,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.battery(), e.action(['single_left', 'single_right', 'single_both']), e.battery_voltage(), e.power_outage_count(false)], fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_basic], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR'), lumiPreventReset()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiPreventReset()], }, { zigbeeModel: ['lumi.remote.b286acn01'], @@ -442,7 +424,7 @@ const definitions: DefinitionWithExtend[] = [ ], fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_basic], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR'), lumiPreventReset()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiPreventReset()], }, { zigbeeModel: ['lumi.switch.b1laus01'], @@ -1165,7 +1147,7 @@ const definitions: DefinitionWithExtend[] = [ 'hold_both', ]), ], - extend: [quirkCheckinInterval('1_HOUR'), lumiPreventReset()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiPreventReset()], }, { zigbeeModel: ['lumi.switch.b1lacn02'], @@ -1429,7 +1411,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Smart wall switch T1 (no neutral, double rocker)', extend: [ lumiZigbeeOTA(), - deviceEndpoints({endpoints: {left: 1, right: 2}}), + m.deviceEndpoints({endpoints: {left: 1, right: 2}}), lumiOnOff({powerOutageMemory: 'binary', operationMode: true, endpointNames: ['left', 'right']}), lumiLedDisabledNight(), lumiFlipIndicatorLight(), @@ -1459,10 +1441,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aqara', description: 'Smart wall switch T1 (with neutral, double rocker)', extend: [ - forceDeviceType({type: 'Router'}), - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.forceDeviceType({type: 'Router'}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), lumiZigbeeOTA(), - deviceEndpoints({endpoints: {left: 1, right: 2}}), + m.deviceEndpoints({endpoints: {left: 1, right: 2}}), lumiOnOff({powerOutageMemory: 'binary', operationMode: true, endpointNames: ['left', 'right']}), lumiLedDisabledNight(), lumiFlipIndicatorLight(), @@ -1479,7 +1461,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Smart wall switch T1 (no neutral, triple rocker)', extend: [ lumiZigbeeOTA(), - deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), + m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), lumiOnOff({powerOutageMemory: 'binary', operationMode: true, endpointNames: ['left', 'center', 'right']}), lumiLedDisabledNight(), lumiFlipIndicatorLight(), @@ -1505,7 +1487,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Smart wall switch T1 (with neutral, triple rocker)', extend: [ lumiZigbeeOTA(), - deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), + m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), lumiOnOff({powerOutageMemory: 'binary', operationMode: true, endpointNames: ['left', 'center', 'right']}), lumiLedDisabledNight(), lumiFlipIndicatorLight(), @@ -1540,7 +1522,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_temperature, fz.humidity], toZigbee: [], exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.weather'], @@ -1555,7 +1537,7 @@ const definitions: DefinitionWithExtend[] = [ device.powerSource = 'Battery'; device.save(); }, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.sensor_ht.agl02'], @@ -1576,7 +1558,7 @@ const definitions: DefinitionWithExtend[] = [ await reporting.bind(endpoint, coordinatorEndpoint, binds); await endpoint.read('genPowerCfg', ['batteryVoltage']); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.sensor_motion'], @@ -1593,7 +1575,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [lumi.fromZigbee.lumi_basic, fz.occupancy_with_timeout], toZigbee: [], exposes: [e.battery(), e.occupancy(), e.battery_voltage(), e.power_outage_count(false)], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.sensor_motion.aq2'], @@ -1604,7 +1586,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [lumi.fromZigbee.lumi_basic, fz.occupancy_with_timeout, lumi.fromZigbee.lumi_illuminance], toZigbee: [], exposes: [e.battery(), e.occupancy(), e.device_temperature(), e.battery_voltage(), e.illuminance(), e.power_outage_count(false)], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.motion.agl02'], @@ -1634,7 +1616,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('genPowerCfg', ['batteryVoltage']); await endpoint.read('manuSpecificLumi', [0x0102], {manufacturerCode: manufacturerCode}); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.motion.agl04'], @@ -1664,7 +1646,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('manuSpecificLumi', [0x0102], {manufacturerCode: manufacturerCode}); await endpoint.read('manuSpecificLumi', [0x010c], {manufacturerCode: manufacturerCode}); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.motion.ac02'], @@ -1702,7 +1684,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('manuSpecificLumi', [0x010c], {manufacturerCode: manufacturerCode}); await endpoint.read('manuSpecificLumi', [0x0152], {manufacturerCode: manufacturerCode}); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.motion.acn001'], @@ -1731,7 +1713,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('genPowerCfg', ['batteryVoltage']); await endpoint.read('manuSpecificLumi', [0x0102], {manufacturerCode: manufacturerCode}); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.motion.ac01'], @@ -1854,7 +1836,7 @@ const definitions: DefinitionWithExtend[] = [ lumi.lumiModernExtend.fp1eDetectionRange(), lumi.lumiModernExtend.fp1eSpatialLearning(), lumi.lumiModernExtend.fp1eRestartDevice(), - identify(), + m.identify(), ], }, { @@ -1872,7 +1854,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_contact], toZigbee: [], exposes: [e.battery(), e.contact(), e.battery_voltage(), e.power_outage_count(false)], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.sensor_magnet.aq2'], @@ -1883,7 +1865,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_contact], toZigbee: [], exposes: [e.battery(), e.contact(), e.device_temperature(), e.battery_voltage(), e.power_outage_count(false), e.trigger_count()], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], configure: async (device) => { device.powerSource = 'Battery'; device.save(); @@ -1906,7 +1888,7 @@ const definitions: DefinitionWithExtend[] = [ e.power_outage_count(false), e.trigger_count(), ], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.flood.agl02'], @@ -1921,7 +1903,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [lumi.fromZigbee.lumi_basic, fz.ias_water_leak_alarm_1, lumi.fromZigbee.lumi_specific], toZigbee: [], exposes: [e.battery(), e.water_leak(), e.battery_low(), e.tamper(), e.battery_voltage()], - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.sensor_cube', 'lumi.sensor_cube.aqgl01'], @@ -1944,7 +1926,7 @@ const definitions: DefinitionWithExtend[] = [ e.action(['shake', 'throw', 'wakeup', 'fall', 'tap', 'slide', 'flip180', 'flip90', 'rotate_left', 'rotate_right']), ], toZigbee: [], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.plug'], @@ -2042,7 +2024,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP-EUC01', description: 'Smart plug EU', vendor: 'Aqara', - extend: [forceDeviceType({type: 'Router'}), lumiZigbeeOTA()], + extend: [m.forceDeviceType({type: 'Router'}), lumiZigbeeOTA()], fromZigbee: [ fz.on_off, lumi.fromZigbee.lumi_basic, @@ -2146,7 +2128,7 @@ const definitions: DefinitionWithExtend[] = [ e.led_disabled_night(), e.auto_off(30), ], - extend: [customTimeResponse('2000_LOCAL')], + extend: [m.customTimeResponse('2000_LOCAL')], }, { zigbeeModel: ['lumi.ctrl_86plug', 'lumi.ctrl_86plug.aq1'], @@ -2187,7 +2169,7 @@ const definitions: DefinitionWithExtend[] = [ e.device_temperature(), e.power_outage_count(false), ], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.sensor_natgas'], @@ -2343,7 +2325,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('manuSpecificLumi', [0x0126], {manufacturerCode: manufacturerCode}); await endpoint.read('manuSpecificLumi', [0x014b], {manufacturerCode: manufacturerCode}); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.lock.v1'], @@ -2378,7 +2360,7 @@ const definitions: DefinitionWithExtend[] = [ e.battery_voltage(), e.power_outage_count(false), ], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], }, { zigbeeModel: ['lumi.vibration.agl01'], @@ -2390,9 +2372,9 @@ const definitions: DefinitionWithExtend[] = [ // Doesn't seem to be working at all // https://github.com/Koenkk/zigbee2mqtt/issues/21731 // lumiMiscellaneous(), - battery({voltageToPercentage: {min: 2850, max: 3000}, voltage: true}), + m.battery({voltageToPercentage: {min: 2850, max: 3000}, voltage: true}), lumiZigbeeOTA(), - quirkCheckinInterval('1_HOUR'), + m.quirkCheckinInterval('1_HOUR'), ], }, { @@ -2517,7 +2499,7 @@ const definitions: DefinitionWithExtend[] = [ .withDescription('Performs an automatic calibration process similar to Aqara’s method to set curtain limits.'), ], extend: [ - windowCovering({controls: ['lift'], coverInverted: true, configureReporting: true}), + m.windowCovering({controls: ['lift'], coverInverted: true, configureReporting: true}), lumiCurtainSpeed(), lumiCurtainManualOpenClose(), lumiCurtainAdaptivePullingSpeed(), @@ -2530,7 +2512,7 @@ const definitions: DefinitionWithExtend[] = [ lumiCurtainCalibrationStatus(), lumiCurtainCalibrated(), lumiCurtainIdentifyBeep(), - identify(), + m.identify(), lumiZigbeeOTA(), ], }, @@ -2575,7 +2557,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('manuSpecificLumi', [0x040a], {manufacturerCode: manufacturerCode}); }, extend: [ - quirkAddEndpointCluster({ + m.quirkAddEndpointCluster({ endpointID: 1, inputClusters: ['manuSpecificLumi'], }), @@ -2690,7 +2672,7 @@ const definitions: DefinitionWithExtend[] = [ lumiOperationMode({description: 'Decoupled mode for 1st relay', endpointName: 'l1'}), lumiOperationMode({description: 'Decoupled mode for 2nd relay', endpointName: 'l2'}), lumiAction({endpointNames: ['l1', 'l2']}), - binary({ + m.binary({ name: 'interlock', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -2699,7 +2681,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Enabling prevents both relays being on at the same time (Interlock)', zigbeeCommandOptions: {manufacturerCode}, }), - enumLookup({ + m.enumLookup({ name: 'mode', lookup: {power: 0, pulse: 1, dry: 3}, cluster: 'manuSpecificLumi', @@ -2707,7 +2689,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Work mode: Power mode, Dry mode with impulse, Dry mode', zigbeeCommandOptions: {manufacturerCode}, }), - numeric({ + m.numeric({ name: 'pulse_length', valueMin: 200, valueMax: 2000, @@ -2759,7 +2741,7 @@ const definitions: DefinitionWithExtend[] = [ device.type = 'EndDevice'; device.save(); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.lock.acn03'], @@ -2791,7 +2773,7 @@ const definitions: DefinitionWithExtend[] = [ 'door_closed', ]), ], - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], configure: async (device, coordinatorEndpoint) => { // Device advertises itself as Router but is an EndDevice device.type = 'EndDevice'; @@ -2828,7 +2810,7 @@ const definitions: DefinitionWithExtend[] = [ 'door_closed', ]), ], - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.remote.b286opcn01'], @@ -2863,7 +2845,7 @@ const definitions: DefinitionWithExtend[] = [ ], toZigbee: [lumi.toZigbee.lumi_operation_mode_opple], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await endpoint.write('manuSpecificLumi', {mode: 1}, {manufacturerCode: manufacturerCode}); @@ -2915,7 +2897,7 @@ const definitions: DefinitionWithExtend[] = [ ], toZigbee: [lumi.toZigbee.lumi_operation_mode_opple], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await endpoint.write('manuSpecificLumi', {mode: 1}, {manufacturerCode: manufacturerCode}); @@ -2981,7 +2963,7 @@ const definitions: DefinitionWithExtend[] = [ ], toZigbee: [lumi.toZigbee.lumi_operation_mode_opple], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await endpoint.write('manuSpecificLumi', {mode: 1}, {manufacturerCode: manufacturerCode}); @@ -2994,17 +2976,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Xiaomi', whiteLabel: [{vendor: 'Xiaomi', model: 'YTC4043GL'}], description: 'Mi light sensor', - fromZigbee: [fz.battery, fz.illuminance, lumi.fromZigbee.lumi_specific], - toZigbee: [tz.illuminance], + fromZigbee: [fz.battery, lumi.fromZigbee.lumi_specific], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], - configure: async (device, coordinatorEndpoint) => { - const endpoint = device.getEndpoint(1); - await reporting.bind(endpoint, coordinatorEndpoint, ['msIlluminanceMeasurement']); - await reporting.illuminance(endpoint, {min: 15, max: constants.repInterval.HOUR, change: 500}); - await endpoint.read('genPowerCfg', ['batteryVoltage']); - }, - exposes: [e.battery(), e.battery_voltage(), e.illuminance().withAccess(ea.STATE_GET)], + extend: [m.quirkCheckinInterval('1_HOUR'), m.illuminance()], + exposes: [e.battery(), e.battery_voltage()], }, { zigbeeModel: ['lumi.light.acn128'], @@ -3024,7 +2999,7 @@ const definitions: DefinitionWithExtend[] = [ powerOutageMemory: 'enum', levelConfig: {disabledFeatures: ['current_level_startup']}, }), - numeric({ + m.numeric({ name: 'min_brightness', valueMin: 0, valueMax: 99, @@ -3034,7 +3009,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Minimum brightness level', zigbeeCommandOptions: {manufacturerCode}, }), - numeric({ + m.numeric({ name: 'max_brightness', valueMin: 1, valueMax: 100, @@ -3051,7 +3026,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZNTGMK11LM', vendor: 'Aqara', description: 'Smart RGBW light controller', - extend: [light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs']}}), lumiZigbeeOTA()], + extend: [m.light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs']}}), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.light.cwacn1'], @@ -3065,7 +3040,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HLQDQ01LM', vendor: 'Aqara', description: 'Smart LED controller', - extend: [light(), lumiZigbeeOTA()], + extend: [m.light(), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.light.acn004'], @@ -3267,7 +3242,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aqara', description: 'Wireless remote switch T1 (single rocker)', meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate, fz.battery, lumi.fromZigbee.lumi_specific], toZigbee: [], exposes: [e.action(['single', 'double', 'hold']), e.battery()], @@ -3281,7 +3256,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.battery, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific, fz.command_toggle], toZigbee: [lumi.toZigbee.lumi_switch_click_mode, lumi.toZigbee.lumi_operation_mode_opple], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}, multiEndpoint: true}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], exposes: [ e.battery(), e.battery_voltage(), @@ -3402,15 +3377,15 @@ const definitions: DefinitionWithExtend[] = [ meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, exposes: [e.device_temperature(), e.battery(), e.battery_voltage()], extend: [ - quirkCheckinInterval('1_HOUR'), - quirkAddEndpointCluster({ + m.quirkCheckinInterval('1_HOUR'), + m.quirkAddEndpointCluster({ endpointID: 1, inputClusters: ['msTemperatureMeasurement', 'msRelativeHumidity', 'genAnalogInput', 'manuSpecificLumi'], }), lumiAirQuality(), lumiVoc(), - temperature(), - humidity(), + m.temperature(), + m.humidity(), lumiDisplayUnit(), lumiOutageCountRestoreBindReporting(), lumiZigbeeOTA(), @@ -3523,20 +3498,19 @@ const definitions: DefinitionWithExtend[] = [ const endpoint1 = device.getEndpoint(1); await endpoint1.write('manuSpecificLumi', {mode: 1}, {manufacturerCode: manufacturerCode, disableResponse: true}); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.sen_ill.agl01'], model: 'GZCGQ11LM', vendor: 'Aqara', description: 'Light sensor T1', - fromZigbee: [fz.battery, fz.illuminance, lumi.fromZigbee.lumi_specific], + fromZigbee: [fz.battery, lumi.fromZigbee.lumi_specific], toZigbee: [lumi.toZigbee.lumi_detection_period], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, exposes: [ e.battery(), e.battery_voltage(), - e.illuminance(), e .numeric('detection_period', exposes.access.ALL) .withValueMin(1) @@ -3549,7 +3523,7 @@ const definitions: DefinitionWithExtend[] = [ await device.getEndpoint(1).write('manuSpecificLumi', {mode: 1}, {manufacturerCode: manufacturerCode, disableResponse: true}); await endpoint.read('manuSpecificLumi', [0x0000], {manufacturerCode: manufacturerCode}); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA(), m.illuminance({reporting: false})], }, { zigbeeModel: ['lumi.plug.sacn03'], @@ -3600,7 +3574,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [], exposes: [e.contact(), e.battery(), e.battery_voltage()], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.plug.sacn02'], @@ -3635,13 +3609,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aqara', description: 'Smart rotary knob H1 (wireless)', extend: [ - quirkCheckinInterval('1_HOUR'), + m.quirkCheckinInterval('1_HOUR'), lumiPreventReset(), lumiCommandMode(), lumiAction({actionLookup: {hold: 0, single: 1, double: 2, release: 255}}), lumiBattery({voltageToPercentage: {min: 2850, max: 3000}}), lumiKnobRotation(), - enumLookup({ + m.enumLookup({ name: 'sensitivity', lookup: {low: 720, medium: 360, high: 180}, cluster: 'manuSpecificLumi', @@ -3657,7 +3631,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aqara', description: 'Wireless remote switch E1 (single rocker)', meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], fromZigbee: [lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific], toZigbee: [lumi.toZigbee.lumi_switch_click_mode], exposes: [ @@ -3681,7 +3655,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aqara', description: 'Wireless remote switch E1 (double rocker)', meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR'), lumiPreventReset()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiPreventReset()], exposes: [ e.battery(), e.battery_voltage(), @@ -3722,7 +3696,7 @@ const definitions: DefinitionWithExtend[] = [ .withDescription('Operation mode, select "command" to enable bindings (wake up the device before changing modes!)'), ], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], configure: async (device, coordinatorEndpoint) => { const endpoint1 = device.getEndpoint(1); await endpoint1.write('manuSpecificLumi', {mode: 1}, {manufacturerCode: manufacturerCode, disableResponse: true}); @@ -3777,7 +3751,7 @@ const definitions: DefinitionWithExtend[] = [ await endpoint.read('manuSpecificLumi', [0x040a], {manufacturerCode: manufacturerCode}); await endpoint.read('genPowerCfg', ['batteryVoltage']); }, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['aqara.feeder.acn001'], @@ -3859,7 +3833,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.battery, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific], toZigbee: [], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], exposes: [ e.battery(), e.battery_voltage(), @@ -3876,7 +3850,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.battery, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific, fz.command_toggle], toZigbee: [lumi.toZigbee.lumi_switch_click_mode, lumi.toZigbee.lumi_operation_mode_opple], meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}, multiEndpoint: true}, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], exposes: [ e.battery(), e.battery_voltage(), @@ -3951,7 +3925,7 @@ const definitions: DefinitionWithExtend[] = [ 'button_3_triple', ]), ], - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], }, { zigbeeModel: ['lumi.switch.acn048'], @@ -3978,7 +3952,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ lumiZigbeeOTA(), lumiPreventReset(), - deviceEndpoints({endpoints: {top: 1, bottom: 2}}), + m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), lumiOnOff({ operationMode: true, powerOutageMemory: 'enum', @@ -4001,7 +3975,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ lumiZigbeeOTA(), lumiPreventReset(), - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), lumiOnOff({ operationMode: true, powerOutageMemory: 'enum', @@ -4024,7 +3998,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ lumiZigbeeOTA(), lumiPreventReset(), - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3, wireless: 4}}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3, wireless: 4}}), lumiOnOff({ operationMode: true, powerOutageMemory: 'enum', @@ -4067,7 +4041,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ lumiZigbeeOTA(), lumiPreventReset(), - deviceEndpoints({endpoints: {top: 1, bottom: 2}}), + m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), lumiOnOff({ operationMode: true, powerOutageMemory: 'enum', @@ -4093,7 +4067,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ lumiZigbeeOTA(), lumiPreventReset(), - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), lumiOnOff({ operationMode: true, powerOutageMemory: 'enum', @@ -4119,7 +4093,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [ lumiZigbeeOTA(), lumiPreventReset(), - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3, wireless: 4}}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3, wireless: 4}}), lumiOnOff({ operationMode: true, powerOutageMemory: 'enum', @@ -4162,7 +4136,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [{vendor: 'Aqara', model: 'MFCZQ12LM'}], description: 'Cube T1 Pro', meta: {battery: {voltageToPercentage: {min: 2850, max: 3000}}}, - extend: [quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], + extend: [m.quirkCheckinInterval('1_HOUR'), lumiZigbeeOTA()], fromZigbee: [ lumi.fromZigbee.lumi_specific, lumi.fromZigbee.lumi_action_multistate, @@ -4414,7 +4388,7 @@ const definitions: DefinitionWithExtend[] = [ lumiOverloadProtection(), lumiLedIndicator(), lumiButtonLock(), - binary({ + m.binary({ name: 'charging_protection', cluster: 'manuSpecificLumi', attribute: {ID: 0x0202, type: 0x10}, @@ -4424,7 +4398,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'ALL', zigbeeCommandOptions: {manufacturerCode}, }), - numeric({ + m.numeric({ name: 'charging_limit', cluster: 'manuSpecificLumi', attribute: {ID: 0x0206, type: 0x39}, @@ -4444,7 +4418,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aqara', description: 'Ceiling light T1', extend: [ - deviceEndpoints({endpoints: {white: 1, rgb: 2}}), + m.deviceEndpoints({endpoints: {white: 1, rgb: 2}}), lumiLight({colorTemp: true, powerOutageMemory: 'light', endpointNames: ['white']}), lumiLight({colorTemp: true, deviceTemperature: false, powerOutageCount: false, color: {modes: ['xy', 'hs']}, endpointNames: ['rgb']}), lumiZigbeeOTA(), @@ -4456,10 +4430,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Aqara', description: 'Ceiling light T1M', extend: [ - deviceEndpoints({endpoints: {white: 1, rgb: 2}}), + m.deviceEndpoints({endpoints: {white: 1, rgb: 2}}), lumiLight({colorTemp: true, endpointNames: ['white']}), lumiLight({colorTemp: true, deviceTemperature: false, powerOutageCount: false, color: {modes: ['xy', 'hs']}, endpointNames: ['rgb']}), lumiZigbeeOTA(), + m.enumLookup({ + name: 'power_on_behaviour', + lookup: {on: 0, previous: 1, off: 2}, + cluster: 'manuSpecificLumi', + attribute: {ID: 0x0517, type: 0x20}, + description: 'Controls the behavior when the device is powered on after power loss', + zigbeeCommandOptions: {manufacturerCode}, + }), ], }, { @@ -4469,7 +4451,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Smart rotary knob H1 (with neutral)', extend: [ lumiPreventReset(), - deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), + m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), lumiOnOff({powerOutageMemory: 'binary', endpointNames: ['left', 'center', 'right']}), lumiCommandMode(), lumiAction({actionLookup: {hold: 0, single: 1, double: 2, release: 255}}), @@ -4484,7 +4466,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'VC-X01D', vendor: 'Aqara', description: 'Valve controller T1', - extend: [lumiZigbeeOTA(), onOff({powerOnBehavior: false}), battery()], + extend: [lumiZigbeeOTA(), m.onOff({powerOnBehavior: false}), m.battery()], }, ]; diff --git a/src/devices/lupus.ts b/src/devices/lupus.ts index bfed4cabf05ef..c0d8ec001fded 100644 --- a/src/devices/lupus.ts +++ b/src/devices/lupus.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -48,14 +48,14 @@ const definitions: DefinitionWithExtend[] = [ model: '12126', vendor: 'Lupus', description: '1 channel relay', - extend: [onOff({powerOnBehavior: false, ota: true})], + extend: [m.onOff({powerOnBehavior: false, ota: true})], }, { zigbeeModel: ['PRS3CH2_00.00.05.10TC', 'PRS3CH2_00.00.05.11TC', 'PRS3CH2_00.00.05.12TC'], model: '12127', vendor: 'Lupus', description: '2 channel relay', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2'], powerOnBehavior: false, ota: true})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2'], powerOnBehavior: false, ota: true})], }, ]; diff --git a/src/devices/lutron.ts b/src/devices/lutron.ts index 1df9a985f4950..9c1ffd33ee09f 100644 --- a/src/devices/lutron.ts +++ b/src/devices/lutron.ts @@ -1,5 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -22,7 +23,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Lutron', description: 'Aurora smart bulb dimmer', fromZigbee: [fz.command_move_to_level], - toZigbee: [], + extend: [m.battery()], exposes: [e.action(['brightness']), e.numeric('brightness', ea.STATE)], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); diff --git a/src/devices/m_elec.ts b/src/devices/m_elec.ts index de32832ff333e..b73dc9c4e8285 100644 --- a/src/devices/m_elec.ts +++ b/src/devices/m_elec.ts @@ -1,4 +1,4 @@ -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,28 +7,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'ML-ST-D200', vendor: 'M-ELEC', description: 'Stitchy dim switchable wall module', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ML-ST-D200-NF'], model: 'ML-ST-D200-NF', vendor: 'M-ELEC', description: 'Stitchy dim neutral free switchable wall module', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ML-ST-BP-DIM'], model: 'ML-ST-BP-DIM', vendor: 'M-ELEC', description: 'Stitchy dim mechanism', - extend: [light({effect: false})], + extend: [m.light({effect: false})], }, { zigbeeModel: ['ML-ST-R200'], model: 'ML-ST-R200', vendor: 'M-ELEC', description: 'Stitchy switchable wall module', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/matcall_bv.ts b/src/devices/matcall_bv.ts index 6fd20062a4a86..d7a5e8d4b325e 100644 --- a/src/devices/matcall_bv.ts +++ b/src/devices/matcall_bv.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZG401224', vendor: 'Matcall', description: 'LED dimmer driver', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZG 430700', 'ZG 430700'], model: 'ZG430700', vendor: 'Matcall', description: 'LED dimmer driver', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/mazda.ts b/src/devices/mazda.ts index a40ed86c0c367..44c7d56134b07 100644 --- a/src/devices/mazda.ts +++ b/src/devices/mazda.ts @@ -11,16 +11,7 @@ interface KeyValueStringEnum { const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - { - modelID: 'TS0601', - manufacturerName: '_TZE284_k6rdmisz', - }, - { - modelID: 'TS0601', - manufacturerName: '_TZE204_k6rdmisz', - }, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE284_k6rdmisz', '_TZE204_k6rdmisz']), model: 'TR-M2Z', vendor: 'MAZDA', description: 'Thermostatic radiator valve', @@ -31,7 +22,6 @@ const definitions: DefinitionWithExtend[] = [ exposes: [ e.battery(), e.child_lock(), - e.temperature(), e.window_detection(), tuya.exposes.frostProtection(), e.binary('alarm_switch', ea.STATE, 'ON', 'OFF').withDescription('Thermostat in error state'), diff --git a/src/devices/mercator.ts b/src/devices/mercator.ts index c82dec5ca2f4e..2c8244abb2014 100644 --- a/src/devices/mercator.ts +++ b/src/devices/mercator.ts @@ -9,7 +9,7 @@ const e = exposes.presets; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3210_yvxjawlt'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3210_yvxjawlt']), model: 'SPP04G', vendor: 'Mercator Ikuü', description: 'Quad power point', @@ -27,7 +27,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0202', manufacturerName: '_TYZB01_qjqgmqxr'}], + fingerprint: tuya.fingerprint('TS0202', ['_TYZB01_qjqgmqxr']), model: 'SMA02P', vendor: 'Mercator Ikuü', description: 'Motion detector', @@ -45,7 +45,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_82ptnsd4'}], + fingerprint: tuya.fingerprint('TS0201', ['_TZ3000_82ptnsd4']), model: 'SMA03P', vendor: 'Mercator Ikuü', description: 'Environmental sensor', @@ -55,7 +55,7 @@ const definitions: DefinitionWithExtend[] = [ configure: tuya.configureMagicPacket, }, { - fingerprint: [{modelID: 'TS0203', manufacturerName: '_TZ3000_wbrlnkm9'}], + fingerprint: tuya.fingerprint('TS0203', ['_TZ3000_wbrlnkm9']), model: 'SMA04P', vendor: 'Mercator Ikuü', description: 'Contact sensor', @@ -74,21 +74,21 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0502B', manufacturerName: '_TZ3000_6dwfra5l'}], + fingerprint: tuya.fingerprint('TS0502B', ['_TZ3000_6dwfra5l']), model: 'SMCL01-ZB', vendor: 'Mercator Ikuü', description: 'Ikon ceiling light', extend: [tuya.modernExtend.tuyaLight({colorTemp: {range: [153, 500]}})], }, { - fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3000_xr5m6kfg'}], + fingerprint: tuya.fingerprint('TS0505B', ['_TZ3000_xr5m6kfg']), model: 'SMD4109W-RGB-ZB', vendor: 'Mercator Ikuü', description: '92mm Walter downlight RGB + CCT', extend: [tuya.modernExtend.tuyaLight({colorTemp: {range: [153, 500]}, color: true})], }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3210_raqjcxo5'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3210_raqjcxo5']), model: 'SPP02G', vendor: 'Mercator Ikuü', description: 'Double power point', @@ -116,7 +116,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3210_7jnk7l3k'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3210_7jnk7l3k']), model: 'SPP02GIP', vendor: 'Mercator Ikuü', description: 'Double power point IP54', @@ -144,7 +144,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0013', manufacturerName: '_TZ3000_khtlvdfc'}], + fingerprint: tuya.fingerprint('TS0013', ['_TZ3000_khtlvdfc']), model: 'SSW03G', vendor: 'Mercator Ikuü', description: 'Triple switch', @@ -164,10 +164,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0501', manufacturerName: '_TZ3210_lzqq3u4r'}, - {modelID: 'TS0501', manufacturerName: '_TZ3210_4whigl8i'}, - ], + fingerprint: tuya.fingerprint('TS0501', ['_TZ3210_lzqq3u4r', '_TZ3210_4whigl8i']), model: 'SSWF01G', vendor: 'Mercator Ikuü', description: 'AC fan controller', @@ -187,7 +184,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3210_pfbzs1an'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3210_pfbzs1an']), model: 'SPPUSB02', vendor: 'Mercator Ikuü', description: 'Double power point with USB', diff --git a/src/devices/miboxer.ts b/src/devices/miboxer.ts index db27fb229ad61..50ee75f90b787 100644 --- a/src/devices/miboxer.ts +++ b/src/devices/miboxer.ts @@ -7,7 +7,7 @@ const e = exposes.presets; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0504B', manufacturerName: '_TZ3210_ttkgurpb'}], + fingerprint: tuya.fingerprint('TS0504B', ['_TZ3210_ttkgurpb']), model: 'FUT038Z', description: 'RGBW LED controller', vendor: 'MiBoxer', diff --git a/src/devices/micromatic.ts b/src/devices/micromatic.ts index 85f4ae83ac4dc..2a3b39ac7c739 100644 --- a/src/devices/micromatic.ts +++ b/src/devices/micromatic.ts @@ -1,4 +1,4 @@ -import {electricityMeter, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB250', vendor: 'Micro Matic Norge AS', description: 'Zigbee dimmer for LED', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], }, ]; diff --git a/src/devices/modular.ts b/src/devices/modular.ts index 4966681c7a126..9d55a9f75c338 100644 --- a/src/devices/modular.ts +++ b/src/devices/modular.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'MWM002', vendor: 'Modular', description: '0-10V Zigbee Dimmer', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/moes.ts b/src/devices/moes.ts index babcbaf9fe4c7..ec9221f2b7b68 100644 --- a/src/devices/moes.ts +++ b/src/devices/moes.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {actionEnumLookup, battery, deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -23,10 +23,7 @@ const exposesLocal = { const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS011F', manufacturerName: '_TZ3000_cymsnfvf'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_2xlvlnez'}, - ], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_cymsnfvf', '_TZ3000_2xlvlnez']), model: 'ZP-LZ-FR2U', vendor: 'Moes', description: 'Zigbee 3.0 dual USB wireless socket plug', @@ -44,11 +41,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0121', manufacturerName: '_TYZB01_iuepbmpv'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_zmy1waw6'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_bkfe0bab'}, - ], + fingerprint: [...tuya.fingerprint('TS0121', ['_TYZB01_iuepbmpv']), ...tuya.fingerprint('TS011F', ['_TZ3000_zmy1waw6', '_TZ3000_bkfe0bab'])], model: 'MS-104Z', description: 'Smart light switch module (1 gang)', vendor: 'Moes', @@ -90,7 +83,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZK-EU-2U', vendor: 'Moes', description: 'Zigbee 3.0 dual USB wireless socket plug', - extend: [onOff({endpointNames: ['l1', 'l2']})], + extend: [m.onOff({endpointNames: ['l1', 'l2']})], meta: {multiEndpoint: true}, endpoint: (device) => { const hasEndpoint2 = !!device.getEndpoint(2); @@ -98,16 +91,17 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_aoclfnxz'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ztvwu4nk'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_5toc8efa'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_5toc8efa'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ye5jkfsb'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_aoclfnxz'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_u9bfwha0'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_u9bfwha0'}, - ], + fingerprint: tuya.fingerprint('TS0601', [ + '_TZE200_aoclfnxz', + '_TZE200_ztvwu4nk', + '_TZE204_5toc8efa', + '_TZE200_5toc8efa', + '_TZE200_ye5jkfsb', + '_TZE204_aoclfnxz', + '_TZE200_u9bfwha0', + '_TZE204_u9bfwha0', + '_TZE204_xalsoe3m', + ]), model: 'BHT-002-GCLZB', vendor: 'Moes', description: 'Moes BHT series Thermostat', @@ -128,7 +122,6 @@ const definitions: DefinitionWithExtend[] = [ exposes: (device, options) => { const heatingStepSize = device?.manufacturerName === '_TZE204_5toc8efa' ? 0.5 : 1; return [ - e.linkquality(), e.child_lock(), e.deadzone_temperature(), e.max_temperature_limit().withValueMax(45), @@ -188,10 +181,7 @@ const definitions: DefinitionWithExtend[] = [ onEvent: tuya.onEventSetLocalTime, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_amp6tsvy'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_tviaymwx'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_amp6tsvy', '_TZE200_tviaymwx']), model: 'ZTS-EU_1gang', vendor: 'Moes', description: 'Wall touch light switch (1 gang)', @@ -213,7 +203,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_g1ib5ldv'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_g1ib5ldv']), model: 'ZTS-EU_2gang', vendor: 'Moes', description: 'Wall touch light switch (2 gang)', @@ -242,7 +232,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_tz32mtza'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_tz32mtza']), model: 'ZTS-EU_3gang', vendor: 'Moes', description: 'Wall touch light switch (3 gang)', @@ -273,7 +263,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_1ozguk6x'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_1ozguk6x']), model: 'ZTS-EU_4gang', vendor: 'Moes', description: 'Wall touch light switch (4 gang)', @@ -306,22 +296,17 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0222', manufacturerName: '_TYZB01_kvwjujy9'}, - {modelID: 'TS0222', manufacturerName: '_TYZB01_ftdkanlj'}, - ], + fingerprint: tuya.fingerprint('TS0222', ['_TYZB01_kvwjujy9', '_TYZB01_ftdkanlj']), model: 'ZSS-ZK-THL', vendor: 'Moes', description: 'Smart temperature and humidity meter with display', - fromZigbee: [fz.battery, fz.illuminance, fz.humidity, fz.temperature], + fromZigbee: [fz.battery, fz.humidity, fz.temperature], toZigbee: [], - exposes: [e.battery(), e.illuminance(), e.humidity(), e.temperature()], + exposes: [e.battery(), e.humidity(), e.temperature()], + extend: [m.illuminance()], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_b6wax7g0'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_qsoecqlk'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_b6wax7g0', '_TZE200_qsoecqlk']), model: 'BRT-100-TRV', vendor: 'Moes', description: 'Thermostatic radiator valve', @@ -359,8 +344,8 @@ const definitions: DefinitionWithExtend[] = [ e .climate() .withLocalTemperature(ea.STATE) - .withSetpoint('current_heating_setpoint', 0, 35, 1, ea.STATE_SET) - .withLocalTemperatureCalibration(-9, 9, 1, ea.STATE_SET) + .withSetpoint('current_heating_setpoint', 0, 35, 0.5, ea.STATE_SET) + .withLocalTemperatureCalibration(-9, 9, 0.5, ea.STATE_SET) .withSystemMode(['heat'], ea.STATE_SET) .withRunningState(['idle', 'heat'], ea.STATE) .withPreset( @@ -397,7 +382,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_nhyj64w2'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_nhyj64w2', '_TZE200_127x7wnl']), model: 'ZTS-EUR-C', vendor: 'Moes', description: 'Zigbee + RF curtain switch', @@ -412,12 +397,12 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS1201', manufacturerName: '_TZ3290_j37rooaxrcdcqo5n'}, - {modelID: 'TS1201', manufacturerName: '_TZ3290_ot6ewjvmejq5ekhl'}, - {modelID: 'TS1201', manufacturerName: '_TZ3290_xjpbcxn92aaxvmlz'}, - {modelID: 'TS1201', manufacturerName: '_TZ3290_gnl5a6a5xvql7c2a'}, - ], + fingerprint: tuya.fingerprint('TS1201', [ + '_TZ3290_j37rooaxrcdcqo5n', + '_TZ3290_ot6ewjvmejq5ekhl', + '_TZ3290_xjpbcxn92aaxvmlz', + '_TZ3290_gnl5a6a5xvql7c2a', + ]), model: 'UFO-R11', vendor: 'Moes', description: 'Universal smart IR remote control', @@ -432,7 +417,7 @@ const definitions: DefinitionWithExtend[] = [ ], toZigbee: [tzZosung.zosung_ir_code_to_send, tzZosung.zosung_learn_ir_code], exposes: (device, options) => { - const exposes = [ez.learn_ir_code(), ez.learned_ir_code(), ez.ir_code_to_send(), e.linkquality()]; + const exposes = [ez.learn_ir_code(), ez.learned_ir_code(), ez.ir_code_to_send()]; if (device?.manufacturerName !== '') { exposes.push(e.battery(), e.battery_voltage()); } @@ -454,10 +439,10 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZWV-YC', vendor: 'Moes', description: 'Water valve', - extend: [battery(), onOff({powerOnBehavior: false})], + extend: [m.battery(), m.onOff({powerOnBehavior: false})], }, { - fingerprint: [{modelID: 'TS0011', manufacturerName: '_TZ3000_hhiodade'}], + fingerprint: tuya.fingerprint('TS0011', ['_TZ3000_hhiodade']), model: 'ZS-EUB_1gang', vendor: 'Moes', description: 'Wall light switch (1 gang)', @@ -489,7 +474,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('HEIMAN', 'HS-720ES', 'Carbon monoxide alarm', ['_TZE200_hr0tdd47'])], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_vawy74yh'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_vawy74yh']), model: 'ZSS-HM-SSD01', vendor: 'Moes', description: 'Smoke sensor', @@ -515,11 +500,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS004F', manufacturerName: '_TZ3000_ja5osu5g'}, - {modelID: 'TS004F', manufacturerName: '_TZ3000_kjfzuycl'}, - {modelID: 'TS004F', manufacturerName: '_TZ3000_egvb1p2g'}, - ], + fingerprint: tuya.fingerprint('TS004F', ['_TZ3000_ja5osu5g', '_TZ3000_kjfzuycl', '_TZ3000_egvb1p2g']), model: 'ERS-10TZBVB-AA', vendor: 'Moes', description: 'Smart button', @@ -591,15 +572,15 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0726', manufacturerName: '_TZ3002_vaq2bfcu'}], + fingerprint: tuya.fingerprint('TS0726', ['_TZ3002_vaq2bfcu']), model: 'SR-ZS', vendor: 'Moes', description: 'Smart switch (light + sence)', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1', 'l2', 'l3'], powerOnBehavior2: true, switchMode: true}), - actionEnumLookup({ + m.actionEnumLookup({ cluster: 'genOnOff', commands: ['commandTuyaAction'], attribute: 'value', diff --git a/src/devices/muller_licht.ts b/src/devices/muller_licht.ts index 6fd04f6d9e303..fe8c1ebf17828 100644 --- a/src/devices/muller_licht.ts +++ b/src/devices/muller_licht.ts @@ -1,15 +1,15 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {LightArgs, light as lightDontUse, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend, Zh} from '../lib/types'; const e = exposes.presets; -function mullerLichtLight(args: LightArgs) { - const result = lightDontUse(args); +function mullerLichtLight(args: m.LightArgs) { + const result = m.light(args); result.toZigbee.push(tz.tint_scene); return result; } @@ -48,14 +48,14 @@ const definitions: DefinitionWithExtend[] = [ model: '404017', vendor: 'Müller Licht', description: 'Smart power strip', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['tint smart power strip'], model: '45391', vendor: 'Müller Licht', description: 'Smart power strip', - extend: [onOff()], + extend: [m.onOff()], }, { // Identify through fingerprint as modelID is the same as Airam 4713407 @@ -111,10 +111,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [mullerLichtLight({colorTemp: {range: [153, 555]}, color: true})], }, { - fingerprint: [ - {modelID: 'TS0505B', manufacturerName: '_TZ3210_mntza0sw'}, - {modelID: 'TS0505B', manufacturerName: '_TZ3210_r0vzq1oj'}, - ], + fingerprint: tuya.fingerprint('TS0505B', ['_TZ3210_mntza0sw', '_TZ3210_r0vzq1oj']), model: '404062', vendor: 'Müller Licht', description: 'Kea RGB+CCT', @@ -190,7 +187,7 @@ const definitions: DefinitionWithExtend[] = [ model: '404021', description: 'Tint smart switch', vendor: 'Müller Licht', - extend: [onOff()], + extend: [m.onOff()], }, { fingerprint: [{modelID: 'Remote Control', manufacturerName: 'MLI'}], diff --git a/src/devices/multiterm.ts b/src/devices/multiterm.ts index c27102ffcb58c..05b77a5bbdc14 100644 --- a/src/devices/multiterm.ts +++ b/src/devices/multiterm.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -65,7 +65,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZC0101', vendor: 'MultiTerm', description: 'ZeeFan fan coil unit controller', - extend: [deviceEndpoints({endpoints: {'8': 8, '9': 9, '10': 10}})], + extend: [m.deviceEndpoints({endpoints: {'8': 8, '9': 9, '10': 10}})], meta: {multiEndpoint: true}, fromZigbee: [fz.fan, fzLocal.binary_output], toZigbee: [tzLocal.fan_mode, tzLocal.binary_output], diff --git a/src/devices/namron.ts b/src/devices/namron.ts index f697f39d6f5da..b3ecd43f5aa99 100644 --- a/src/devices/namron.ts +++ b/src/devices/namron.ts @@ -4,7 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {binary, electricityMeter, enumLookup, forcePowerSource, light, numeric, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import * as tuya from '../lib/tuya'; @@ -120,14 +120,14 @@ const definitions: DefinitionWithExtend[] = [ model: '3308431', vendor: 'Namron', description: 'Luna ceiling light', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['3802967'], model: '3802967', vendor: 'Namron', description: 'Led bulb 6w RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['4512700'], @@ -135,7 +135,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Namron', description: 'Zigbee dimmer 400W', ota: true, - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['4512760'], @@ -143,14 +143,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Namron', description: 'Zigbee dimmer 400W', ota: true, - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['4512708'], model: '4512708', vendor: 'Namron', description: 'Zigbee LED dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['4512766'], @@ -158,7 +158,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Namron', description: 'Zigbee smart plug 16A', ota: true, - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['4512767'], @@ -166,14 +166,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Namron', description: 'Zigbee smart plug 16A', ota: true, - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['1402767'], model: '1402767', vendor: 'Namron', description: 'Zigbee LED dimmer', - extend: [light({effect: false, configureReporting: true}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.light({effect: false, configureReporting: true}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], meta: {disableDefaultResponse: true}, }, { @@ -181,21 +181,21 @@ const definitions: DefinitionWithExtend[] = [ model: '1402768', vendor: 'Namron', description: 'Zigbee LED dimmer TW 250W', - extend: [light({effect: false, configureReporting: true, colorTemp: {range: [250, 65279]}})], + extend: [m.light({effect: false, configureReporting: true, colorTemp: {range: [250, 65279]}})], }, { zigbeeModel: ['4512733'], model: '4512733', vendor: 'Namron', description: 'ZigBee dimmer 2-pol 400W', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['4512704'], model: '4512704', vendor: 'Namron', description: 'Zigbee switch 400W', - extend: [onOff()], + extend: [m.onOff()], ota: true, }, { @@ -203,7 +203,7 @@ const definitions: DefinitionWithExtend[] = [ model: '1402755', vendor: 'Namron', description: 'ZigBee LED dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['4512703'], @@ -304,7 +304,7 @@ const definitions: DefinitionWithExtend[] = [ model: '1402769', vendor: 'Namron', description: 'ZigBee LED dimmer', - extend: [light({configureReporting: true}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.light({configureReporting: true}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['4512702'], @@ -351,7 +351,7 @@ const definitions: DefinitionWithExtend[] = [ model: '4512707', vendor: 'Namron', description: 'Zigbee LED-Controller', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['4512726'], @@ -489,56 +489,56 @@ const definitions: DefinitionWithExtend[] = [ model: '3802960', vendor: 'Namron', description: 'LED 9W DIM E27', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['3802961'], model: '3802961', vendor: 'Namron', description: 'LED 9W CCT E27', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['3802962'], model: '3802962', vendor: 'Namron', description: 'LED 9W RGBW E27', - extend: [light({colorTemp: {range: undefined}, color: true, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['3802963'], model: '3802963', vendor: 'Namron', description: 'LED 5,3W DIM E14', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['3802964'], model: '3802964', vendor: 'Namron', description: 'LED 5,3W CCT E14', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['3802965'], model: '3802965', vendor: 'Namron', description: 'LED 4,8W DIM GU10', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['3802966'], model: '3802966', vendor: 'Namron', description: 'LED 4.8W CCT GU10', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['89665'], model: '89665', vendor: 'Namron', description: 'LED Strip RGB+W (5m) IP20', - extend: [light({colorTemp: {range: undefined}, color: true, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['4512737', '4512738'], @@ -1053,7 +1053,7 @@ const definitions: DefinitionWithExtend[] = [ model: '3802968', vendor: 'Namron', description: 'LED Filament Flex 5W CCT E27 Clear', - extend: [light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, turnsOffAtBrightness1: true})], }, { zigbeeModel: ['4512749'], @@ -1141,9 +1141,9 @@ const definitions: DefinitionWithExtend[] = [ tz.namron_thermostat_child_lock, ], extend: [ - onOff({powerOnBehavior: false}), - electricityMeter({voltage: false}), - binary({ + m.onOff({powerOnBehavior: false}), + m.electricityMeter({voltage: false}), + m.binary({ name: 'away_mode', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -1151,7 +1151,7 @@ const definitions: DefinitionWithExtend[] = [ attribute: {ID: 0x8001, type: Zcl.DataType.BOOLEAN}, description: 'Enable or Disable Away/Anti-freeze mode', }), - binary({ + m.binary({ name: 'window_open_check', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -1160,7 +1160,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Enable or Disable open window detection', entityCategory: 'config', }), - binary({ + m.binary({ name: 'window_open', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -1169,7 +1169,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'On if window is currently detected as open', }), - numeric({ + m.numeric({ name: 'backlight_level', unit: '%', valueMin: 0, @@ -1180,7 +1180,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Brightness of the display', entityCategory: 'config', }), - binary({ + m.binary({ name: 'backlight_onoff', valueOn: ['ON', 1], valueOff: ['OFF', 0], @@ -1190,7 +1190,7 @@ const definitions: DefinitionWithExtend[] = [ entityCategory: 'config', }), - enumLookup({ + m.enumLookup({ name: 'sensor_mode', lookup: {air: 0, floor: 1, both: 2, percent: 6}, cluster: 'hvacThermostat', @@ -1286,7 +1286,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Namron', description: 'Zigbee dimmer 2.0', ota: true, - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], whiteLabel: [{vendor: 'Namron', model: '4512751', description: 'Zigbee dimmer 2.0', fingerprint: [{modelID: '4512751'}]}], }, { @@ -1383,18 +1383,17 @@ const definitions: DefinitionWithExtend[] = [ model: '4512770', vendor: 'Namron', description: 'Zigbee multisensor (white)', - fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.temperature, fz.humidity, fz.illuminance], + fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.temperature, fz.humidity], toZigbee: [], - exposes: [e.occupancy(), e.battery(), e.battery_voltage(), e.illuminance(), e.temperature(), e.humidity()], + exposes: [e.occupancy(), e.battery(), e.battery_voltage(), e.temperature(), e.humidity()], whiteLabel: [{vendor: 'Namron', model: '4512771', description: 'Zigbee multisensor (black)', fingerprint: [{modelID: '4512771'}]}], configure: async (device, coordinatorEndpoint) => { const endpoint3 = device.getEndpoint(3); const endpoint4 = device.getEndpoint(4); - const endpoint5 = device.getEndpoint(5); await reporting.bind(endpoint3, coordinatorEndpoint, ['msTemperatureMeasurement']); await reporting.bind(endpoint4, coordinatorEndpoint, ['msRelativeHumidity']); - await reporting.bind(endpoint5, coordinatorEndpoint, ['msIlluminanceMeasurement']); }, + extend: [m.illuminance()], }, { fingerprint: tuya.fingerprint('TS0601', ['_TZE204_p3lqqy2r']), @@ -1507,8 +1506,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Namron', description: 'Rotary dimmer with screen', extend: [ - light({effect: false, configureReporting: true, powerOnBehavior: false}), - electricityMeter({voltage: false, current: false, configureReporting: true}), + m.light({effect: false, configureReporting: true, powerOnBehavior: false}), + m.electricityMeter({voltage: false, current: false, configureReporting: true}), ], meta: {}, }, @@ -1517,7 +1516,7 @@ const definitions: DefinitionWithExtend[] = [ model: '4512788', vendor: 'Namron', description: 'Zigbee smart plug dimmer 150W', - extend: [light(), electricityMeter({cluster: 'electrical'})], + extend: [m.light(), m.electricityMeter({cluster: 'electrical'})], }, ]; diff --git a/src/devices/nanoleaf.ts b/src/devices/nanoleaf.ts index 90ce4c35b1186..34a0e41e63f88 100644 --- a/src/devices/nanoleaf.ts +++ b/src/devices/nanoleaf.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'NL08-0800', vendor: 'Nanoleaf', description: 'Smart Ivy Bulb E27', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/nedis.ts b/src/devices/nedis.ts index f1bcbb30ff73b..7710c3d79d010 100644 --- a/src/devices/nedis.ts +++ b/src/devices/nedis.ts @@ -7,7 +7,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ne4pikwm']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ne4pikwm', '_TZE284_ne4pikwm']), model: 'ZBHTR20WT', vendor: 'Nedis', description: 'Thermostat radiator valve', diff --git a/src/devices/neo.ts b/src/devices/neo.ts index d28f4fc69267d..f0f72b0e93b10 100644 --- a/src/devices/neo.ts +++ b/src/devices/neo.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {battery, humidity, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -10,7 +10,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_d0yu2xgi'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_d0yu2xgi']), zigbeeModel: ['0yu2xgi'], model: 'NAS-AB02B0', vendor: 'Neo', @@ -72,7 +72,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_7hfcudw5'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_7hfcudw5']), model: 'NAS-PD07', vendor: 'Neo', description: 'Motion, temperature & humidity sensor', @@ -451,11 +451,11 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'SNZB-02', manufacturerName: '_TZ3000_utwgoauk'}], + fingerprint: tuya.fingerprint('SNZB-02', ['_TZ3000_utwgoauk']), model: 'NAS-TH07B2', vendor: 'NEO', description: 'Temperature & humidity sensor', - extend: [temperature(), humidity(), battery()], + extend: [m.temperature(), m.humidity(), m.battery()], }, { fingerprint: tuya.fingerprint('TS0601', ['_TZE204_1youk3hj']), diff --git a/src/devices/nexelec.ts b/src/devices/nexelec.ts index f387a26f1707c..2a18ac0d18035 100644 --- a/src/devices/nexelec.ts +++ b/src/devices/nexelec.ts @@ -1,4 +1,4 @@ -import {battery, co2, humidity, identify, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: "Open'R", vendor: 'Nexelec', description: "Open'R CO2, Temperature and Humidity sensor", - extend: [temperature(), humidity(), co2(), battery(), identify()], + extend: [m.temperature(), m.humidity(), m.co2(), m.battery(), m.identify()], }, ]; diff --git a/src/devices/niviss.ts b/src/devices/niviss.ts index bde1098de5e75..9daceb488707d 100644 --- a/src/devices/niviss.ts +++ b/src/devices/niviss.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'PS-ZIGBEE-SMART-CONTROLER-1CH-DIMMABLE', vendor: 'Niviss', description: 'Zigbee smart controller', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/nodon.ts b/src/devices/nodon.ts index a47c1629307b0..57e443cb47593 100644 --- a/src/devices/nodon.ts +++ b/src/devices/nodon.ts @@ -4,18 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import { - battery, - deviceEndpoints, - enumLookup, - EnumLookupArgs, - humidity, - numeric, - NumericArgs, - onOff, - temperature, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {nodonPilotWire} from '../lib/nodon'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -24,8 +13,8 @@ const e = exposes.presets; const ea = exposes.access; const nodonModernExtend = { - calibrationVerticalRunTimeUp: (args?: Partial) => - numeric({ + calibrationVerticalRunTimeUp: (args?: Partial) => + m.numeric({ name: 'calibration_vertical_run_time_up', unit: '10 ms', cluster: 'closuresWindowCovering', @@ -40,8 +29,8 @@ const nodonModernExtend = { zigbeeCommandOptions: {manufacturerCode: 0x128b}, ...args, }), - calibrationVerticalRunTimeDowm: (args?: Partial) => - numeric({ + calibrationVerticalRunTimeDowm: (args?: Partial) => + m.numeric({ name: 'calibration_vertical_run_time_down', unit: '10 ms', cluster: 'closuresWindowCovering', @@ -56,8 +45,8 @@ const nodonModernExtend = { zigbeeCommandOptions: {manufacturerCode: 0x128b}, ...args, }), - calibrationRotationRunTimeUp: (args?: Partial) => - numeric({ + calibrationRotationRunTimeUp: (args?: Partial) => + m.numeric({ name: 'calibration_rotation_run_time_up', unit: 'ms', cluster: 'closuresWindowCovering', @@ -72,8 +61,8 @@ const nodonModernExtend = { zigbeeCommandOptions: {manufacturerCode: 0x128b}, ...args, }), - calibrationRotationRunTimeDown: (args?: Partial) => - numeric({ + calibrationRotationRunTimeDown: (args?: Partial) => + m.numeric({ name: 'calibration_rotation_run_time_down', unit: 'ms', cluster: 'closuresWindowCovering', @@ -88,8 +77,8 @@ const nodonModernExtend = { zigbeeCommandOptions: {manufacturerCode: 0x128b}, ...args, }), - dryContact: (args?: Partial) => - enumLookup({ + dryContact: (args?: Partial) => + m.enumLookup({ name: 'dry_contact', lookup: {contact_closed: 0x00, contact_open: 0x01}, cluster: 'genBinaryInput', @@ -97,8 +86,8 @@ const nodonModernExtend = { description: 'State of the contact, closed or open.', ...args, }), - impulseMode: (args?: Partial) => - numeric({ + impulseMode: (args?: Partial) => + m.numeric({ name: 'impulse_mode_configuration', unit: 'ms', cluster: 'genOnOff', @@ -109,8 +98,8 @@ const nodonModernExtend = { description: 'Set the impulse duration in milliseconds (set value to 0 to deactivate the impulse mode).', zigbeeCommandOptions: {manufacturerCode: Zcl.ManufacturerCode.NODON}, }), - switchType: (args?: Partial) => - enumLookup({ + switchType: (args?: Partial) => + m.enumLookup({ name: 'switch_type', lookup: {bistable: 0x00, monostable: 0x01, auto_detect: 0x02}, cluster: 'genOnOff', @@ -119,8 +108,8 @@ const nodonModernExtend = { zigbeeCommandOptions: {manufacturerCode: Zcl.ManufacturerCode.NODON}, ...args, }), - trvMode: (args?: Partial) => - enumLookup({ + trvMode: (args?: Partial) => + m.enumLookup({ name: 'trv_mode', lookup: {auto: 0x00, valve_position_mode: 0x01, manual: 0x02}, cluster: 'hvacThermostat', @@ -133,8 +122,8 @@ const nodonModernExtend = { zigbeeCommandOptions: {manufacturerCode: Zcl.ManufacturerCode.NXP_SEMICONDUCTORS}, ...args, }), - valvePosition: (args?: Partial) => - numeric({ + valvePosition: (args?: Partial) => + m.numeric({ name: 'valve_position', cluster: 'hvacThermostat', attribute: {ID: 0x4001, type: Zcl.DataType.UINT8}, @@ -157,7 +146,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SDC-4-1-00', vendor: 'NodOn', description: 'Dry contact sensor', - extend: [battery(), nodonModernExtend.dryContact()], + extend: [m.battery(), nodonModernExtend.dryContact()], ota: true, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); @@ -186,7 +175,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'NodOn', description: 'Roller shutter relay switch', extend: [ - windowCovering({controls: ['tilt', 'lift'], coverMode: true}), + m.windowCovering({controls: ['tilt', 'lift'], coverMode: true}), nodonModernExtend.calibrationVerticalRunTimeUp(), nodonModernExtend.calibrationVerticalRunTimeDowm(), nodonModernExtend.calibrationRotationRunTimeUp(), @@ -200,7 +189,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'NodOn', description: 'Roller shutter relay switch', extend: [ - windowCovering({controls: ['tilt', 'lift'], coverMode: true}), + m.windowCovering({controls: ['tilt', 'lift'], coverMode: true}), nodonModernExtend.calibrationVerticalRunTimeUp(), nodonModernExtend.calibrationVerticalRunTimeDowm(), nodonModernExtend.calibrationRotationRunTimeUp(), @@ -213,7 +202,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SIN-4-1-20', vendor: 'NodOn', description: 'Multifunction relay switch', - extend: [onOff({ota: true}), nodonModernExtend.impulseMode(), nodonModernExtend.switchType()], + extend: [m.onOff({ota: true}), nodonModernExtend.impulseMode(), nodonModernExtend.switchType()], endpoint: (device) => { return {default: 1}; }, @@ -223,7 +212,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SIN-4-1-20_PRO', vendor: 'NodOn', description: 'Multifunction relay switch', - extend: [onOff({ota: true}), nodonModernExtend.impulseMode(), nodonModernExtend.switchType()], + extend: [m.onOff({ota: true}), nodonModernExtend.impulseMode(), nodonModernExtend.switchType()], endpoint: (device) => { return {default: 1}; }, @@ -253,8 +242,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'NodOn', description: 'Lighting relay switch', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), - onOff({endpointNames: ['l1', 'l2']}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.onOff({endpointNames: ['l1', 'l2']}), nodonModernExtend.switchType({endpointName: 'l1'}), nodonModernExtend.switchType({endpointName: 'l2'}), ], @@ -266,8 +255,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'NodOn', description: 'Lighting relay switch', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), - onOff({endpointNames: ['l1', 'l2']}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.onOff({endpointNames: ['l1', 'l2']}), nodonModernExtend.switchType({endpointName: 'l1'}), nodonModernExtend.switchType({endpointName: 'l2'}), ], @@ -316,7 +305,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'STPH-4-1-00', vendor: 'NodOn', description: 'Temperature & humidity sensor', - extend: [battery(), temperature(), humidity()], + extend: [m.battery(), m.temperature(), m.humidity()], ota: true, }, { @@ -324,7 +313,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TRV-4-1-00', vendor: 'NodOn', description: 'Thermostatic Radiateur Valve', - extend: [battery(), nodonModernExtend.trvMode(), nodonModernExtend.valvePosition()], + extend: [m.battery(), nodonModernExtend.trvMode(), nodonModernExtend.valvePosition()], fromZigbee: [fz.thermostat], toZigbee: [ tz.thermostat_local_temperature, diff --git a/src/devices/nordtronic.ts b/src/devices/nordtronic.ts index 05eb2a60f427a..f6188e798a796 100644 --- a/src/devices/nordtronic.ts +++ b/src/devices/nordtronic.ts @@ -1,4 +1,4 @@ -import {battery, commandsColorCtrl, commandsLevelCtrl, commandsOnOff, electricityMeter, identify, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -12,28 +12,28 @@ const definitions: DefinitionWithExtend[] = [ model: '98426061', vendor: 'Nordtronic', description: 'Remote Control', - extend: [battery(), identify(), commandsOnOff(), commandsLevelCtrl(), commandsColorCtrl()], + extend: [m.battery(), m.identify(), m.commandsOnOff(), m.commandsLevelCtrl(), m.commandsColorCtrl()], }, { zigbeeModel: ['BoxDIM2 98425031', '98425031', 'BoxDIMZ 98425031'], model: '98425031', vendor: 'Nordtronic', description: 'Box Dimmer 2.0', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['BoxRelay2 98423051', '98423051', 'BoxRelayZ 98423051'], model: '98423051', vendor: 'Nordtronic', description: 'Zigbee switch 400W', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['RotDIM2 98424072', '98424072', 'RotDIMZ 98424072'], model: '98424072', vendor: 'Nordtronic', description: 'Zigbee rotary dimmer', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], }, ]; diff --git a/src/devices/nous.ts b/src/devices/nous.ts index 004b777670bcb..399781c716fa1 100644 --- a/src/devices/nous.ts +++ b/src/devices/nous.ts @@ -10,7 +10,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_lbtpiody'}], + fingerprint: tuya.fingerprint('TS0201', ['_TZ3000_lbtpiody']), model: 'E5', vendor: 'Nous', description: 'Temperature & humidity', @@ -19,16 +19,16 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.temperature(), e.humidity(), e.battery()], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_lve3dvpy'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_c7emyjom'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_locansqn'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_qrztc3ev'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_snloy4rw'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_eanjj2pa'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ydrdfkim'}, - {modelID: 'TS0601', manufacturerName: '_TZE284_locansqn'}, - ], + fingerprint: tuya.fingerprint('TS0601', [ + '_TZE200_lve3dvpy', + '_TZE200_c7emyjom', + '_TZE200_locansqn', + '_TZE200_qrztc3ev', + '_TZE200_snloy4rw', + '_TZE200_eanjj2pa', + '_TZE200_ydrdfkim', + '_TZE284_locansqn', + ]), model: 'SZ-T04', vendor: 'Nous', whiteLabel: [tuya.whitelabel('Tuya', 'TH01Z', 'Temperature and humidity sensor with clock', ['_TZE200_locansqn'])], diff --git a/src/devices/novo.ts b/src/devices/novo.ts index cdbb55f5cb25a..36dacc3549761 100644 --- a/src/devices/novo.ts +++ b/src/devices/novo.ts @@ -1,6 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -8,7 +9,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_swhwv3k3'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_swhwv3k3']), model: 'C10-3E-1.2', vendor: 'Novo', description: 'Curtain switch', diff --git a/src/devices/nue_3a.ts b/src/devices/nue_3a.ts index 5d7ee24a52365..8335a91d0f0c9 100644 --- a/src/devices/nue_3a.ts +++ b/src/devices/nue_3a.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, forcePowerSource, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue} from '../lib/types'; import * as utils from '../lib/utils'; @@ -40,7 +40,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HGZB-01', vendor: 'Nue / 3A', description: 'Smart Zigbee 3.0 light controller', - extend: [onOff({powerOnBehavior: false}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff({powerOnBehavior: false}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], whiteLabel: [ {vendor: 'Zemismart', model: 'ZW-EU-01', description: 'Smart light relay - 1 gang'}, {vendor: 'Moes', model: 'ZK-CH-2U', description: 'Plug with 2 USB ports'}, @@ -51,7 +51,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LXN59-2S7LX1.0', vendor: 'Nue / 3A', description: 'Smart light relay - 2 gang', - extend: [deviceEndpoints({endpoints: {left: 1, right: 2}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, right: 2}}), m.onOff({endpointNames: ['left', 'right']})], whiteLabel: [{vendor: 'Zemismart', model: 'ZW-EU-02'}], }, { @@ -86,28 +86,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'LXZB-02A', vendor: 'Nue / 3A', description: 'Smart light controller', - extend: [light({powerOnBehavior: false})], + extend: [m.light({powerOnBehavior: false})], }, { zigbeeModel: ['FNB56-ZSW03LX2.0', 'LXN-3S27LX1.0'], model: 'HGZB-43', vendor: 'Nue / 3A', description: 'Smart light switch - 3 gang v2.0', - extend: [deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), onOff({endpointNames: ['top', 'center', 'bottom']})], + extend: [m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), m.onOff({endpointNames: ['top', 'center', 'bottom']})], }, { zigbeeModel: ['LXN-4S27LX1.0'], model: 'HGZB-4S', vendor: 'Nue / 3A', description: 'Smart light switch - 4 gang v2.0', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), onOff({endpointNames: ['l1', 'l2', 'l3', 'l4']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4']})], }, { zigbeeModel: ['FB56+ZSW1IKJ1.7', 'FB56+ZSW1IKJ2.5', 'FB56+ZSW1IKJ2.7'], model: 'HGZB-043', vendor: 'Nue / 3A', description: 'Smart light switch - 3 gang', - extend: [deviceEndpoints({endpoints: {top: 16, center: 17, bottom: 18}}), onOff({endpointNames: ['top', 'center', 'bottom']})], + extend: [m.deviceEndpoints({endpoints: {top: 16, center: 17, bottom: 18}}), m.onOff({endpointNames: ['top', 'center', 'bottom']})], }, { zigbeeModel: ['FB56+ZSW1JKJ2.7'], @@ -115,8 +115,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Nue / 3A', description: 'Smart light switch - 4 gang v2.0', extend: [ - deviceEndpoints({endpoints: {top_left: 16, top_right: 17, bottom_right: 18, bottom_left: 19}}), - onOff({endpointNames: ['top_left', 'top_right', 'bottom_right', 'bottom_left']}), + m.deviceEndpoints({endpoints: {top_left: 16, top_right: 17, bottom_right: 18, bottom_left: 19}}), + m.onOff({endpointNames: ['top_left', 'top_right', 'bottom_right', 'bottom_left']}), ], }, { @@ -124,7 +124,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HGZB-04D / HGZB-4D-UK', vendor: 'Nue / 3A', description: 'Smart dimmer wall switch', - extend: [light({effect: false, configureReporting: true})], + extend: [m.light({effect: false, configureReporting: true})], whiteLabel: [{vendor: 'Sunricher', model: 'SR-ZG9001K8-DIM'}], }, { @@ -132,7 +132,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HGZB-042', vendor: 'Nue / 3A', description: 'Smart light switch - 2 gang', - extend: [deviceEndpoints({endpoints: {top: 16, bottom: 17}}), onOff({endpointNames: ['top', 'bottom']})], + extend: [m.deviceEndpoints({endpoints: {top: 16, bottom: 17}}), m.onOff({endpointNames: ['top', 'bottom']})], }, { fingerprint: [ @@ -150,7 +150,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HGZB-42', vendor: 'Nue / 3A', description: 'Smart light switch - 2 gang v2.0', - extend: [deviceEndpoints({endpoints: {top: 11, bottom: 12}}), onOff({endpointNames: ['top', 'bottom'], configureReporting: false})], + extend: [m.deviceEndpoints({endpoints: {top: 11, bottom: 12}}), m.onOff({endpointNames: ['top', 'bottom'], configureReporting: false})], configure: async (device, coordinatorEndpoint) => { // ConfigureReporting for onOff fails // https://github.com/Koenkk/zigbee2mqtt/issues/20867 @@ -163,28 +163,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'HGZB-20A', vendor: 'Nue / 3A', description: 'Power plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['FB56+ZSW1GKJ2.5', 'LXN-1S27LX1.0', 'FB56+ZSW1GKJ2.7'], model: 'HGZB-41', vendor: 'Nue / 3A', description: 'Smart one gang wall switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['FNB56-SKT1DHG1.4'], model: 'MG-AUWS01', vendor: 'Nue / 3A', description: 'Smart Double GPO', - extend: [deviceEndpoints({endpoints: {left: 11, right: 12}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 11, right: 12}}), m.onOff({endpointNames: ['left', 'right']})], }, { zigbeeModel: ['LXN56-TS27LX1.2'], model: 'LXN56-TS27LX1.2', vendor: 'Nue / 3A', description: 'Smart double GPO', - extend: [deviceEndpoints({endpoints: {left: 1, right: 2}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, right: 2}}), m.onOff({endpointNames: ['left', 'right']})], }, { @@ -192,35 +192,35 @@ const definitions: DefinitionWithExtend[] = [ model: 'XY12S-15', vendor: 'Nue / 3A', description: 'Smart light controller RGBW', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['FNB56-ZSW23HG1.1', 'LXN56-LC27LX1.1', 'LXN56-LC27LX1.3'], model: 'HGZB-01A', vendor: 'Nue / 3A', description: 'Smart in-wall switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['FNB56-ZSC01LX1.2', 'FB56+ZSW05HG1.2', 'FB56+ZSC04HG1.0'], model: 'HGZB-02A', vendor: 'Nue / 3A', description: 'Smart light controller', - extend: [light({powerOnBehavior: false})], + extend: [m.light({powerOnBehavior: false})], }, { zigbeeModel: ['FNB56-ZSW01LX2.0'], model: 'HGZB-42-UK / HGZB-41 / HGZB-41-UK', description: 'Smart switch 1 or 2 gang', vendor: 'Nue / 3A', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['FNB56-ZCW25FB1.6', 'FNB56-ZCW25FB2.1'], model: 'HGZB-06A', vendor: 'Nue / 3A', description: 'Smart 7W E27 light bulb', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['LXN59-CS27LX1.0'], @@ -246,21 +246,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZW-EC-01', vendor: 'Nue / 3A', description: 'Zigbee smart curtain switch', - extend: [onOff(), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff(), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['LXN56-0S27LX1.1', 'LXN56-0S27LX1.2', 'LXN56-0S27LX1.3'], model: 'HGZB-20-UK', vendor: 'Nue / 3A', description: 'Power plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['NUET56-DL27LX1.2'], model: 'HGZB-DLC4-N12B', vendor: 'Nue / 3A', description: 'RGB LED downlight', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['FB56-WTS04HM1.1'], @@ -285,14 +285,14 @@ const definitions: DefinitionWithExtend[] = [ model: '3A12S-15', vendor: 'Nue / 3A', description: 'Smart Zigbee 3.0 strip light controller', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['LXN60-LS27-Z30', 'FEB56-ZCW2CLX1.0'], model: 'WL-SD001-9W', vendor: 'Nue / 3A', description: '9W RGB LED downlight', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], }, { fingerprint: [ @@ -309,7 +309,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'NUE-AUWZO2', vendor: 'Nue / 3A', description: 'Smart Zigbee double power point', - extend: [deviceEndpoints({endpoints: {left: 1, right: 2}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, right: 2}}), m.onOff({endpointNames: ['left', 'right']})], }, { zigbeeModel: ['LXN56-1S27LX1.2', 'LXX60-FN27LX1.0'], @@ -317,9 +317,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Nue / 3A', description: 'Smart fan light switch', extend: [ - deviceEndpoints({endpoints: {button_light: 1, button_fan_high: 2, button_fan_med: 3, button_fan_low: 4}}), - onOff({endpointNames: ['button_light', 'button_fan_high', 'button_fan_med', 'button_fan_low']}), - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.deviceEndpoints({endpoints: {button_light: 1, button_fan_high: 2, button_fan_med: 3, button_fan_low: 4}}), + m.onOff({endpointNames: ['button_light', 'button_fan_high', 'button_fan_med', 'button_fan_low']}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), ], }, ]; diff --git a/src/devices/orvibo.ts b/src/devices/orvibo.ts index 410c4ea0b251d..59206e7ad1524 100644 --- a/src/devices/orvibo.ts +++ b/src/devices/orvibo.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {battery, deviceEndpoints, humidity, light, onOff, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Tz} from '../lib/types'; @@ -31,21 +31,21 @@ const definitions: DefinitionWithExtend[] = [ // https://github.com/Koenkk/zigbee2mqtt/issues/13123#issuecomment-1198793749 meta: {disableDefaultResponse: true}, toZigbee: [tzLocal.DD10Z_brightness], - extend: [light({powerOnBehavior: false, colorTemp: {range: [153, 370], startup: false}})], + extend: [m.light({powerOnBehavior: false, colorTemp: {range: [153, 370], startup: false}})], }, { zigbeeModel: ['4a33f5ea766a4c96a962b371ffde9943'], model: 'DS20Z07B', vendor: 'ORVIBO', description: 'Downlight (S series)', - extend: [light({colorTemp: {range: [166, 370]}})], + extend: [m.light({colorTemp: {range: [166, 370]}})], }, { zigbeeModel: ['ORVIBO Socket', '93e29b89b2ee45bea5bdbb7679d75d24'], model: 'OR-ZB-S010-3C', vendor: 'ORVIBO', description: 'Smart socket', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['3c4e4fc81ed442efaf69353effcdfc5f', '51725b7bcba945c8a595b325127461e9'], @@ -76,7 +76,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'T18W3Z', vendor: 'ORVIBO', description: 'Neutral smart switch 3 gang', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), onOff({endpointNames: ['l1', 'l2', 'l3']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), m.onOff({endpointNames: ['l1', 'l2', 'l3']})], }, { zigbeeModel: ['fdd76effa0e146b4bdafa0c203a37192', 'c670e231d1374dbc9e3c6a9fffbd0ae6', '75a4bfe8ef9c4350830a25d13e3ab068'], @@ -92,21 +92,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'RL804CZB', vendor: 'ORVIBO', description: 'Zigbee LED controller RGB + CCT or RGBW', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['82c167c95ed746cdbd21d6817f72c593', '8762413da99140cbb809195ff40f8c51'], model: 'RL804QZB', vendor: 'ORVIBO', description: 'Multi-functional 3 gang relay', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), onOff({endpointNames: ['l1', 'l2', 'l3'], configureReporting: false})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), m.onOff({endpointNames: ['l1', 'l2', 'l3'], configureReporting: false})], }, { zigbeeModel: ['396483ce8b3f4e0d8e9d79079a35a420'], model: 'CM10ZW', vendor: 'ORVIBO', description: 'Multi-functional 3 gang relay', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), onOff({endpointNames: ['l1', 'l2', 'l3']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), m.onOff({endpointNames: ['l1', 'l2', 'l3']})], }, { zigbeeModel: ['b467083cfc864f5e826459e5d8ea6079'], @@ -153,28 +153,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'ST30', vendor: 'ORVIBO', description: 'Temperature & humidity sensor', - extend: [battery(), humidity(), temperature()], + extend: [m.battery(), m.humidity(), m.temperature()], }, { zigbeeModel: ['9f76c9f31b4c4a499e3aca0977ac4494', '6fd24c0f58a04c848fea837aaa7d6e0f'], model: 'T30W3Z', vendor: 'ORVIBO', description: 'Smart light switch - 3 gang', - extend: [deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), onOff({endpointNames: ['top', 'center', 'bottom']})], + extend: [m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), m.onOff({endpointNames: ['top', 'center', 'bottom']})], }, { zigbeeModel: ['074b3ffba5a045b7afd94c47079dd553'], model: 'T21W2Z', vendor: 'ORVIBO', description: 'Smart light switch - 2 gang', - extend: [deviceEndpoints({endpoints: {top: 1, bottom: 2}}), onOff({endpointNames: ['top', 'bottom']})], + extend: [m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), m.onOff({endpointNames: ['top', 'bottom']})], }, { zigbeeModel: ['095db3379e414477ba6c2f7e0c6aa026'], model: 'T21W1Z', vendor: 'ORVIBO', description: 'Smart light switch - 1 gang', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['093199ff04984948b4c78167c8e7f47e', 'c8daea86aa9c415aa524365775b1218c', 'c8daea86aa9c415aa524365775b1218'], @@ -199,14 +199,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'R11W2Z', vendor: 'ORVIBO', description: 'In wall switch - 2 gang', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['9ea4d5d8778d4f7089ac06a3969e784b', '83b9b27d5ffb4830bf35be5b1023623e', '2810c2403b9c4a5db62cc62d1030d95e'], model: 'R20W2Z', vendor: 'ORVIBO', description: 'In wall switch - 2 gang', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['131c854783bc45c9b2ac58088d09571c', 'b2e57a0f606546cd879a1a54790827d6', '585fdfb8c2304119a2432e9845cf2623'], @@ -275,28 +275,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'T40W1Z', vendor: 'ORVIBO', description: 'MixSwitch 1 gang', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['2e13af8e17434961be98f055d68c2166'], model: 'T40W2Z', vendor: 'ORVIBO', description: 'MixSwitch 2 gangs', - extend: [deviceEndpoints({endpoints: {left: 1, right: 2}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, right: 2}}), m.onOff({endpointNames: ['left', 'right']})], }, { zigbeeModel: ['e8d667cb184b4a2880dd886c23d00976'], model: 'T40W3Z', vendor: 'ORVIBO', description: 'MixSwitch 3 gangs', - extend: [deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), onOff({endpointNames: ['left', 'center', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), m.onOff({endpointNames: ['left', 'center', 'right']})], }, { zigbeeModel: ['20513b10079f4cc68cffb8b0dc6d3277'], model: 'T40W4Z', vendor: 'ORVIBO', description: 'MixSwitch 4 gangs', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l4: 3, l5: 5, l6: 6}}), onOff({endpointNames: ['l1', 'l2', 'l4', 'l5', 'l6']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l4: 3, l5: 5, l6: 6}}), m.onOff({endpointNames: ['l1', 'l2', 'l4', 'l5', 'l6']})], }, { zigbeeModel: ['bcb949e87e8c4ea6bc2803052dd8fbf5'], @@ -312,35 +312,35 @@ const definitions: DefinitionWithExtend[] = [ model: 'T41W1Z', vendor: 'ORVIBO', description: 'MixSwitch 1 gang (without neutral wire)', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['7c8f476a0f764cd4b994bc73d07c906d'], model: 'T41W2Z', vendor: 'ORVIBO', description: 'MixSwitch 2 gang (without neutral wire)', - extend: [deviceEndpoints({endpoints: {left: 1, right: 2}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, right: 2}}), m.onOff({endpointNames: ['left', 'right']})], }, { zigbeeModel: ['cb7ce9fe2cb147e69c5ea700b39b3d5b'], model: 'DM10ZW', vendor: 'ORVIBO', description: '0-10v dimmer', - extend: [light({colorTemp: {range: [153, 371]}})], + extend: [m.light({colorTemp: {range: [153, 371]}})], }, { zigbeeModel: ['1a20628504bf48c88ed698fe96b7867c'], model: 'DTZ09039', vendor: 'ORVIBO', description: 'Downlight (Q series)', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['bbfed49c738948b989911f9f9f73d759'], model: 'R30W3Z', vendor: 'ORVIBO', description: 'In-wall switch 3 gang', - extend: [deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), onOff({endpointNames: ['left', 'center', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), m.onOff({endpointNames: ['left', 'center', 'right']})], }, { zigbeeModel: ['0e93fa9c36bb417a90ad5d8a184b683a'], diff --git a/src/devices/osram.ts b/src/devices/osram.ts index f97121aa882fb..013642b27877a 100644 --- a/src/devices/osram.ts +++ b/src/devices/osram.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import {ledvanceFz, ledvanceLight, ledvanceOnOff} from '../lib/ledvance'; -import {deviceEndpoints} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -298,6 +298,7 @@ const definitions: DefinitionWithExtend[] = [ fz.command_off, fz.battery, fz.command_move_to_level, + fz.command_move_hue, ], exposes: [ e.battery(), @@ -421,7 +422,7 @@ const definitions: DefinitionWithExtend[] = [ model: '4062172044776_3', vendor: 'OSRAM', description: 'Zigbee 3.0 DALI CONV LI dimmer for DALI-based luminaires (with two devices)', - extend: [deviceEndpoints({endpoints: {l1: 10, l2: 11}}), ledvanceLight({configureReporting: true, endpointNames: ['l1', 'l2'], ota: true})], + extend: [m.deviceEndpoints({endpoints: {l1: 10, l2: 11}}), ledvanceLight({configureReporting: true, endpointNames: ['l1', 'l2'], ota: true})], }, { fingerprint: [ @@ -432,7 +433,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'OSRAM', description: 'Zigbee 3.0 DALI CONV LI dimmer for DALI-based luminaires (with two devices and pushbutton)', extend: [ - deviceEndpoints({endpoints: {l1: 10, l2: 11, s1: 25}}), + m.deviceEndpoints({endpoints: {l1: 10, l2: 11, s1: 25}}), ledvanceLight({configureReporting: true, endpointNames: ['l1', 'l2', 's1'], ota: true}), ], fromZigbee: [fz.command_toggle, fz.command_move, fz.command_stop], diff --git a/src/devices/owon.ts b/src/devices/owon.ts index c46c208a68e33..3c6bbe2b6d1f0 100644 --- a/src/devices/owon.ts +++ b/src/devices/owon.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {battery, electricityMeter, forcePowerSource, iasZoneAlarm, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue, Tz} from '../lib/types'; @@ -133,7 +133,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'WSP402', vendor: 'OWON', description: 'Smart plug', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['WSP403-E'], @@ -141,43 +141,42 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'OWON', whiteLabel: [{vendor: 'Oz Smart Things', model: 'WSP403'}], description: 'Smart plug', - extend: [onOff(), electricityMeter({cluster: 'metering'}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['WSP404'], model: 'WSP404', vendor: 'OWON', description: 'Smart plug', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['CB432'], model: 'CB432', vendor: 'OWON', description: '32A/63A power circuit breaker', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['PIR313-E', 'PIR313'], model: 'PIR313-E', vendor: 'OWON', description: 'Motion sensor', - fromZigbee: [fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1, fz.temperature, fz.humidity, fz.occupancy_timeout, fz.illuminance], + fromZigbee: [fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1, fz.temperature, fz.humidity, fz.occupancy_timeout], toZigbee: [], - exposes: [e.occupancy(), e.tamper(), e.battery_low(), e.illuminance(), e.temperature(), e.humidity()], + exposes: [e.occupancy(), e.tamper(), e.battery_low(), e.temperature(), e.humidity()], configure: async (device, coordinatorEndpoint) => { const endpoint2 = device.getEndpoint(2); const endpoint3 = device.getEndpoint(3); if (device.modelID == 'PIR313') { - await reporting.bind(endpoint2, coordinatorEndpoint, ['msIlluminanceMeasurement']); await reporting.bind(endpoint3, coordinatorEndpoint, ['msTemperatureMeasurement', 'msRelativeHumidity']); } else { - await reporting.bind(endpoint3, coordinatorEndpoint, ['msIlluminanceMeasurement']); await reporting.bind(endpoint2, coordinatorEndpoint, ['msTemperatureMeasurement', 'msRelativeHumidity']); } device.powerSource = 'Battery'; device.save(); }, + extend: [m.illuminance()], }, { zigbeeModel: ['AC201'], @@ -425,21 +424,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'PIR313-P', vendor: 'OWON', description: 'Motion sensor', - extend: [battery(), iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']})], }, { zigbeeModel: ['DWS312'], model: 'DWS312', vendor: 'OWON', description: 'Door/window sensor', - extend: [battery(), iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']})], }, { zigbeeModel: ['SPM915'], model: 'SPM915', vendor: 'OWON', description: 'Sleeping pad monitor', - extend: [battery(), iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low', 'tamper']})], }, ]; diff --git a/src/devices/ozsmartthings.ts b/src/devices/ozsmartthings.ts index 7783f37a414bc..7980718b640fe 100644 --- a/src/devices/ozsmartthings.ts +++ b/src/devices/ozsmartthings.ts @@ -3,7 +3,7 @@ import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_mcm6m1ma'}], + fingerprint: tuya.fingerprint('TS0505B', ['_TZ3210_mcm6m1ma']), model: 'DL41-03-10-R-ZB', vendor: 'Oz Smart Things', description: 'Oz Smart RGBW Zigbee downlight 10w', diff --git a/src/devices/paul_neuhaus.ts b/src/devices/paul_neuhaus.ts index 49c49388e3fb6..f323b17c2770a 100644 --- a/src/devices/paul_neuhaus.ts +++ b/src/devices/paul_neuhaus.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -51,21 +51,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'NLG-CCT light', vendor: 'Paul Neuhaus', description: 'Various color temperature lights (e.g. 100.424.11)', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['Neuhaus NLG-TW light', 'NLG-TW light'], model: 'NLG-TW light', vendor: 'Paul Neuhaus', description: 'Various tunable white lights (e.g. 8195-55)', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['NLG-RGBW light '], // the space as the end is intentional, as this is what the device sends model: 'NLG-RGBW_light', vendor: 'Paul Neuhaus', description: 'Various RGBW lights (e.g. 100.110.39)', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], endpoint: (device) => { return {default: 2}; }, @@ -75,28 +75,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'NLG-RGBW__light', vendor: 'Paul Neuhaus', description: 'Various RGBW lights (e.g. 100.111.57)', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['NLG-RGB-TW light'], model: 'NLG-RGB-TW light', vendor: 'Paul Neuhaus', description: 'Various RGB + tunable white lights (e.g. 100.470.92)', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['NLG-plug'], model: '100.425.90', vendor: 'Paul Neuhaus', description: 'Q-PLUG adapter plug with night orientation light', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['JZ-CT-Z01'], model: '100.110.51', vendor: 'Paul Neuhaus', description: 'Q-FLAG LED panel, Smart-Home CCT', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['JZ-RC-J4R'], @@ -137,21 +137,21 @@ const definitions: DefinitionWithExtend[] = [ endpoint: (device) => { return {default: 2}; }, - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['JZD60-J4R150'], model: '100.001.96', vendor: 'Paul Neuhaus', description: 'Q-LED Lamp RGBW E27 socket', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['Neuhaus RGB+CCT light'], model: '100.491.61', vendor: 'Paul Neuhaus', description: 'Q-MIA LED RGBW wall lamp, 9185-13', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, ]; diff --git a/src/devices/paulmann.ts b/src/devices/paulmann.ts index 06d5396595143..8ffa74929493b 100644 --- a/src/devices/paulmann.ts +++ b/src/devices/paulmann.ts @@ -1,6 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {battery, commandsColorCtrl, commandsLevelCtrl, commandsOnOff, commandsScenes, deviceEndpoints, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -59,70 +60,70 @@ const definitions: DefinitionWithExtend[] = [ model: '968.93', vendor: 'Paulmann', description: 'URail rail adapter smart home Zigbee on/off/dimm', - extend: [light()], + extend: [m.light()], }, { fingerprint: [{modelID: 'RGBW', manufacturerName: 'Paulmann Licht GmbH'}], model: '948.47/29165', vendor: 'Paulmann', description: 'RGBW light', - extend: [light({colorTemp: {range: [153, 454]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 454]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['H036-0007'], model: '929.66', vendor: 'Paulmann', description: 'Smart home Zigbee LED module coin 1x2.5W RGBW', - extend: [light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['Switch Controller'], model: '50043', vendor: 'Paulmann', description: 'SmartHome Zigbee Cephei Switch Controller', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['50131'], model: '501.31', vendor: 'Paulmann', description: 'Smart plug for Euro- and Schuko-sockets', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['Dimmablelight'], model: '50044/50045', vendor: 'Paulmann', description: 'SmartHome Zigbee Dimmer or LED-stripe', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['500.47'], model: '500.47', vendor: 'Paulmann', description: 'SmartHome Zigbee MaxLED RGBW controller max. 72W 24V DC', - extend: [light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], + extend: [m.light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], }, { zigbeeModel: ['RGBW light', '500.49', 'RGBW_light'], model: '50049/500.63', vendor: 'Paulmann', description: 'Smart Home Zigbee YourLED RGB Controller max. 60W / Smart Home Zigbee LED Reflektor 3,5W GU10 RGBW dimmbar', - extend: [light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], + extend: [m.light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs'], applyRedFix: true}})], }, { zigbeeModel: ['RGBCW_LIGHT'], model: '4137', vendor: 'Paulmann', description: 'Smart Home Zigbee LED bulb 9,3W Matt E27 RGBW', - extend: [light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], }, { fingerprint: [{modelID: 'RGBW Controller', manufacturerName: 'Paulmann Licht'}], model: '94191', vendor: 'Paulmann', description: 'Plug & shine LED strip', - extend: [light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: {modes: ['xy', 'hs']}})], }, { fingerprint: [ @@ -133,35 +134,35 @@ const definitions: DefinitionWithExtend[] = [ model: '50064', vendor: 'Paulmann', description: 'SmartHome led spot', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['H036-0006'], model: '929.63', vendor: 'Paulmann', description: 'SmartHome Zigbee LED-Modul Coin 1x6W Tunable White', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['500.46'], model: '500.46', vendor: 'Paulmann', description: 'SmartHome Zigbee MaxLED tunable white controller max. 144W / 24V DC', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['H036-0005'], model: '929.60', vendor: 'Paulmann', description: 'SmartHome Zigbee LED-Modul Coin 1x6W White', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['371000001'], model: '371000001', vendor: 'Paulmann', description: 'SmartHome led spot tuneable white', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { fingerprint: [{modelID: 'RGBW', manufacturerName: 'Paulmann Licht'}], @@ -169,42 +170,42 @@ const definitions: DefinitionWithExtend[] = [ model: '371000002', vendor: 'Paulmann', description: 'Amaris LED panels', - extend: [light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: undefined}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['371050043'], model: '371050043', vendor: 'Paulmann', description: 'Solar LED house number light', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['371232040'], model: '371232040', vendor: 'Paulmann', description: 'LED panels', - extend: [light({colorTemp: {range: [153, 350]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 350]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['500.44'], model: '500.44', vendor: 'Paulmann', description: 'URail power supply', - extend: [light({color: {applyRedFix: true}})], + extend: [m.light({color: {applyRedFix: true}})], }, { zigbeeModel: ['500.45'], model: '500.45', vendor: 'Paulmann', description: 'SmartHome Zigbee Pendulum Light Aptare', - extend: [light({color: {applyRedFix: true}})], + extend: [m.light({color: {applyRedFix: true}})], }, { zigbeeModel: ['500.48'], model: '500.48', vendor: 'Paulmann', description: 'SmartHome Zigbee YourLED dim/switch controller max. 60 W', - extend: [light({color: {applyRedFix: true}})], + extend: [m.light({color: {applyRedFix: true}})], }, { fingerprint: [{manufacturerName: 'Paulmann Licht GmbH', modelID: 'Dimmable'}], @@ -212,7 +213,7 @@ const definitions: DefinitionWithExtend[] = [ model: '93999', vendor: 'Paulmann', description: 'Plug Shine Zigbee controller', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['RemoteControl', '50067'], @@ -257,12 +258,12 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Paulmann', description: 'RGB remote control', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), - battery(), - commandsOnOff(), - commandsLevelCtrl(), - commandsColorCtrl(), - commandsScenes(), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.battery(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsColorCtrl(), + m.commandsScenes(), ], }, { @@ -270,7 +271,7 @@ const definitions: DefinitionWithExtend[] = [ model: '150257', vendor: 'Paulmann', description: 'SimpLED SmartHome dimmable RGB LED-stripe', - extend: [light({color: true})], + extend: [m.light({color: true})], }, { fingerprint: [ @@ -280,14 +281,21 @@ const definitions: DefinitionWithExtend[] = [ model: '501.22', vendor: 'Paulmann', description: 'White E27 LED bulb, dimmable', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['RGBWW'], model: '291.52', vendor: 'Paulmann', description: 'Smart Home Zigbee LED bulb 4,9W Matt E14 RGBW', - extend: [light({colorTemp: {range: [153, 454]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 454]}, color: {modes: ['xy', 'hs']}})], + }, + { + fingerprint: tuya.fingerprint('TS000F', ['_TZ3210_hjxqqofs']), + model: '501.39', + vendor: 'Paulmann', + description: 'Universal-switch white', + extend: [m.onOff({powerOnBehavior: false})], }, ]; diff --git a/src/devices/perenio.ts b/src/devices/perenio.ts index 165ca02f795f1..2297c704d3665 100644 --- a/src/devices/perenio.ts +++ b/src/devices/perenio.ts @@ -3,7 +3,7 @@ import {Zcl} from 'zigbee-herdsman'; import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceAddCustomCluster} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -19,7 +19,7 @@ const manufacturerOptions = {manufacturerCode: Zcl.ManufacturerCode.CUSTOM_PEREN const perenioExtend = { addCustomClusterPerenio: () => - deviceAddCustomCluster('perenioSpecific', { + m.deviceAddCustomCluster('perenioSpecific', { ID: 64635, manufacturerCode: Zcl.ManufacturerCode.CUSTOM_PERENIO, attributes: {}, diff --git a/src/devices/philio.ts b/src/devices/philio.ts index 61d8276567454..aa9c89e00a5df 100644 --- a/src/devices/philio.ts +++ b/src/devices/philio.ts @@ -1,4 +1,4 @@ -import {battery, iasZoneAlarm} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'PAT04-A', vendor: 'Philio', description: 'Water leak detector', - extend: [iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), battery()], + extend: [m.iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), m.battery()], whiteLabel: [{vendor: 'Evology', model: 'PAT04-A'}], }, ]; diff --git a/src/devices/philips.ts b/src/devices/philips.ts index bb5a9af5f53f6..d51ecc69cf4c9 100644 --- a/src/devices/philips.ts +++ b/src/devices/philips.ts @@ -3,7 +3,7 @@ import {Zcl} from 'zigbee-herdsman'; import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, identify, quirkCheckinInterval} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {philipsFz, philipsLight, philipsOnOff, philipsTwilightOnOff, philipsTz} from '../lib/philips'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -447,6 +447,13 @@ const definitions: DefinitionWithExtend[] = [ description: 'Hue Tento White 42.1 cm', extend: [philipsLight({colorTemp: {range: [153, 438]}})], }, + { + zigbeeModel: ['929003823201'], + model: '929003823201', + vendor: 'Philips', + description: 'Hue Tento Black 42.1 cm', + extend: [philipsLight({colorTemp: {range: [153, 438]}})], + }, { zigbeeModel: ['929003822701'], model: '929003822701', @@ -1133,6 +1140,13 @@ const definitions: DefinitionWithExtend[] = [ description: 'Hue white GU10 bluetooth', extend: [philipsLight()], }, + { + zigbeeModel: ['LWG006'], + model: '929003667001', + vendor: 'Philips', + description: 'Hue white GU10 bluetooth', + extend: [philipsLight()], + }, { zigbeeModel: ['LWO001'], model: '8718699688882', @@ -1202,7 +1216,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Philips', description: 'Hue Dymera indoor and outdoor wall light', extend: [ - deviceEndpoints({endpoints: {top: 11, bottom: 12}}), + m.deviceEndpoints({endpoints: {top: 11, bottom: 12}}), philipsLight({colorTemp: {range: [153, 500]}, color: true, endpointNames: ['top', 'bottom']}), ], }, @@ -2373,7 +2387,7 @@ const definitions: DefinitionWithExtend[] = [ endpoint: (device) => { return {ep1: 1, ep2: 2}; }, - extend: [quirkCheckinInterval('1_HOUR')], + extend: [m.quirkCheckinInterval('1_HOUR')], ota: true, }, { @@ -2447,36 +2461,27 @@ const definitions: DefinitionWithExtend[] = [ model: '9290012607', vendor: 'Philips', description: 'Hue motion sensor', - fromZigbee: [ - fz.battery, - fz.occupancy, - fz.temperature, - fz.occupancy_timeout, - fz.illuminance, - fz.hue_motion_sensitivity, - fz.hue_motion_led_indication, - ], + fromZigbee: [fz.battery, fz.occupancy, fz.temperature, fz.occupancy_timeout, fz.hue_motion_sensitivity, fz.hue_motion_led_indication], exposes: [ e.temperature(), e.occupancy(), e.battery(), - e.illuminance(), e.motion_sensitivity_select(['low', 'medium', 'high']), e.binary('led_indication', ea.ALL, true, false).withDescription('Blink green LED on motion detection'), e.numeric('occupancy_timeout', ea.ALL).withUnit('s').withValueMin(0).withValueMax(65535), ], + extend: [m.illuminance()], toZigbee: [tz.occupancy_timeout, philipsTz.hue_motion_sensitivity, philipsTz.hue_motion_led_indication], endpoint: (device) => { return {default: 2, ep1: 1, ep2: 2}; }, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(2); - const binds = ['genPowerCfg', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing']; + const binds = ['genPowerCfg', 'msTemperatureMeasurement', 'msOccupancySensing']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.batteryPercentageRemaining(endpoint); await reporting.occupancy(endpoint); await reporting.temperature(endpoint); - await reporting.illuminance(endpoint); // read occupancy_timeout and motion_sensitivity await endpoint.read('msOccupancySensing', ['pirOToUDelay']); await endpoint.read('msOccupancySensing', [48], {manufacturerCode: Zcl.ManufacturerCode.SIGNIFY_NETHERLANDS_B_V}); @@ -2488,36 +2493,27 @@ const definitions: DefinitionWithExtend[] = [ model: '9290019758', vendor: 'Philips', description: 'Hue motion outdoor sensor', - fromZigbee: [ - fz.battery, - fz.occupancy, - fz.temperature, - fz.illuminance, - fz.occupancy_timeout, - fz.hue_motion_sensitivity, - fz.hue_motion_led_indication, - ], + fromZigbee: [fz.battery, fz.occupancy, fz.temperature, fz.occupancy_timeout, fz.hue_motion_sensitivity, fz.hue_motion_led_indication], exposes: [ e.temperature(), e.occupancy(), e.battery(), - e.illuminance(), e.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']), e.binary('led_indication', ea.ALL, true, false).withDescription('Blink green LED on motion detection'), e.numeric('occupancy_timeout', ea.ALL).withUnit('s').withValueMin(0).withValueMax(65535), ], + extend: [m.illuminance()], toZigbee: [tz.occupancy_timeout, philipsTz.hue_motion_sensitivity, philipsTz.hue_motion_led_indication], endpoint: (device) => { return {default: 2, ep1: 1, ep2: 2}; }, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(2); - const binds = ['genPowerCfg', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing']; + const binds = ['genPowerCfg', 'msTemperatureMeasurement', 'msOccupancySensing']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.batteryPercentageRemaining(endpoint); await reporting.occupancy(endpoint); await reporting.temperature(endpoint); - await reporting.illuminance(endpoint); // read occupancy_timeout and motion_sensitivity await endpoint.read('msOccupancySensing', ['pirOToUDelay']); await endpoint.read('msOccupancySensing', [48], {manufacturerCode: Zcl.ManufacturerCode.SIGNIFY_NETHERLANDS_B_V}); @@ -2578,33 +2574,24 @@ const definitions: DefinitionWithExtend[] = [ model: '9290030675', vendor: 'Philips', description: 'Hue motion sensor', - fromZigbee: [ - fz.battery, - fz.occupancy, - fz.temperature, - fz.occupancy_timeout, - fz.illuminance, - fz.hue_motion_sensitivity, - fz.hue_motion_led_indication, - ], + fromZigbee: [fz.battery, fz.occupancy, fz.temperature, fz.occupancy_timeout, fz.hue_motion_sensitivity, fz.hue_motion_led_indication], exposes: [ e.temperature(), e.occupancy(), e.battery(), - e.illuminance(), e.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high', 'very_high', 'max']), e.binary('led_indication', ea.ALL, true, false).withDescription('Blink green LED on motion detection'), e.numeric('occupancy_timeout', ea.ALL).withUnit('s').withValueMin(0).withValueMax(65535), ], + extend: [m.illuminance()], toZigbee: [tz.occupancy_timeout, philipsTz.hue_motion_sensitivity, philipsTz.hue_motion_led_indication], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(2); - const binds = ['genPowerCfg', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing']; + const binds = ['genPowerCfg', 'msTemperatureMeasurement', 'msOccupancySensing']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.batteryPercentageRemaining(endpoint); await reporting.occupancy(endpoint); await reporting.temperature(endpoint); - await reporting.illuminance(endpoint); // read occupancy_timeout and motion_sensitivity await endpoint.read('msOccupancySensing', ['pirOToUDelay']); await endpoint.read('msOccupancySensing', [48], {manufacturerCode: Zcl.ManufacturerCode.SIGNIFY_NETHERLANDS_B_V}); @@ -2615,33 +2602,24 @@ const definitions: DefinitionWithExtend[] = [ model: '9290030674', vendor: 'Philips', description: 'Hue motion outdoor sensor', - fromZigbee: [ - fz.battery, - fz.occupancy, - fz.temperature, - fz.illuminance, - fz.occupancy_timeout, - fz.hue_motion_sensitivity, - fz.hue_motion_led_indication, - ], + fromZigbee: [fz.battery, fz.occupancy, fz.temperature, fz.occupancy_timeout, fz.hue_motion_sensitivity, fz.hue_motion_led_indication], exposes: [ e.temperature(), e.occupancy(), e.battery(), - e.illuminance(), e.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high', 'very_high', 'max']), e.binary('led_indication', ea.ALL, true, false).withDescription('Blink green LED on motion detection'), e.numeric('occupancy_timeout', ea.ALL).withUnit('s').withValueMin(0).withValueMax(65535), ], + extend: [m.illuminance()], toZigbee: [tz.occupancy_timeout, philipsTz.hue_motion_sensitivity, philipsTz.hue_motion_led_indication], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(2); - const binds = ['genPowerCfg', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing']; + const binds = ['genPowerCfg', 'msTemperatureMeasurement', 'msOccupancySensing']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.batteryPercentageRemaining(endpoint); await reporting.occupancy(endpoint); await reporting.temperature(endpoint); - await reporting.illuminance(endpoint); // read occupancy_timeout and motion_sensitivity await endpoint.read('msOccupancySensing', ['pirOToUDelay']); await endpoint.read('msOccupancySensing', [48], {manufacturerCode: Zcl.ManufacturerCode.SIGNIFY_NETHERLANDS_B_V}); @@ -3076,7 +3054,7 @@ const definitions: DefinitionWithExtend[] = [ model: '929003597901', vendor: 'Philips', description: 'Hue white ambiance Aurelle round panel light', - extend: [identify(), philipsLight({colorTemp: {range: [153, 454]}})], + extend: [m.identify(), philipsLight({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['3418331P6'], @@ -3240,7 +3218,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Hue tap', fromZigbee: [fz.hue_tap], toZigbee: [], - exposes: [e.action(['press_1', 'press_2', 'press_3', 'press_4'])], + exposes: [e.action(['press_1', 'press_2', 'press_3', 'press_4', 'press_1_and_2', 'release_1_and_2', 'press_3_and_4', 'release_3_and_4'])], }, { zigbeeModel: ['LCA005'], @@ -3994,11 +3972,9 @@ const definitions: DefinitionWithExtend[] = [ {model: '929003711401', vendor: 'Philips', description: 'Hue Twilight sleep and wake-up light black', fingerprint: [{modelID: 'LGT003'}]}, ], extend: [ - deviceEndpoints({endpoints: {switch: 1, back: 11, front: 12}}), - + m.deviceEndpoints({endpoints: {switch: 1, back: 11, front: 12}}), philipsLight({colorTemp: {range: [153, 500]}, color: true, endpointNames: ['front']}), philipsLight({colorTemp: {range: [153, 500]}, color: true, gradient: true, endpointNames: ['back']}), - philipsTwilightOnOff(), ], }, @@ -4016,6 +3992,20 @@ const definitions: DefinitionWithExtend[] = [ description: 'Hue Lightguide E27 Edison ST72 500lm', extend: [philipsLight({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], }, + { + zigbeeModel: ['LCO003'], + model: '929003151601', + vendor: 'Philips', + description: 'Hue Lightguide E26 Globe G30 500lm', + extend: [philipsLight({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + }, + { + zigbeeModel: ['LCO006'], + model: '929003151701', + vendor: 'Philips', + description: 'Hue Lightguide E26 Globe Large G40 500lm', + extend: [philipsLight({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + }, ]; export default definitions; diff --git a/src/devices/profalux.ts b/src/devices/profalux.ts index 04773700b357b..e84b220ba6195 100644 --- a/src/devices/profalux.ts +++ b/src/devices/profalux.ts @@ -56,9 +56,9 @@ const definitions: DefinitionWithExtend[] = [ // 2: soft cover (aka store) : 2xF Stop + Down if ((device == null && options == null) || endpoint.getClusterAttributeValue('manuSpecificProfalux1', 'motorCoverType') == 1) { - return [e.cover_position_tilt(), e.linkquality()]; + return [e.cover_position_tilt()]; } else { - return [e.cover_position(), e.linkquality()]; + return [e.cover_position()]; } }, configure: async (device, coordinatorEndpoint) => { diff --git a/src/devices/prolight.ts b/src/devices/prolight.ts index af7b9dba9174c..167d247b07a18 100644 --- a/src/devices/prolight.ts +++ b/src/devices/prolight.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -11,35 +11,35 @@ const definitions: DefinitionWithExtend[] = [ model: '5412748727371', vendor: 'Prolight', description: 'E27 white and colour bulb', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['PROLIGHT E27 WARM WHITE CLEAR'], model: '5412748727432', vendor: 'Prolight', description: 'E27 filament bulb dimmable', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['PROLIGHT E27 WARM WHITE'], model: '5412748727364', vendor: 'Prolight', description: 'E27 bulb dimmable', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['PROLIGHT GU10 WHITE AND COLOUR'], model: '5412748727401', vendor: 'Prolight', description: 'GU10 white and colour spot', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['PROLIGHT GU10 WARM WHITE'], model: '5412748727395', vendor: 'Prolight', description: 'GU10 spot dimmable', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['PROLIGHT REMOTE CONTROL'], diff --git a/src/devices/pushok.ts b/src/devices/pushok.ts index c6b63cdae4a0e..7898fb10ed8f6 100644 --- a/src/devices/pushok.ts +++ b/src/devices/pushok.ts @@ -1,22 +1,9 @@ -import { - battery, - binary, - enumLookup, - EnumLookupArgs, - humidity, - iasZoneAlarm, - identify, - illuminance, - numeric, - NumericArgs, - onOff, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const pushokExtend = { - valveStatus: (args?: Partial) => - enumLookup({ + valveStatus: (args?: Partial) => + m.enumLookup({ name: 'status', lookup: {OFF: 0, ON: 1, MOVING: 2, STUCK: 3}, cluster: 'genMultistateInput', @@ -27,8 +14,8 @@ const pushokExtend = { reporting: null, ...args, }), - stallTime: (args?: Partial) => - numeric({ + stallTime: (args?: Partial) => + m.numeric({ name: 'stall_time', cluster: 'genMultistateValue', attribute: 'presentValue', @@ -50,11 +37,11 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Battery powered retrofit valve', extend: [ - onOff({powerOnBehavior: false, configureReporting: false}), - battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: false}), + m.onOff({powerOnBehavior: false, configureReporting: false}), + m.battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: false}), pushokExtend.valveStatus(), - identify({isSleepy: true}), - enumLookup({ + m.identify({isSleepy: true}), + m.enumLookup({ name: 'kamikaze', lookup: {OFF: 0, ON: 1}, cluster: 'genBinaryValue', @@ -65,7 +52,7 @@ const definitions: DefinitionWithExtend[] = [ reporting: null, }), pushokExtend.stallTime(), - enumLookup({ + m.enumLookup({ name: 'battery_type', lookup: {LIION: 0, ALKALINE: 1, NIMH: 2}, cluster: 'genMultistateOutput', @@ -75,7 +62,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'ALL', reporting: null, }), - numeric({ + m.numeric({ name: 'end_lag', cluster: 'genAnalogValue', attribute: 'presentValue', @@ -96,9 +83,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Soil moisture and temperature sensor', extend: [ - humidity({reporting: null}), - temperature({reporting: null}), - battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), + m.humidity({reporting: null}), + m.temperature({reporting: null}), + m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), ], ota: true, }, @@ -108,7 +95,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Water level and temperature sensor', extend: [ - binary({ + m.binary({ name: 'contact', valueOn: ['ON', 0x01], valueOff: ['OFF', 0x00], @@ -118,8 +105,8 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', reporting: null, }), - temperature({reporting: null}), - battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), + m.temperature({reporting: null}), + m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), ], ota: true, }, @@ -128,7 +115,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'POK004', vendor: 'PushOk Hardware', description: 'Solar powered zigbee router and illuminance sensor', - extend: [illuminance({reporting: null}), battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false})], + extend: [m.illuminance({reporting: null}), m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false})], ota: true, }, { @@ -137,9 +124,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Temperature and Humidity sensor', extend: [ - humidity({reporting: null}), - temperature({reporting: null}), - battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), + m.humidity({reporting: null}), + m.temperature({reporting: null}), + m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), ], ota: true, }, @@ -149,10 +136,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Battery powered garden valve', extend: [ - onOff({powerOnBehavior: false, configureReporting: false}), - battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: false}), + m.onOff({powerOnBehavior: false, configureReporting: false}), + m.battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: false}), pushokExtend.valveStatus(), - identify({isSleepy: true}), + m.identify({isSleepy: true}), pushokExtend.stallTime(), ], ota: true, @@ -163,10 +150,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Battery powered thermostat relay', extend: [ - onOff({powerOnBehavior: false, configureReporting: false}), - battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), - temperature({reporting: null}), - numeric({ + m.onOff({powerOnBehavior: false, configureReporting: false}), + m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), + m.temperature({reporting: null}), + m.numeric({ name: 'tgt_temperature', cluster: 'genAnalogOutput', attribute: 'presentValue', @@ -178,7 +165,7 @@ const definitions: DefinitionWithExtend[] = [ valueStep: 1, reporting: null, }), - numeric({ + m.numeric({ name: 'hysteresis', cluster: 'genAnalogValue', attribute: 'presentValue', @@ -190,7 +177,7 @@ const definitions: DefinitionWithExtend[] = [ valueStep: 0.1, reporting: null, }), - enumLookup({ + m.enumLookup({ name: 'set_op_mode', lookup: {monitor: 0, heater: 1, cooler: 2, monitor_inverted: 3, heater_inverted: 4, cooler_inverted: 5}, cluster: 'genMultistateOutput', @@ -209,7 +196,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Voltage monitor', extend: [ - numeric({ + m.numeric({ name: 'ext_voltage', cluster: 'genAnalogInput', attribute: 'presentValue', @@ -219,7 +206,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', reporting: null, }), - binary({ + m.binary({ name: 'comp_state', valueOn: ['NORMAL', 0x01], valueOff: ['LOW', 0x00], @@ -229,7 +216,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', reporting: null, }), - numeric({ + m.numeric({ name: 'tgt_voltage', cluster: 'genMultistateValue', attribute: 'presentValue', @@ -241,7 +228,7 @@ const definitions: DefinitionWithExtend[] = [ valueStep: 1, reporting: null, }), - enumLookup({ + m.enumLookup({ name: 'voltage_type', lookup: {AC: 0, DC: 1}, cluster: 'genMultistateOutput', @@ -251,8 +238,8 @@ const definitions: DefinitionWithExtend[] = [ access: 'ALL', reporting: null, }), - identify({isSleepy: true}), - battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: false}), + m.identify({isSleepy: true}), + m.battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: false}), ], ota: true, }, @@ -262,7 +249,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: 'Water level and temperature sensor', extend: [ - binary({ + m.binary({ name: 'contact', valueOn: ['ON', 0x01], valueOff: ['OFF', 0x00], @@ -272,8 +259,8 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', reporting: null, }), - temperature({reporting: null}), - battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), + m.temperature({reporting: null}), + m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), ], ota: true, }, @@ -282,7 +269,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'POK011', vendor: 'PushOk Hardware', description: 'Illuminance sensor', - extend: [illuminance({reporting: null}), battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false})], + extend: [m.illuminance({reporting: null}), m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false})], ota: true, }, { @@ -291,7 +278,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'PushOk Hardware', description: '20 dBm Zigbee router with battery backup for indoor/outdoor use', extend: [ - enumLookup({ + m.enumLookup({ name: 'battery_state', lookup: {missing: 0, charging: 1, full: 2, discharging: 3}, cluster: 'genMultistateInput', @@ -301,12 +288,12 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', reporting: null, }), - iasZoneAlarm({ + m.iasZoneAlarm({ zoneType: 'generic', zoneAttributes: ['ac_status', 'battery_defect'], alarmTimeout: false, }), - battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), + m.battery({percentage: true, voltage: true, lowStatus: false, percentageReporting: false}), ], ota: true, }, diff --git a/src/devices/qa.ts b/src/devices/qa.ts index d951b98111fe2..c027e7bda90e4 100644 --- a/src/devices/qa.ts +++ b/src/devices/qa.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {actionEnumLookup, deviceEndpoints, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -18,9 +18,9 @@ const definitions: DefinitionWithExtend[] = [ description: '3 channel scene switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1', 'l2', 'l3'], powerOnBehavior2: true, backlightModeOffOn: true}), - actionEnumLookup({ + m.actionEnumLookup({ cluster: 'genOnOff', commands: ['commandTuyaAction'], attribute: 'value', @@ -43,9 +43,9 @@ const definitions: DefinitionWithExtend[] = [ description: '1 channel scene switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1}}), + m.deviceEndpoints({endpoints: {l1: 1}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1'], powerOnBehavior2: true, backlightModeOffOn: true}), - actionEnumLookup({ + m.actionEnumLookup({ cluster: 'genOnOff', commands: ['commandTuyaAction'], attribute: 'value', @@ -68,9 +68,9 @@ const definitions: DefinitionWithExtend[] = [ description: '2 channel scene switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1', 'l2'], powerOnBehavior2: true, backlightModeOffOn: true}), - actionEnumLookup({ + m.actionEnumLookup({ cluster: 'genOnOff', commands: ['commandTuyaAction'], attribute: 'value', @@ -91,7 +91,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'QARZ1DC', vendor: 'QA', description: '1 channel switch', - extend: [tuya.modernExtend.tuyaMagicPacket(), deviceEndpoints({endpoints: {l1: 1}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1']})], + extend: [tuya.modernExtend.tuyaMagicPacket(), m.deviceEndpoints({endpoints: {l1: 1}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1']})], }, { fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_gtdswg8k']), @@ -100,7 +100,7 @@ const definitions: DefinitionWithExtend[] = [ description: '1 channel long range switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1}}), + m.deviceEndpoints({endpoints: {l1: 1}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1'], switchType: true}), ], }, @@ -111,7 +111,7 @@ const definitions: DefinitionWithExtend[] = [ description: '2 channel long range switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1', 'l2'], switchType: true}), ], }, @@ -122,7 +122,7 @@ const definitions: DefinitionWithExtend[] = [ description: '3 channel long range switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1', 'l2', 'l3'], switchType: true}), ], }, @@ -133,7 +133,7 @@ const definitions: DefinitionWithExtend[] = [ description: '4 channel long range switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1', 'l2', 'l3', 'l4'], switchType: true}), ], }, @@ -144,7 +144,7 @@ const definitions: DefinitionWithExtend[] = [ description: '1 channel wall switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1}}), + m.deviceEndpoints({endpoints: {l1: 1}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1'], backlightModeOffOn: true}), ], }, @@ -155,7 +155,7 @@ const definitions: DefinitionWithExtend[] = [ description: '2 channel wall switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), tuya.modernExtend.tuyaOnOff({endpoints: ['l1', 'l2'], backlightModeOffOn: true}), ], }, @@ -166,7 +166,7 @@ const definitions: DefinitionWithExtend[] = [ description: '3 channel wall switch', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), + m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), tuya.modernExtend.tuyaOnOff({endpoints: ['left', 'center', 'right'], backlightModeOffOn: true}), ], }, @@ -233,7 +233,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'QADZ1', vendor: 'QA', description: 'Dimmer 1 channel', - extend: [light({powerOnBehavior: false, configureReporting: true, effect: false})], + extend: [m.light({powerOnBehavior: false, configureReporting: true, effect: false})], fromZigbee: [tuya.fz.power_on_behavior_1, fz.TS110E_switch_type, fz.TS110E, fz.on_off], toZigbee: [tz.TS110E_light_onoff_brightness, tuya.tz.power_on_behavior_1, tz.TS110E_options], exposes: [e.power_on_behavior(), tuya.exposes.switchType()], @@ -246,8 +246,8 @@ const definitions: DefinitionWithExtend[] = [ description: 'Dimmer 2 channel', extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), - light({endpointNames: ['l1', 'l2'], powerOnBehavior: false, configureReporting: true, effect: false}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.light({endpointNames: ['l1', 'l2'], powerOnBehavior: false, configureReporting: true, effect: false}), ], fromZigbee: [tuya.fz.power_on_behavior_1, fz.TS110E_switch_type, fz.TS110E, fz.on_off], toZigbee: [tz.TS110E_light_onoff_brightness, tuya.tz.power_on_behavior_1, tz.TS110E_options], diff --git a/src/devices/quotra.ts b/src/devices/quotra.ts index d80d34945e37b..608a34b8e8cb4 100644 --- a/src/devices/quotra.ts +++ b/src/devices/quotra.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'B07CVL9SZF', vendor: 'Quotra', description: 'Dimmer', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['QV-RGBCCT'], model: 'B07JHL6DRV', vendor: 'Quotra', description: 'RGB WW LED strip', - extend: [light({colorTemp: {range: [150, 500]}, color: true, powerOnBehavior: false})], + extend: [m.light({colorTemp: {range: [150, 500]}, color: true, powerOnBehavior: false})], }, ]; diff --git a/src/devices/rademacher.ts b/src/devices/rademacher.ts index 584fb7f51c92e..39ffa0a97353e 100644 --- a/src/devices/rademacher.ts +++ b/src/devices/rademacher.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,21 +7,21 @@ const definitions: DefinitionWithExtend[] = [ model: '35104001', vendor: 'Rademacher', description: 'addZ white + colour', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['RDM-35144001'], model: '35144001', vendor: 'Rademacher', description: 'addZ white + colour', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['RDM-35274001'], model: 'RDM-35274001', vendor: 'Rademacher', description: 'addZ white + colour E27 LED', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], }, ]; diff --git a/src/devices/radium.ts b/src/devices/radium.ts index ec9ac084ddb8b..d0adb082eb4bc 100644 --- a/src/devices/radium.ts +++ b/src/devices/radium.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LMZA4376', vendor: 'Radium', description: 'LED Controller ZGB White 84W/24V', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/raex.ts b/src/devices/raex.ts index 11651e706a49a..f50964ab13780 100644 --- a/src/devices/raex.ts +++ b/src/devices/raex.ts @@ -1,4 +1,4 @@ -import {battery, windowCovering} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TQL25-2211', vendor: 'Raex', description: 'Tubular motor', - extend: [battery(), windowCovering({controls: ['lift']})], + extend: [m.battery(), m.windowCovering({controls: ['lift']})], }, ]; diff --git a/src/devices/rgb_genie.ts b/src/devices/rgb_genie.ts index d600e57e2597f..d875063a7c00e 100644 --- a/src/devices/rgb_genie.ts +++ b/src/devices/rgb_genie.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -36,7 +36,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZB-1026', vendor: 'RGB Genie', description: 'Zigbee LED dimmer controller', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['RGBgenie ZB-5001'], diff --git a/src/devices/robb.ts b/src/devices/robb.ts index 0e4813d2aa78c..b4d22d26fb1df 100644 --- a/src/devices/robb.ts +++ b/src/devices/robb.ts @@ -1,21 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import { - battery, - commandsLevelCtrl, - commandsOnOff, - deviceEndpoints, - electricityMeter, - humidity, - iasZoneAlarm, - identify, - illuminance, - light, - occupancy, - onOff, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -28,10 +14,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ROBB', description: '4-button wireless Zigbee switch', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), - battery(), - commandsOnOff({endpointNames: ['1', '2', '3', '4']}), - commandsLevelCtrl({endpointNames: ['1', '2', '3', '4']}), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.battery(), + m.commandsOnOff({endpointNames: ['1', '2', '3', '4']}), + m.commandsLevelCtrl({endpointNames: ['1', '2', '3', '4']}), ], }, { @@ -39,21 +25,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'ROB_200-004-1', vendor: 'ROBB', description: 'ZigBee AC phase-cut dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ROB_200-060-0'], model: 'ROB_200-060-0', vendor: 'ROBB', description: 'Zigbee LED driver', - extend: [light({colorTemp: {range: [160, 450]}, color: true})], + extend: [m.light({colorTemp: {range: [160, 450]}, color: true})], }, { zigbeeModel: ['ROB_200-061-0'], model: 'ROB_200-061-0', vendor: 'ROBB', description: '50W Zigbee CCT LED driver (constant current)', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, { zigbeeModel: ['ROB_200-029-0'], @@ -76,14 +62,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ROBB', description: 'Battery powered PIR presence, temperature, humidity and light sensors', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5}}), - battery(), - identify(), - occupancy(), - iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'alarm_2', 'tamper', 'battery_low']}), - temperature({endpointNames: ['3']}), - humidity({endpointNames: ['4']}), - illuminance({endpointNames: ['5']}), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5}}), + m.battery(), + m.identify(), + m.occupancy(), + m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'alarm_2', 'tamper', 'battery_low']}), + m.temperature({endpointNames: ['3']}), + m.humidity({endpointNames: ['4']}), + m.illuminance({endpointNames: ['5']}), ], }, { @@ -91,7 +77,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ROB_200-050-0', vendor: 'ROBB', description: '4 port switch with 2 usb ports (no metering)', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5']})], whiteLabel: [{vendor: 'Sunricher', model: 'SR-ZG9023A(EU)'}], }, { @@ -99,49 +85,49 @@ const definitions: DefinitionWithExtend[] = [ model: 'ROB_200-006-0', vendor: 'ROBB', description: 'ZigBee LED dimmer', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ROB_200-004-0'], model: 'ROB_200-004-0', vendor: 'ROBB', description: 'ZigBee AC phase-cut dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ROB_200-011-0'], model: 'ROB_200-011-0', vendor: 'ROBB', description: 'ZigBee AC phase-cut dimmer', - extend: [light({configureReporting: true}), electricityMeter({current: {divisor: 1000}, voltage: {divisor: 10}, power: {divisor: 10}})], + extend: [m.light({configureReporting: true}), m.electricityMeter({current: {divisor: 1000}, voltage: {divisor: 10}, power: {divisor: 10}})], }, { zigbeeModel: ['ROB_200-003-0'], model: 'ROB_200-003-0', vendor: 'ROBB', description: 'Zigbee AC in wall switch (push switch)', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['ROB_200-003-1'], model: 'ROB_200-003-1', vendor: 'ROBB', description: 'Zigbee AC in wall switch (normal switch)', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['ROB_200-030-0'], model: 'ROB_200-030-0', vendor: 'ROBB', description: 'Zigbee AC in wall switch 400W (2-wire)', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['ROB_200-014-0'], model: 'ROB_200-014-0', vendor: 'ROBB', description: 'ZigBee AC phase-cut rotary dimmer', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], whiteLabel: [ {vendor: 'YPHIX', model: '50208695'}, {vendor: 'Samotech', model: 'SM311'}, @@ -432,7 +418,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ROB_200-063-0', vendor: 'ROBB', description: 'Zigbee 0-10V PWM dimmer', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/rtx.ts b/src/devices/rtx.ts index fa46db5f1cde8..e01e75c294ca1 100644 --- a/src/devices/rtx.ts +++ b/src/devices/rtx.ts @@ -9,11 +9,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_akjefhj5'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_2wg5qrjy'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_81isopgh'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_akjefhj5', '_TZE200_2wg5qrjy', '_TZE200_81isopgh']), model: 'ZVG1', vendor: 'RTX', description: 'Zigbee smart water valve', @@ -118,7 +114,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0202', manufacturerName: '_TZ3000_mwd3c2at'}], + fingerprint: tuya.fingerprint('TS0202', ['_TZ3000_mwd3c2at']), model: 'ZMS4', vendor: 'RTX', description: 'Zigbee PIR sensor', diff --git a/src/devices/salus_controls.ts b/src/devices/salus_controls.ts index e800e98733c12..fceb554f4dc09 100644 --- a/src/devices/salus_controls.ts +++ b/src/devices/salus_controls.ts @@ -1,7 +1,9 @@ +import {Zcl} from 'zigbee-herdsman'; + import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {electricityMeter, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -13,7 +15,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SPE600', vendor: 'Salus Controls', description: 'Smart plug (EU socket)', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], ota: {manufacturerName: 'SalusControls'}, }, { @@ -21,7 +23,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP600', vendor: 'Salus Controls', description: 'Smart plug (UK socket)', - extend: [onOff(), electricityMeter({cluster: 'metering', fzMetering: fz.SP600_power})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering', fzMetering: fz.SP600_power})], ota: {manufacturerName: 'SalusControls'}, }, { @@ -29,7 +31,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SX885ZB', vendor: 'Salus Controls', description: 'miniSmartPlug', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], ota: {manufacturerName: 'SalusControls'}, }, { @@ -37,7 +39,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SR600', vendor: 'Salus Controls', description: 'Relay switch', - extend: [onOff({ota: {manufacturerName: 'SalusControls'}})], + extend: [m.onOff({ota: {manufacturerName: 'SalusControls'}})], }, { zigbeeModel: ['SW600'], @@ -101,7 +103,45 @@ const definitions: DefinitionWithExtend[] = [ model: 'FC600', vendor: 'Salus Controls', description: 'Fan coil thermostat', - extend: [], + extend: [ + m.deviceAddCustomCluster('manuSpecificSalus', { + ID: 0xfc04, + manufacturerCode: Zcl.ManufacturerCode.COMPUTIME, + attributes: { + frostSetpoint: {ID: 0x0000, type: Zcl.DataType.INT16}, + minFrostSetpoint: {ID: 0x0001, type: Zcl.DataType.INT16}, + maxFrostSetpoint: {ID: 0x0002, type: Zcl.DataType.INT16}, + timeDisplayFormat: {ID: 0x0003, type: Zcl.DataType.BOOLEAN}, + attr4: {ID: 0x0004, type: Zcl.DataType.UINT16}, + attr5: {ID: 0x0005, type: Zcl.DataType.UINT8}, + attr6: {ID: 0x0006, type: Zcl.DataType.UINT16}, + attr7: {ID: 0x0007, type: Zcl.DataType.UINT8}, + autoCoolingSetpoint: {ID: 0x0008, type: Zcl.DataType.INT16}, + autoHeatingSetpoint: {ID: 0x0009, type: Zcl.DataType.INT16}, + holdType: {ID: 0x000a, type: Zcl.DataType.UINT8}, + shortCycleProtection: {ID: 0x000b, type: Zcl.DataType.UINT16}, + coolingFanDelay: {ID: 0x000c, type: Zcl.DataType.UINT16}, + ruleCoolingSetpoint: {ID: 0x000d, type: Zcl.DataType.INT16}, + ruleHeatingSetpoint: {ID: 0x000e, type: Zcl.DataType.INT16}, + attr15: {ID: 0x000f, type: Zcl.DataType.BOOLEAN}, + }, + commands: { + resetDevice: { + ID: 0x01, + parameters: [], + }, + }, + commandsResponse: {}, + }), + m.enumLookup({ + name: 'preset', + lookup: {schedule: 0, temporary_override: 1, permanent_override: 2, standby: 7, eco: 10}, + cluster: 'manuSpecificSalus', + attribute: 'holdType', + description: 'Operation mode', + reporting: {min: 0, max: 3600, change: 0}, + }), + ], fromZigbee: [fz.thermostat, fz.fan], toZigbee: [ tz.thermostat_local_temperature, @@ -134,7 +174,7 @@ const definitions: DefinitionWithExtend[] = [ ], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(9); - const binds = ['genBasic', 'genIdentify', 'genTime', 'hvacThermostat', 'hvacFanCtrl', 'hvacUserInterfaceCfg']; + const binds = ['genBasic', 'genTime', 'hvacThermostat', 'hvacFanCtrl', 'hvacUserInterfaceCfg']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.thermostatTemperature(endpoint); await reporting.thermostatOccupiedHeatingSetpoint(endpoint); @@ -143,7 +183,7 @@ const definitions: DefinitionWithExtend[] = [ await reporting.thermostatRunningMode(endpoint); await reporting.thermostatRunningState(endpoint); }, - ota: true, + ota: {manufacturerName: 'SalusControls'}, }, ]; diff --git a/src/devices/samotech.ts b/src/devices/samotech.ts index 655c3cdddc380..5e78c272f5c68 100644 --- a/src/devices/samotech.ts +++ b/src/devices/samotech.ts @@ -1,4 +1,4 @@ -import {deviceEndpoints, electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,21 +7,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'SM308', vendor: 'Samotech', description: 'Zigbee AC in wall switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['SM308-S'], model: 'SM308-S', vendor: 'Samotech', description: 'Zigbee in wall smart switch', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['SM308-2CH'], model: 'SM308-2CH', vendor: 'Samotech', description: 'Zigbee 2 channel in wall switch', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']}), electricityMeter()], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']}), m.electricityMeter()], meta: {multiEndpointSkip: ['power', 'energy', 'voltage', 'current']}, }, { @@ -29,14 +29,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'SM309-S', vendor: 'Samotech', description: 'Zigbee dimmer 400W with power and energy metering', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], }, { zigbeeModel: ['SM309'], model: 'SM309', vendor: 'Samotech', description: 'Zigbee dimmer 400W', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { // v1 doesn't support electricity measurements @@ -45,7 +45,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SM323_v1', vendor: 'Samotech', description: 'Zigbee retrofit dimmer 250W', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['SM323'], @@ -53,21 +53,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'SM323_v2', vendor: 'Samotech', description: 'Zigbee retrofit dimmer 250W', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], }, { zigbeeModel: ['SM324'], model: 'SM324', vendor: 'Samotech', description: '220V Zigbee CCT LED dimmer', - extend: [light({colorTemp: {range: [150, 500]}, configureReporting: true})], + extend: [m.light({colorTemp: {range: [150, 500]}, configureReporting: true})], }, { zigbeeModel: ['SM325-ZG'], model: 'SM325-ZG', vendor: 'Samotech', description: 'Zigbee smart pull cord dimmer switch', - extend: [light({configureReporting: true, effect: false, powerOnBehavior: false})], + extend: [m.light({configureReporting: true, effect: false, powerOnBehavior: false})], }, ]; diff --git a/src/devices/saswell.ts b/src/devices/saswell.ts index 8750e19418157..427834d908360 100644 --- a/src/devices/saswell.ts +++ b/src/devices/saswell.ts @@ -11,26 +11,28 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { fingerprint: [ - {modelID: 'GbxAXL2\u0000', manufacturerName: '_TYST11_KGbxAXL2'}, - {modelID: 'uhszj9s\u0000', manufacturerName: '_TYST11_zuhszj9s'}, - {modelID: '88teujp\u0000', manufacturerName: '_TYST11_c88teujp'}, - {modelID: 'w7cahqs\u0000', manufacturerName: '_TYST11_yw7cahqs'}, - {modelID: 'w7cahqs', manufacturerName: '_TYST11_yw7cahqs'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_c88teujp'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_yw7cahqs'}, - {modelID: 'aj4jz0i\u0000', manufacturerName: '_TYST11_caj4jz0i'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_azqp6ssj'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_zuhszj9s'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_9gvruqf5'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_zr9c0day'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_0dvm9mva'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_h4cgnbzg'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_gd4rvykv'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_exfrnlow'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_9m4kmbfu'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_3yp57tby'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_7p8ugv8d'}, - {modelID: 'TS0601', manufacturerName: '_TZE284_3yp57tby'}, + ...tuya.fingerprint('GbxAXL2\u0000', ['_TYST11_KGbxAXL2']), + ...tuya.fingerprint('uhszj9s\u0000', ['_TYST11_zuhszj9s']), + ...tuya.fingerprint('88teujp\u0000', ['_TYST11_c88teujp']), + ...tuya.fingerprint('w7cahqs\u0000', ['_TYST11_yw7cahqs']), + ...tuya.fingerprint('w7cahqs', ['_TYST11_yw7cahqs']), + ...tuya.fingerprint('TS0601', [ + '_TZE200_c88teujp', + '_TZE200_yw7cahqs', + '_TZE200_azqp6ssj', + '_TZE200_zuhszj9s', + '_TZE200_9gvruqf5', + '_TZE200_zr9c0day', + '_TZE200_0dvm9mva', + '_TZE200_h4cgnbzg', + '_TZE200_gd4rvykv', + '_TZE200_exfrnlow', + '_TZE200_9m4kmbfu', + '_TZE200_3yp57tby', + '_TZE200_7p8ugv8d', + '_TZE284_3yp57tby', + ]), + ...tuya.fingerprint('aj4jz0i\u0000', ['_TYST11_caj4jz0i']), ], model: 'SEA801-Zigbee/SEA802-Zigbee', vendor: 'Saswell', diff --git a/src/devices/sber.ts b/src/devices/sber.ts index 0d09286f42403..ba842ed249993 100644 --- a/src/devices/sber.ts +++ b/src/devices/sber.ts @@ -1,40 +1,40 @@ -import {battery, humidity, iasZoneAlarm, ignoreClusterReport, temperature} from '../lib/modernExtend'; -import {modernExtend as tuyaModernExtend} from '../lib/tuya'; +import * as m from '../lib/modernExtend'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; -const {tuyaMagicPacket, tuyaOnOffActionLegacy} = tuyaModernExtend; +const {tuyaMagicPacket, tuyaOnOffActionLegacy} = tuya.modernExtend; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'SM0202', manufacturerName: '_TYZB01_2jzbhomb'}], + fingerprint: tuya.fingerprint('SM0202', ['_TYZB01_2jzbhomb']), model: 'SBDV-00029', vendor: 'Sber', description: 'Smart motion sensor', extend: [ - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low'], alarmTimeout: true}), - battery({voltage: true, voltageReporting: true}), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'tamper', 'battery_low'], alarmTimeout: true}), + m.battery({voltage: true, voltageReporting: true}), ], }, { - fingerprint: [{modelID: 'TS0203', manufacturerName: '_TYZB01_epni2jgy'}], + fingerprint: tuya.fingerprint('TS0203', ['_TYZB01_epni2jgy']), model: 'SBDV-00030', vendor: 'Sber', description: 'Smart opening sensor', extend: [ - ignoreClusterReport({cluster: 'genBasic'}), - iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), - battery({voltage: true, voltageReporting: true}), + m.ignoreClusterReport({cluster: 'genBasic'}), + m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({voltage: true, voltageReporting: true}), ], }, { - fingerprint: [{modelID: 'TS0041A', manufacturerName: '_TYZB01_ub7urdza'}], + fingerprint: tuya.fingerprint('TS0041A', ['_TYZB01_ub7urdza']), model: 'SBDV-00032', vendor: 'Sber', description: 'Smart button', extend: [ tuyaMagicPacket(), tuyaOnOffActionLegacy({actions: ['single', 'double', 'hold']}), - battery({percentageReporting: false}), + m.battery({percentageReporting: false}), /* * reporting.batteryPercentageRemaining removed as it was causing devices to fall of the network * every 1 hour, with light flashing when it happened, extremely short battery life, 2 presses for @@ -44,21 +44,21 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_zfirri2d'}], + fingerprint: tuya.fingerprint('TS0201', ['_TZ3000_zfirri2d']), model: 'SBDV-00079', vendor: 'Sber', description: 'Smart temperature and humidity sensor', - extend: [temperature(), humidity(), battery({voltage: true, voltageReporting: true})], + extend: [m.temperature(), m.humidity(), m.battery({voltage: true, voltageReporting: true})], }, { - fingerprint: [{modelID: 'TS0207', manufacturerName: '_TZ3000_c8bqthpo'}], + fingerprint: tuya.fingerprint('TS0207', ['_TZ3000_c8bqthpo']), model: 'SBDV-00154', vendor: 'Sber', description: 'Smart water leak sensor', extend: [ - ignoreClusterReport({cluster: 'genBasic'}), - iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'battery_low']}), - battery(), + m.ignoreClusterReport({cluster: 'genBasic'}), + m.iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'battery_low']}), + m.battery(), ], }, ]; diff --git a/src/devices/scanproducts.ts b/src/devices/scanproducts.ts index 180a7809dfe81..39ee339386c68 100644 --- a/src/devices/scanproducts.ts +++ b/src/devices/scanproducts.ts @@ -1,4 +1,4 @@ -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: '12501', vendor: 'Scan Products', description: 'Zigbee push dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['12502'], model: '12502', vendor: 'Scan Products', description: 'Zigbee 3.0 switch', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/schneider_electric.ts b/src/devices/schneider_electric.ts index 80ef4f831ccad..7426a3449c66b 100644 --- a/src/devices/schneider_electric.ts +++ b/src/devices/schneider_electric.ts @@ -4,26 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import { - battery, - commandsLevelCtrl, - commandsOnOff, - deviceAddCustomCluster, - deviceEndpoints, - electricityMeter, - enumLookup, - iasZoneAlarm, - identify, - illuminance, - light, - lightingBallast, - numeric, - occupancy, - onOff, - ScaleFunction, - setupConfigureForReading, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue, ModernExtend, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -37,7 +18,7 @@ function indicatorMode(endpoint?: string) { if (endpoint) { description = 'Set Indicator Mode for ' + endpoint + ' switch.'; } - return enumLookup({ + return m.enumLookup({ name: 'indicator_mode', lookup: { reverse_with_load: 2, @@ -53,7 +34,7 @@ function indicatorMode(endpoint?: string) { } function socketIndicatorMode() { - return enumLookup({ + return m.enumLookup({ name: 'indicator_mode', lookup: { reverse_with_load: 0, @@ -69,7 +50,7 @@ function socketIndicatorMode() { function fanIndicatorMode() { const description = 'Set Indicator Mode.'; - return enumLookup({ + return m.enumLookup({ name: 'indicator_mode', lookup: { always_on: 3, @@ -84,7 +65,7 @@ function fanIndicatorMode() { function fanIndicatorOrientation() { const description = 'Set Indicator Orientation.'; - return enumLookup({ + return m.enumLookup({ name: 'indicator_orientation', lookup: { horizontal_left: 2, @@ -103,7 +84,7 @@ function switchActions(endpoint?: string) { if (endpoint) { description = 'Set Switch Action for ' + endpoint + ' Button.'; } - return enumLookup({ + return m.enumLookup({ name: 'switch_actions', lookup: { light: 0, @@ -130,7 +111,7 @@ function switchActions(endpoint?: string) { const schneiderElectricExtend = { addVisaConfigurationCluster: (enumDataType: Zcl.DataType.ENUM8 | Zcl.DataType.UINT8) => - deviceAddCustomCluster('visaConfiguration', { + m.deviceAddCustomCluster('visaConfiguration', { ID: 0xfc04, manufacturerCode: Zcl.ManufacturerCode.SCHNEIDER_ELECTRIC, attributes: { @@ -150,7 +131,7 @@ const schneiderElectricExtend = { commandsResponse: {}, }), visaConfigIndicatorLuminanceLevel: (): ModernExtend => { - return enumLookup({ + return m.enumLookup({ name: 'indicator_luminance_level', lookup: { '100': 0, @@ -166,7 +147,7 @@ const schneiderElectricExtend = { }); }, visaConfigIndicatorColor: (): ModernExtend => { - return enumLookup({ + return m.enumLookup({ name: 'indicator_color', lookup: { white: 0, @@ -178,7 +159,7 @@ const schneiderElectricExtend = { }); }, visaIndicatorMode: ([reverseWithLoad, consistentWithLoad, alwaysOff, alwaysOn]: number[]): ModernExtend => { - return enumLookup({ + return m.enumLookup({ name: 'indicator_mode', lookup: { reverse_with_load: reverseWithLoad, @@ -195,7 +176,7 @@ const schneiderElectricExtend = { const attribute = `motorTypeChannel${channel || ''}`; const description = `Set motor type for channel ${channel || ''}`; - return enumLookup({ + return m.enumLookup({ name: 'motor_type' + (channel ? `_${channel}` : ''), lookup: { ac_motor: 0, @@ -210,7 +191,7 @@ const schneiderElectricExtend = { const attribute = `curtainStatusChannel${channel || ''}`; const description = `Set curtain status for channel ${channel}`; - return enumLookup({ + return m.enumLookup({ access: 'STATE', name: 'curtain_status' + (channel ? `_${channel}` : ''), lookup: { @@ -319,7 +300,7 @@ const schneiderElectricExtend = { }, dimmingMode: (): ModernExtend => { - const extend = enumLookup({ + const extend = m.enumLookup({ name: 'dimmer_mode', lookup: { Auto: 0, @@ -330,12 +311,12 @@ const schneiderElectricExtend = { description: 'Auto detects the correct mode for the ballast. RL-LED may have improved dimming quality for LEDs.', entityCategory: 'config', }); - extend.configure.push(setupConfigureForReading('lightingBallastCfg', ['wiserControlMode'])); + extend.configure.push(m.setupConfigureForReading('lightingBallastCfg', ['wiserControlMode'])); return extend; }, addOccupancyConfigurationCluster: () => - deviceAddCustomCluster('occupancyConfiguration', { + m.deviceAddCustomCluster('occupancyConfiguration', { ID: 0xff19, manufacturerCode: Zcl.ManufacturerCode.SCHNEIDER_ELECTRIC, attributes: { @@ -349,7 +330,7 @@ const schneiderElectricExtend = { }), occupancyConfiguration: (): ModernExtend => { - const extend = enumLookup({ + const extend = m.enumLookup({ name: 'occupancy_sensitivity', lookup: { Low: 50, @@ -365,7 +346,7 @@ const schneiderElectricExtend = { entityCategory: 'config', }); - const luxScale: ScaleFunction = (value: number, type: 'from' | 'to') => { + const luxScale: m.ScaleFunction = (value: number, type: 'from' | 'to') => { if (type === 'from') { return Math.round(Math.pow(10, (value - 1) / 10000)); } else { @@ -373,7 +354,7 @@ const schneiderElectricExtend = { } }; - const luxThresholdExtend = numeric({ + const luxThresholdExtend = m.numeric({ name: 'ambience_light_threshold', cluster: 'occupancyConfiguration', attribute: 'ambienceLightThreshold', @@ -388,7 +369,7 @@ const schneiderElectricExtend = { extend.fromZigbee.push(...luxThresholdExtend.fromZigbee); extend.toZigbee.push(...luxThresholdExtend.toZigbee); extend.exposes.push(...luxThresholdExtend.exposes); - extend.configure.push(setupConfigureForReading('occupancyConfiguration', ['ambienceLightThreshold'])); + extend.configure.push(m.setupConfigureForReading('occupancyConfiguration', ['ambienceLightThreshold'])); return extend; }, @@ -656,7 +637,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'U202DST600ZB', vendor: 'Schneider Electric', description: 'EZinstall3 2 gang 2x300W dimmer module', - extend: [deviceEndpoints({endpoints: {l1: 10, l2: 11}}), light({endpointNames: ['l1', 'l2'], configureReporting: true})], + extend: [m.deviceEndpoints({endpoints: {l1: 10, l2: 11}}), m.light({endpointNames: ['l1', 'l2'], configureReporting: true})], }, { zigbeeModel: ['PUCK/DIMMER/1'], @@ -664,7 +645,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Micro module dimmer', ota: true, - extend: [light({configureReporting: true, levelConfig: {}})], + extend: [m.light({configureReporting: true, levelConfig: {}})], fromZigbee: [fz.wiser_lighting_ballast_configuration], toZigbee: [tz.ballast_config, tz.wiser_dimmer_mode], exposes: [ @@ -682,7 +663,10 @@ const definitions: DefinitionWithExtend[] = [ .enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led']) .withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)'), ], - whiteLabel: [{vendor: 'Elko', model: 'EKO07090'}], + whiteLabel: [ + {vendor: 'Elko', model: 'EKO07090'}, + {vendor: 'Schneider Electric', model: '550B1012'}, + ], }, { zigbeeModel: ['PUCK/SWITCH/1'], @@ -690,7 +674,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Micro module switch', ota: true, - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], whiteLabel: [{vendor: 'Elko', model: 'EKO07144'}], }, { @@ -699,7 +683,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Micro module dimmer with neutral lead', ota: true, - extend: [light({configureReporting: true, levelConfig: {}})], + extend: [m.light({configureReporting: true, levelConfig: {}})], fromZigbee: [fz.wiser_lighting_ballast_configuration], toZigbee: [tz.ballast_config, tz.wiser_dimmer_mode], exposes: [ @@ -724,7 +708,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser power micromodule', whiteLabel: [{vendor: 'Elko', model: 'EKO20004'}], - extend: [onOff({powerOnBehavior: true}), electricityMeter({cluster: 'metering'}), identify()], + extend: [m.onOff({powerOnBehavior: true}), m.electricityMeter({cluster: 'metering'}), m.identify()], }, { zigbeeModel: ['NHROTARY/DIMMER/1'], @@ -762,7 +746,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Rotary dimmer', extend: [ - light({ + m.light({ effect: false, powerOnBehavior: false, color: false, @@ -771,7 +755,7 @@ const definitions: DefinitionWithExtend[] = [ disabledFeatures: ['on_transition_time', 'off_transition_time', 'on_off_transition_time', 'execute_if_off'], }, }), - lightingBallast(), + m.lightingBallast(), schneiderElectricExtend.dimmingMode(), ], whiteLabel: [ @@ -898,7 +882,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser 40/300-Series module switch 2AX', ota: true, - extend: [onOff({powerOnBehavior: false}), indicatorMode('smart')], + extend: [m.onOff({powerOnBehavior: false}), indicatorMode('smart')], meta: {multiEndpoint: true}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); @@ -915,7 +899,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser 40/300-Series module switch 10AX with ControlLink', ota: true, - extend: [onOff({powerOnBehavior: false}), indicatorMode('smart')], + extend: [m.onOff({powerOnBehavior: false}), indicatorMode('smart')], meta: {multiEndpoint: true}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); @@ -971,14 +955,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'U201DST600ZB', vendor: 'Schneider Electric', description: 'EZinstall3 1 gang 550W dimmer module', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['U201SRY2KWZB'], model: 'U201SRY2KWZB', vendor: 'Schneider Electric', description: 'Ulti 240V 9.1 A 1 gang relay switch impress switch module, amber LED', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['CCTFR6100'], @@ -1028,14 +1012,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'S520530W', vendor: 'Schneider Electric', description: 'Odace connectable relay switch 10A', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['U202SRY2KWZB'], model: 'U202SRY2KWZB', vendor: 'Schneider Electric', description: 'Ulti 240V 9.1 A 2 gangs relay switch impress switch module, amber LED', - extend: [deviceEndpoints({endpoints: {l1: 10, l2: 11}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 10, l2: 11}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['1GANG/SHUTTER/1'], @@ -1144,8 +1128,8 @@ const definitions: DefinitionWithExtend[] = [ .withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)'), ], extend: [ - deviceEndpoints({endpoints: {left: 4, right: 3, left_btn: 22, right_btn: 21}}), - light({endpointNames: ['left', 'right'], configureReporting: true}), + m.deviceEndpoints({endpoints: {left: 4, right: 3, left_btn: 22, right_btn: 21}}), + m.light({endpointNames: ['left', 'right'], configureReporting: true}), switchActions('left_btn'), switchActions('right_btn'), indicatorMode('left_btn'), @@ -1156,7 +1140,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'MEG5161-0000', vendor: 'Schneider Electric', description: 'Merten PlusLink relay insert with Merten Wiser system M push button (1fold)', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['LK Switch'], @@ -1192,7 +1176,7 @@ const definitions: DefinitionWithExtend[] = [ return {l1: 3, s1: 21, s2: 22, s3: 23, s4: 24}; }, meta: {multiEndpoint: true}, - extend: [light({endpointNames: ['l1'], configureReporting: true, levelConfig: {}})], + extend: [m.light({endpointNames: ['l1'], configureReporting: true, levelConfig: {}})], exposes: [ e .numeric('ballast_minimum_level', ea.ALL) @@ -1386,7 +1370,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'MEG5126-0300', vendor: 'Schneider Electric', description: 'Merten MEG5165 PlusLink relais insert with Merten Wiser System M push button (2fold)', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['EH-ZB-VACT'], @@ -1544,12 +1528,12 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser wireless switch 1-gang or 2-gang', extend: [ - battery(), - deviceEndpoints({endpoints: {right: 21, left: 22}}), + m.battery(), + m.deviceEndpoints({endpoints: {right: 21, left: 22}}), switchActions('right'), switchActions('left'), - commandsOnOff({endpointNames: ['right', 'left']}), - commandsLevelCtrl({endpointNames: ['right', 'left']}), + m.commandsOnOff({endpointNames: ['right', 'left']}), + m.commandsLevelCtrl({endpointNames: ['right', 'left']}), ], }, { @@ -1632,7 +1616,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'MUR36014', vendor: 'Schneider Electric', description: 'Mureva EVlink Smart socket outlet', - extend: [onOff({powerOnBehavior: true}), electricityMeter()], + extend: [m.onOff({powerOnBehavior: true}), m.electricityMeter()], }, { zigbeeModel: ['NHMOTION/SWITCH/1'], @@ -1640,12 +1624,12 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Motion sensor with switch', extend: [ - onOff({ + m.onOff({ powerOnBehavior: false, configureReporting: true, }), - illuminance(), - occupancy({ + m.illuminance(), + m.occupancy({ pirConfig: ['otu_delay'], }), schneiderElectricExtend.addOccupancyConfigurationCluster(), @@ -1664,16 +1648,16 @@ const definitions: DefinitionWithExtend[] = [ model: 'CCT595011', vendor: 'Schneider Electric', description: 'Wiser motion sensor', - fromZigbee: [fz.battery, fz.ias_enroll, fz.ias_occupancy_only_alarm_2, fz.illuminance], + fromZigbee: [fz.battery, fz.ias_enroll, fz.ias_occupancy_only_alarm_2], toZigbee: [], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - const binds = ['genPowerCfg', 'msIlluminanceMeasurement']; + const binds = ['genPowerCfg']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.batteryPercentageRemaining(endpoint); - await reporting.illuminance(endpoint, {min: 15, max: constants.repInterval.HOUR, change: 500}); }, - exposes: [e.battery(), e.illuminance(), e.occupancy()], + exposes: [e.battery(), e.occupancy()], + extend: [m.illuminance()], }, { zigbeeModel: ['CH/Socket/2'], @@ -1681,7 +1665,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Dual connected smart socket', ota: true, - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { zigbeeModel: ['CCT592011_AS'], @@ -1728,9 +1712,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser smoke alarm', extend: [ - battery({voltage: true, voltageReporting: true}), - temperature(), - iasZoneAlarm({ + m.battery({voltage: true, voltageReporting: true}), + m.temperature(), + m.iasZoneAlarm({ zoneType: 'smoke', zoneAttributes: ['alarm_1', 'tamper', 'battery_low', 'test'], zoneStatusReporting: true, @@ -1897,10 +1881,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Merten MEG5152 switch insert (2fold) with Merten System M push button (2fold)', extend: [ - deviceEndpoints({endpoints: {left: 1, right: 2, left_sw: 21, right_sw: 22}}), - identify(), - onOff({powerOnBehavior: false, endpointNames: ['left', 'right']}), - commandsOnOff({endpointNames: ['left_sw', 'right_sw']}), + m.deviceEndpoints({endpoints: {left: 1, right: 2, left_sw: 21, right_sw: 22}}), + m.identify(), + m.onOff({powerOnBehavior: false, endpointNames: ['left', 'right']}), + m.commandsOnOff({endpointNames: ['left_sw', 'right_sw']}), ], }, { @@ -1909,10 +1893,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Merten MEG5162 switch insert (2fold) with Merten System M push button (1fold)', extend: [ - deviceEndpoints({endpoints: {left: 1, right: 2, left_sw: 21}}), - identify(), - onOff({powerOnBehavior: false, endpointNames: ['left', 'right']}), - commandsOnOff({endpointNames: ['left_sw']}), + m.deviceEndpoints({endpoints: {left: 1, right: 2, left_sw: 21}}), + m.identify(), + m.onOff({powerOnBehavior: false, endpointNames: ['left', 'right']}), + m.commandsOnOff({endpointNames: ['left_sw']}), ], }, { @@ -1921,10 +1905,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Merten MEG5151 switch insert with Merten System M push button (1fold)', extend: [ - deviceEndpoints({endpoints: {switch: 1, switch_sw: 21}}), - identify(), - onOff({powerOnBehavior: false}), - commandsOnOff({endpointNames: ['switch_sw']}), + m.deviceEndpoints({endpoints: {switch: 1, switch_sw: 21}}), + m.identify(), + m.onOff({powerOnBehavior: false}), + m.commandsOnOff({endpointNames: ['switch_sw']}), ], }, { @@ -1933,7 +1917,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 1G dimmer switch', extend: [ - light({ + m.light({ effect: false, color: false, powerOnBehavior: false, @@ -1961,8 +1945,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 2G dimmer switch', extend: [ - deviceEndpoints({endpoints: {l1: 10, l2: 11}}), - light({ + m.deviceEndpoints({endpoints: {l1: 10, l2: 11}}), + m.light({ endpointNames: ['l1', 'l2'], effect: false, color: false, @@ -1991,8 +1975,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 1G onoff switch', extend: [ - deviceEndpoints({endpoints: {l1: 10}}), - onOff({endpointNames: ['l1'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 10}}), + m.onOff({endpointNames: ['l1'], powerOnBehavior: false}), schneiderElectricExtend.addVisaConfigurationCluster(Zcl.DataType.UINT8), schneiderElectricExtend.visaConfigIndicatorLuminanceLevel(), schneiderElectricExtend.visaConfigIndicatorColor(), @@ -2005,8 +1989,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 1G onoff switch', extend: [ - deviceEndpoints({endpoints: {l1: 10}}), - onOff({endpointNames: ['l1'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 10}}), + m.onOff({endpointNames: ['l1'], powerOnBehavior: false}), schneiderElectricExtend.addVisaConfigurationCluster(Zcl.DataType.UINT8), schneiderElectricExtend.visaIndicatorMode([0, 1, 2, 3]), ], @@ -2017,8 +2001,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 2G onoff switch', extend: [ - deviceEndpoints({endpoints: {l1: 10, l2: 11}}), - onOff({endpointNames: ['l1', 'l2'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 10, l2: 11}}), + m.onOff({endpointNames: ['l1', 'l2'], powerOnBehavior: false}), schneiderElectricExtend.addVisaConfigurationCluster(Zcl.DataType.UINT8), schneiderElectricExtend.visaConfigIndicatorLuminanceLevel(), schneiderElectricExtend.visaConfigIndicatorColor(), @@ -2031,8 +2015,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 2G onoff switch', extend: [ - deviceEndpoints({endpoints: {l1: 10, l2: 11}}), - onOff({endpointNames: ['l1', 'l2'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 10, l2: 11}}), + m.onOff({endpointNames: ['l1', 'l2'], powerOnBehavior: false}), schneiderElectricExtend.addVisaConfigurationCluster(Zcl.DataType.UINT8), schneiderElectricExtend.visaIndicatorMode([0, 1, 2, 3]), ], @@ -2043,8 +2027,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 3G onoff switch', extend: [ - deviceEndpoints({endpoints: {l1: 10, l2: 11, l3: 12}}), - onOff({endpointNames: ['l1', 'l2', 'l3'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 10, l2: 11, l3: 12}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3'], powerOnBehavior: false}), schneiderElectricExtend.addVisaConfigurationCluster(Zcl.DataType.UINT8), schneiderElectricExtend.visaConfigIndicatorLuminanceLevel(), schneiderElectricExtend.visaConfigIndicatorColor(), @@ -2057,8 +2041,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 3G onoff switch', extend: [ - deviceEndpoints({endpoints: {l1: 10, l2: 11, l3: 12}}), - onOff({endpointNames: ['l1', 'l2', 'l3'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 10, l2: 11, l3: 12}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3'], powerOnBehavior: false}), schneiderElectricExtend.addVisaConfigurationCluster(Zcl.DataType.UINT8), schneiderElectricExtend.visaIndicatorMode([0, 1, 2, 3]), ], @@ -2069,7 +2053,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Wiser AvatarOn 2G curtain switch', extend: [ - deviceEndpoints({endpoints: {l1: 10, l2: 11}}), + m.deviceEndpoints({endpoints: {l1: 10, l2: 11}}), schneiderElectricExtend.addVisaConfigurationCluster(Zcl.DataType.UINT8), schneiderElectricExtend.visaConfigIndicatorLuminanceLevel(), schneiderElectricExtend.visaConfigIndicatorColor(), @@ -2102,7 +2086,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Motion sensor with dimmer', extend: [ - light({ + m.light({ effect: false, powerOnBehavior: false, color: false, @@ -2111,9 +2095,9 @@ const definitions: DefinitionWithExtend[] = [ disabledFeatures: ['on_transition_time', 'off_transition_time', 'on_off_transition_time', 'execute_if_off'], }, }), - lightingBallast(), - illuminance(), - occupancy({ + m.lightingBallast(), + m.illuminance(), + m.occupancy({ pirConfig: ['otu_delay'], }), schneiderElectricExtend.addOccupancyConfigurationCluster(), @@ -2136,7 +2120,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Schneider Electric', description: 'Motion sensor with dimmer', extend: [ - light({ + m.light({ effect: false, powerOnBehavior: false, color: false, @@ -2145,9 +2129,9 @@ const definitions: DefinitionWithExtend[] = [ disabledFeatures: ['on_off_transition_time', 'on_transition_time', 'off_transition_time', 'execute_if_off'], }, }), - lightingBallast(), - illuminance(), - occupancy({ + m.lightingBallast(), + m.illuminance(), + m.occupancy({ pirConfig: ['otu_delay'], }), schneiderElectricExtend.addOccupancyConfigurationCluster(), diff --git a/src/devices/schwaiger.ts b/src/devices/schwaiger.ts index 536036d8db1ec..1a23b03271a1b 100644 --- a/src/devices/schwaiger.ts +++ b/src/devices/schwaiger.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -31,42 +31,42 @@ const definitions: DefinitionWithExtend[] = [ model: 'HAL300', vendor: 'Schwaiger', description: 'Tint LED bulb E27 806 lumen, dimmable, color, white 1800-6500K', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['ZBT-DIMLight-Candle0800'], model: 'HAL600', vendor: 'Schwaiger', description: 'LED candle bulb E14 470 lumen, dimmable, color, white 2700K', - extend: [light()], + extend: [m.light()], }, { fingerprint: [{modelID: 'ZBT-CCTLight-GU100904', manufacturerName: 'LDS'}], model: 'HAL500', vendor: 'Schwaiger', description: 'LED bulb GU10 350 lumen, dimmable, color, white 2700-6500K', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['ZBT-DIMLight-GU100800'], model: 'HAL400', vendor: 'Schwaiger', description: 'LED Schwaiger HAL400 GU10 dimmable, warm white', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZBT-RGBWLight-C4700114'], model: 'HAL800', vendor: 'Schwaiger', description: 'LED candle bulb E14 470 lumen, dimmable, color, white 1800-6500K', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, { zigbeeModel: ['ZBT-RGBWLight-GU100114'], model: 'HAL550', vendor: 'Schwaiger', description: 'Smart light bulb LED RGB dimmable GU10', - extend: [light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: {modes: ['xy', 'hs'], enhancedHue: true}})], }, ]; diff --git a/src/devices/seastar_intelligence.ts b/src/devices/seastar_intelligence.ts index fb12b940fa2db..8637b00e0e7f6 100644 --- a/src/devices/seastar_intelligence.ts +++ b/src/devices/seastar_intelligence.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '020B0B', vendor: 'Fischer & Honsel', description: 'LED Tischleuchte Beta Zig', - extend: [light({colorTemp: {range: [153, 370]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 370]}, color: true})], endpoint: (device) => { // https://github.com/Koenkk/zigbee-herdsman-converters/issues/5463 const endpoint = device.endpoints.find((e) => e.inputClusters.includes(6)).ID; diff --git a/src/devices/sengled.ts b/src/devices/sengled.ts index 665c1ccc069a5..4e22abc747dee 100644 --- a/src/devices/sengled.ts +++ b/src/devices/sengled.ts @@ -1,24 +1,11 @@ import {Zcl} from 'zigbee-herdsman'; import {presets} from '../lib/exposes'; -import { - battery, - binary, - deviceAddCustomCluster, - electricityMeter, - enumLookup, - forcePowerSource, - iasZoneAlarm, - identify, - LightArgs, - light as lightDontUse, - numeric, - onOff, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend, Expose, Fz, KeyValueAny, ModernExtend} from '../lib/types'; -export function sengledLight(args?: LightArgs) { - return lightDontUse({effect: false, powerOnBehavior: false, ...args}); +export function sengledLight(args?: m.LightArgs) { + return m.light({effect: false, powerOnBehavior: false, ...args}); } export function sengledSwitchAction(): ModernExtend { @@ -64,7 +51,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E13-N11', vendor: 'Sengled', description: 'Flood light with motion sensor light outdoor', - extend: [sengledLight(), iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1']})], + extend: [sengledLight(), m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1']})], ota: true, }, { @@ -81,9 +68,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Smart LED multicolor A19 bulb', extend: [ - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), sengledLight({colorTemp: {range: [154, 500]}, color: {modes: ['xy']}}), - electricityMeter({cluster: 'metering'}), + m.electricityMeter({cluster: 'metering'}), ], ota: true, }, @@ -93,9 +80,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Smart LED multicolor BR30 bulb', extend: [ - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), sengledLight({colorTemp: {range: [154, 500]}, color: {modes: ['xy']}}), - electricityMeter({cluster: 'metering'}), + m.electricityMeter({cluster: 'metering'}), ], ota: true, }, @@ -105,9 +92,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Smart LED multicolor (BR30)', extend: [ - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), sengledLight({colorTemp: {range: [154, 500]}, color: {modes: ['xy']}}), - electricityMeter({cluster: 'metering'}), + m.electricityMeter({cluster: 'metering'}), ], ota: true, }, @@ -132,7 +119,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E11-G13', vendor: 'Sengled', description: 'Element classic (A19)', - extend: [forcePowerSource({powerSource: 'Mains (single phase)'}), sengledLight(), electricityMeter({cluster: 'metering'})], + extend: [m.forcePowerSource({powerSource: 'Mains (single phase)'}), sengledLight(), m.electricityMeter({cluster: 'metering'})], ota: true, }, { @@ -164,7 +151,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'Z01-A19NAE26', vendor: 'Sengled', description: 'Element plus (A19)', - extend: [sengledLight({colorTemp: {range: [154, 500]}}), electricityMeter({cluster: 'metering'})], + extend: [sengledLight({colorTemp: {range: [154, 500]}}), m.electricityMeter({cluster: 'metering'})], ota: true, }, { @@ -181,9 +168,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Element plus color (A19)', extend: [ - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), sengledLight({colorTemp: {range: [154, 500]}, color: {modes: ['xy']}}), - electricityMeter({cluster: 'metering'}), + m.electricityMeter({cluster: 'metering'}), ], ota: true, }, @@ -209,9 +196,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Element color plus E12', extend: [ - forcePowerSource({powerSource: 'Mains (single phase)'}), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), sengledLight({colorTemp: {range: [154, 500]}, color: {modes: ['xy']}}), - electricityMeter({cluster: 'metering'}), + m.electricityMeter({cluster: 'metering'}), ], ota: true, }, @@ -237,8 +224,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Smart window and door sensor', extend: [ - iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), - battery({voltage: true, voltageReporting: true}), + m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({voltage: true, voltageReporting: true}), ], ota: true, }, @@ -248,8 +235,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Smart window and door sensor G2', extend: [ - iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), - battery({voltage: true, voltageReporting: true}), + m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']}), + m.battery({voltage: true, voltageReporting: true}), ], ota: true, }, @@ -258,7 +245,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E1C-NB6', vendor: 'Sengled', description: 'Smart plug', - extend: [onOff()], + extend: [m.onOff()], ota: true, }, { @@ -266,7 +253,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E1C-NB7', vendor: 'Sengled', description: 'Smart plug with energy tracker', - extend: [onOff({powerOnBehavior: false}), electricityMeter({cluster: 'metering'})], + extend: [m.onOff({powerOnBehavior: false}), m.electricityMeter({cluster: 'metering'})], }, { zigbeeModel: ['E1E-G7F'], @@ -297,7 +284,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'E21-N14A', vendor: 'Sengled', description: 'Smart light bulb, dimmable 5000K, E26/A19', - extend: [sengledLight(), electricityMeter({cluster: 'metering'})], + extend: [sengledLight(), m.electricityMeter({cluster: 'metering'})], ota: true, }, { @@ -306,12 +293,12 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sengled', description: 'Flood light with motion sensor light outdoor', extend: [ - identify(), + m.identify(), sengledLight({color: false}), // The Sengled E13-A21 smart bulb will not report instantaneous demand unless the reporting min is set to 5 seconds or lower. // https://github.com/Koenkk/zigbee-herdsman-converters/pull/8123 - electricityMeter({cluster: 'metering', power: {min: 5}, energy: {min: 5}}), - deviceAddCustomCluster('manuSpecificSengledMotionSensor', { + m.electricityMeter({cluster: 'metering', power: {min: 5}, energy: {min: 5}}), + m.deviceAddCustomCluster('manuSpecificSengledMotionSensor', { ID: 0xfc01, manufacturerCode: Zcl.ManufacturerCode.SENGLED_CO_LTD, attributes: { @@ -323,7 +310,7 @@ const definitions: DefinitionWithExtend[] = [ commands: {}, commandsResponse: {}, }), - enumLookup({ + m.enumLookup({ name: 'trigger_condition', lookup: {dark: 0, weak_light: 1}, cluster: 'manuSpecificSengledMotionSensor', @@ -332,7 +319,7 @@ const definitions: DefinitionWithExtend[] = [ zigbeeCommandOptions: {manufacturerCode: 0x1160}, access: 'STATE_SET', }), - binary({ + m.binary({ name: 'enable_auto_on_off', cluster: 'manuSpecificSengledMotionSensor', attribute: 'enableAutoOnOff', @@ -342,7 +329,7 @@ const definitions: DefinitionWithExtend[] = [ zigbeeCommandOptions: {manufacturerCode: 0x1160}, access: 'STATE_SET', }), - binary({ + m.binary({ name: 'motion_status', cluster: 'manuSpecificSengledMotionSensor', attribute: 'motionStatus', @@ -353,7 +340,7 @@ const definitions: DefinitionWithExtend[] = [ zigbeeCommandOptions: {manufacturerCode: 0x1160}, access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'off_delay', cluster: 'manuSpecificSengledMotionSensor', attribute: 'offDelay', diff --git a/src/devices/sercomm.ts b/src/devices/sercomm.ts index f4c639fe57b0f..5aff4600741c9 100644 --- a/src/devices/sercomm.ts +++ b/src/devices/sercomm.ts @@ -1,6 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -127,17 +128,17 @@ const definitions: DefinitionWithExtend[] = [ model: 'SZ-PIR04N', vendor: 'Sercomm', description: 'PIR motion & temperature sensor', - fromZigbee: [fz.ias_occupancy_alarm_1, fz.illuminance, fz.temperature, fz.battery], + fromZigbee: [fz.ias_occupancy_alarm_1, fz.temperature, fz.battery], toZigbee: [], meta: {battery: {voltageToPercentage: {min: 2500, max: 3200}}}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - await reporting.bind(endpoint, coordinatorEndpoint, ['msIlluminanceMeasurement', 'msTemperatureMeasurement', 'genPowerCfg']); - await reporting.illuminance(endpoint); + await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']); await reporting.temperature(endpoint); await reporting.batteryVoltage(endpoint); }, - exposes: [e.occupancy(), e.tamper(), e.illuminance(), e.temperature(), e.battery(), e.battery_voltage()], + exposes: [e.occupancy(), e.tamper(), e.temperature(), e.battery(), e.battery_voltage()], + extend: [m.illuminance()], }, { zigbeeModel: ['SZ-WTD03'], diff --git a/src/devices/shenzhen_homa.ts b/src/devices/shenzhen_homa.ts index 6e93be77b18bf..06d1bd7ffb67d 100644 --- a/src/devices/shenzhen_homa.ts +++ b/src/devices/shenzhen_homa.ts @@ -1,4 +1,4 @@ -import {deviceEndpoints, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -16,7 +16,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HOMA1001_RGBW', vendor: 'Shenzhen Homa', description: 'Smart LED driver RGBW', - extend: [deviceEndpoints({endpoints: {white: 10, rgb: 11}}), light({endpointNames: ['white', 'rgb'], color: true})], + extend: [m.deviceEndpoints({endpoints: {white: 10, rgb: 11}}), m.light({endpointNames: ['white', 'rgb'], color: true})], }, { fingerprint: [ @@ -31,7 +31,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HOMA1001_RGB', vendor: 'Shenzhen Homa', description: 'Smart LED driver RGB', - extend: [light({color: true})], + extend: [m.light({color: true})], }, { fingerprint: [ @@ -46,7 +46,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HOMA1001_CT', vendor: 'Shenzhen Homa', description: 'Smart LED driver CT', - extend: [light()], + extend: [m.light()], }, { fingerprint: [ @@ -61,49 +61,49 @@ const definitions: DefinitionWithExtend[] = [ model: 'HOMA1001_SC', vendor: 'Shenzhen Homa', description: 'Smart LED driver SC', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['HOMA1008', '00A'], model: 'HLD812-Z-SC', vendor: 'Shenzhen Homa', description: 'Smart LED driver', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['HOMA1009', '050', 'HOMA1022'], model: 'HLD503-Z-CT', vendor: 'Shenzhen Homa', description: 'Smart LED driver', - extend: [light({colorTemp: {range: [150, 500]}})], + extend: [m.light({colorTemp: {range: [150, 500]}})], }, { zigbeeModel: ['HOMA1002', 'HOMA1004', 'HOMA0019', 'HOMA0006', 'HOMA000F', '019'], model: 'HLC610-Z', vendor: 'Shenzhen Homa', description: 'Wireless dimmable controller', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['HOMA1031'], model: 'HLC821-Z-SC', vendor: 'Shenzhen Homa', description: 'ZigBee AC phase-cut dimmer', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['HOMA1005'], model: 'HLC614-ZLL', vendor: 'Shenzhen Homa', description: '3 channel relay module', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), onOff({endpointNames: ['l1', 'l2', 'l3']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), m.onOff({endpointNames: ['l1', 'l2', 'l3']})], }, { zigbeeModel: ['HOMA1064', '012'], model: 'HLC833-Z-SC', vendor: 'Shenzhen Homa', description: 'Wireless dimmable controller', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/shinasystem.ts b/src/devices/shinasystem.ts index 3a095f43303a6..ba5c93a840804 100644 --- a/src/devices/shinasystem.ts +++ b/src/devices/shinasystem.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, electricityMeter, enumLookup, numeric, onOff, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {DefinitionWithExtend, Fz, Tz} from '../lib/types'; @@ -240,33 +240,33 @@ const definitions: DefinitionWithExtend[] = [ ota: true, description: 'SiHAS multipurpose sensor', meta: {battery: {voltageToPercentage: '3V_2100'}}, - fromZigbee: [fz.battery, fz.temperature, fz.humidity, fz.occupancy, fz.illuminance], + fromZigbee: [fz.battery, fz.temperature, fz.humidity, fz.occupancy], toZigbee: [], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - const binds = ['genPowerCfg', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msRelativeHumidity', 'msOccupancySensing']; + const binds = ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'msOccupancySensing']; await reporting.bind(endpoint, coordinatorEndpoint, binds); await reporting.batteryVoltage(endpoint, {min: 30, max: 21600, change: 1}); await reporting.occupancy(endpoint, {min: 1, max: 600, change: 1}); await reporting.temperature(endpoint, {min: 20, max: 300, change: 10}); await reporting.humidity(endpoint, {min: 20, max: 300, change: 40}); - await reporting.illuminance(endpoint, {min: 20, max: 3600, change: 10}); }, - exposes: [e.battery(), e.battery_voltage(), e.temperature(), e.humidity(), e.occupancy(), e.illuminance()], + exposes: [e.battery(), e.battery_voltage(), e.temperature(), e.humidity(), e.occupancy()], + extend: [m.illuminance()], }, { zigbeeModel: ['SBM300Z1'], model: 'SBM300Z1', vendor: 'ShinaSystem', description: 'SiHAS IOT smart switch 1 gang', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['SBM300Z2'], model: 'SBM300Z2', vendor: 'ShinaSystem', description: 'SiHAS IOT smart switch 2 gang', - extend: [deviceEndpoints({endpoints: {top: 1, bottom: 2}}), onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], + extend: [m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), m.onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], }, { zigbeeModel: ['SBM300Z3'], @@ -274,8 +274,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS IOT smart switch 3 gang', extend: [ - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), - onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), ], }, { @@ -284,8 +284,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS IOT smart switch 4 gang', extend: [ - deviceEndpoints({endpoints: {top_left: 1, bottom_left: 2, top_right: 3, bottom_right: 4}}), - onOff({endpointNames: ['top_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top_left: 1, bottom_left: 2, top_right: 3, bottom_right: 4}}), + m.onOff({endpointNames: ['top_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), ], }, { @@ -294,8 +294,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS IOT smart switch 5 gang', extend: [ - deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, bottom_right: 5}}), - onOff({endpointNames: ['top_left', 'center_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, bottom_right: 5}}), + m.onOff({endpointNames: ['top_left', 'center_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), ], }, { @@ -304,8 +304,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS IOT smart switch 6 gang', extend: [ - deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, center_right: 5, bottom_right: 6}}), - onOff({ + m.deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, center_right: 5, bottom_right: 6}}), + m.onOff({ endpointNames: ['top_left', 'center_left', 'bottom_left', 'top_right', 'center_right', 'bottom_right'], powerOnBehavior: false, }), @@ -585,7 +585,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'PMM-300Z1', vendor: 'ShinaSystem', description: 'SiHAS energy monitor', - extend: [electricityMeter()], + extend: [m.electricityMeter()], }, { zigbeeModel: ['PMM-300Z2'], @@ -593,7 +593,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', ota: true, description: 'SiHAS energy monitor', - extend: [electricityMeter({acFrequency: {multiplier: 1, divisor: 10}, powerFactor: true}), temperature()], + extend: [m.electricityMeter({acFrequency: {multiplier: 1, divisor: 10}, powerFactor: true}), m.temperature()], }, { zigbeeModel: ['PMM-300Z3'], @@ -601,7 +601,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', ota: true, description: 'SiHAS 3phase energy monitor', - extend: [electricityMeter({acFrequency: {multiplier: 1, divisor: 10}, powerFactor: true}), temperature()], + extend: [m.electricityMeter({acFrequency: {multiplier: 1, divisor: 10}, powerFactor: true}), m.temperature()], }, { zigbeeModel: ['DLM-300Z'], @@ -676,9 +676,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS IOT smart inner switch 3 gang', extend: [ - onOff({endpointNames: ['l1', 'l2', 'l3'], powerOnBehavior: false}), - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), - enumLookup({ + m.onOff({endpointNames: ['l1', 'l2', 'l3'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), + m.enumLookup({ name: 'operation_mode', lookup: {auto: 0, push: 1, latch: 2}, cluster: 'genOnOff', @@ -686,7 +686,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'switch type: "auto" - toggle by S/W, "push" - for momentary S/W, "latch" - sync S/W.', endpointName: 'l1', }), - enumLookup({ + m.enumLookup({ name: 'rf_pairing', lookup: {none: 0, l1: 1, l2: 2, l3: 3}, cluster: 'genOnOff', @@ -694,7 +694,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Enable RF pairing mode each button l1, l2, l3. It is supported only in repeat mode.', endpointName: 'l1', }), - enumLookup({ + m.enumLookup({ name: 'switch_3way_mode', lookup: {disable: 0, enable: 1}, cluster: 'genOnOff', @@ -715,7 +715,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [tzLocal.GCM300Z_valve_status], exposes: [e.binary('gas_valve_state', ea.ALL, 'OPEN', 'CLOSE').withDescription('Valve state if open or closed'), e.battery()], extend: [ - numeric({ + m.numeric({ name: 'close_timeout', cluster: 'genOnOff', attribute: {ID: 0x9006, type: 0x21}, @@ -727,7 +727,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 60, reporting: {min: 0, max: '1_HOUR', change: 1}, }), - numeric({ + m.numeric({ name: 'close_remain_timeout', cluster: 'genOnOff', attribute: {ID: 0x9007, type: 0x21}, @@ -739,7 +739,7 @@ const definitions: DefinitionWithExtend[] = [ scale: 60, reporting: {min: 0, max: '30_MINUTES', change: 1}, }), - enumLookup({ + m.enumLookup({ name: 'volume', lookup: {voice: 1, high: 2, low: 2}, cluster: 'genOnOff', @@ -747,7 +747,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Values observed are `1` (voice), `2` (high) or `3` (low).', reporting: {min: 0, max: '1_HOUR', change: 1}, }), - enumLookup({ + m.enumLookup({ name: 'overheat_mode', lookup: {normal: 0, overheat: 1}, cluster: 'genOnOff', @@ -776,7 +776,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [], exposes: [e.action(['single', 'double', 'long'])], extend: [ - enumLookup({ + m.enumLookup({ name: 'di_status', lookup: {Close: 0, Open: 1}, cluster: 'genOnOff', @@ -785,8 +785,8 @@ const definitions: DefinitionWithExtend[] = [ reporting: {min: 0, max: '1_HOUR', change: 1}, access: 'STATE_GET', }), - onOff({powerOnBehavior: false}), - enumLookup({ + m.onOff({powerOnBehavior: false}), + m.enumLookup({ name: 'di_type', lookup: {Button: 0, Door: 1}, cluster: 'genOnOff', @@ -794,7 +794,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Set the DI(Digital Input) type to either a button or door sensor(latch) type', reporting: {min: 0, max: '1_HOUR', change: 1}, }), - enumLookup({ + m.enumLookup({ name: 'do_type', lookup: {Pulse: 0, Latch: 1}, cluster: 'genOnOff', @@ -802,7 +802,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Set the DO(Digital Output) type to either a pulse or latch type', reporting: {min: 0, max: '1_HOUR', change: 1}, }), - enumLookup({ + m.enumLookup({ name: 'di_do_link', lookup: {Off: 0, On: 1}, cluster: 'genOnOff', @@ -810,7 +810,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Configure DO linkage according to DI status. When set to ON, DO is output according to the DI input.', reporting: {min: 0, max: '1_HOUR', change: 1}, }), - numeric({ + m.numeric({ name: 'do_pulse_time', cluster: 'genOnOff', attribute: {ID: 0x900d, type: 0x21}, @@ -871,14 +871,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'SQM300Z1', vendor: 'ShinaSystem', description: 'SiHAS big button switch 1 gang', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['SQM300Z2'], model: 'SQM300Z2', vendor: 'ShinaSystem', description: 'SiHAS big button switch 2 gang', - extend: [deviceEndpoints({endpoints: {top: 1, bottom: 2}}), onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], + extend: [m.deviceEndpoints({endpoints: {top: 1, bottom: 2}}), m.onOff({endpointNames: ['top', 'bottom'], powerOnBehavior: false})], }, { zigbeeModel: ['SQM300Z3'], @@ -886,8 +886,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS big button switch 3 gang', extend: [ - deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), - onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top: 1, center: 2, bottom: 3}}), + m.onOff({endpointNames: ['top', 'center', 'bottom'], powerOnBehavior: false}), ], }, { @@ -896,8 +896,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS big button switch 4 gang', extend: [ - deviceEndpoints({endpoints: {top_left: 1, bottom_left: 2, top_right: 3, bottom_right: 4}}), - onOff({endpointNames: ['top_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {top_left: 1, bottom_left: 2, top_right: 3, bottom_right: 4}}), + m.onOff({endpointNames: ['top_left', 'bottom_left', 'top_right', 'bottom_right'], powerOnBehavior: false}), ], }, { @@ -906,8 +906,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'ShinaSystem', description: 'SiHAS big button switch 6 gang', extend: [ - deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, center_right: 5, bottom_right: 6}}), - onOff({ + m.deviceEndpoints({endpoints: {top_left: 1, center_left: 2, bottom_left: 3, top_right: 4, center_right: 5, bottom_right: 6}}), + m.onOff({ endpointNames: ['top_left', 'center_left', 'bottom_left', 'top_right', 'center_right', 'bottom_right'], powerOnBehavior: false, }), diff --git a/src/devices/shyugj.ts b/src/devices/shyugj.ts index d23402375eb88..8bdcf1081f769 100644 --- a/src/devices/shyugj.ts +++ b/src/devices/shyugj.ts @@ -1,4 +1,4 @@ -import {battery, iasZoneAlarm} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -8,8 +8,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Shyugj', description: 'Door sensor', extend: [ - battery(), - iasZoneAlarm({ + m.battery(), + m.iasZoneAlarm({ zoneType: 'generic', zoneAttributes: ['alarm_1', 'alarm_2', 'tamper', 'battery_low'], }), diff --git a/src/devices/siglis.ts b/src/devices/siglis.ts index 02bc1d1d2cb94..e18035e737e4f 100644 --- a/src/devices/siglis.ts +++ b/src/devices/siglis.ts @@ -137,7 +137,6 @@ const definitions: DefinitionWithExtend[] = [ const expose = []; expose.push(buttonEventExposes); - expose.push(e.linkquality()); if (checkOption(device, options, 'front_surface_enabled')) { expose.push(e.light_brightness_colorxy().withEndpoint('l1')); @@ -246,7 +245,6 @@ const definitions: DefinitionWithExtend[] = [ const expose = []; expose.push(buttonEventExposes); - expose.push(e.linkquality()); if (checkOption(device, options, 'front_surface_enabled')) { expose.push(e.light_brightness_colorxy().withEndpoint('l1')); diff --git a/src/devices/sinope.ts b/src/devices/sinope.ts index c8f2e185985a3..57b037a4ca90b 100644 --- a/src/devices/sinope.ts +++ b/src/devices/sinope.ts @@ -4,7 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue, KeyValueAny, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -603,7 +603,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TH1123ZB', vendor: 'Sinopé', description: 'Zigbee line volt thermostat', - extend: [electricityMeter()], + extend: [m.electricityMeter()], fromZigbee: [fzLocal.thermostat, fzLocal.sinope, fz.hvac_user_interface, fz.ignore_temperature_report], toZigbee: [ tz.thermostat_local_temperature, @@ -703,7 +703,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TH1124ZB', vendor: 'Sinopé', description: 'Zigbee line volt thermostat', - extend: [electricityMeter()], + extend: [m.electricityMeter()], fromZigbee: [fzLocal.thermostat, fzLocal.sinope, fz.hvac_user_interface, fz.ignore_temperature_report], toZigbee: [ tz.thermostat_local_temperature, @@ -803,7 +803,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TH1123ZB-G2', vendor: 'Sinopé', description: 'Zigbee line volt thermostat', - extend: [electricityMeter()], + extend: [m.electricityMeter()], fromZigbee: [fzLocal.thermostat, fzLocal.sinope, fz.hvac_user_interface, fz.ignore_temperature_report], toZigbee: [ tz.thermostat_local_temperature, @@ -914,7 +914,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TH1124ZB-G2', vendor: 'Sinopé', description: 'Zigbee line volt thermostat', - extend: [electricityMeter()], + extend: [m.electricityMeter()], fromZigbee: [fzLocal.thermostat, fzLocal.sinope, fz.hvac_user_interface, fz.ignore_temperature_report], toZigbee: [ tz.thermostat_local_temperature, @@ -1028,7 +1028,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [ {model: 'TH1320ZB-04', vendor: 'Sinopé', description: 'Zigbee smart floor heating thermostat', fingerprint: [{modelID: 'TH1320ZB-04'}]}, ], - extend: [electricityMeter()], + extend: [m.electricityMeter()], fromZigbee: [fzLocal.thermostat, fzLocal.sinope, fz.hvac_user_interface, fz.ignore_temperature_report], toZigbee: [ tz.thermostat_local_temperature, @@ -1391,7 +1391,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SW2500ZB', vendor: 'Sinopé', description: 'Zigbee smart light switch', - extend: [onOff(), electricityMeter({cluster: 'metering'})], + extend: [m.onOff(), m.electricityMeter({cluster: 'metering'})], fromZigbee: [fzLocal.sinope], toZigbee: [ tzLocal.timer_seconds, @@ -1458,7 +1458,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'DM2500ZB', vendor: 'Sinopé', description: 'Zigbee smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], fromZigbee: [fzLocal.sinope], toZigbee: [ tzLocal.timer_seconds, @@ -1508,7 +1508,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'DM2550ZB', vendor: 'Sinopé', description: 'Zigbee Adaptive phase smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], fromZigbee: [fzLocal.sinope], toZigbee: [ tzLocal.timer_seconds, @@ -1558,21 +1558,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP2600ZB', vendor: 'Sinopé', description: 'Zigbee smart plug', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['SP2610ZB'], model: 'SP2610ZB', vendor: 'Sinopé', description: 'Zigbee smart plug', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['RM3250ZB'], model: 'RM3250ZB', vendor: 'Sinopé', description: '50A Smart electrical load controller', - extend: [onOff(), electricityMeter()], + extend: [m.onOff(), m.electricityMeter()], }, { zigbeeModel: ['WL4200'], @@ -1692,7 +1692,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'RM3500ZB', vendor: 'Sinopé', description: 'Calypso smart water heater controller', - extend: [onOff({powerOnBehavior: false}), electricityMeter()], + extend: [m.onOff({powerOnBehavior: false}), m.electricityMeter()], fromZigbee: [fzLocal.ias_water_leak_alarm, fzLocal.sinope, fz.temperature], toZigbee: [tzLocal.low_water_temp_protection], exposes: [ diff --git a/src/devices/siterwell.ts b/src/devices/siterwell.ts index 400c7eb4847ba..beddeabd52924 100644 --- a/src/devices/siterwell.ts +++ b/src/devices/siterwell.ts @@ -10,17 +10,17 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { zigbeeModel: ['ivfvd7h', 'eaxp72v\u0000', 'kfvq6avy\u0000', 'fvq6avy\u0000', 'fvq6avy', 'zk78ptr\u0000', '4yfvweb\u0000'], - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_zivfvd7h'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_kfvq6avy'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_hhrtiq0x'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ps5v5jor'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_jeaxp72v'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_owwdxjbx'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_2cs6g9i7'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_04yfvweb'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_lrznf59v'}, - ], + fingerprint: tuya.fingerprint('TS0601', [ + '_TZE200_zivfvd7h', + '_TZE200_kfvq6avy', + '_TZE200_hhrtiq0x', + '_TZE200_ps5v5jor', + '_TZE200_jeaxp72v', + '_TZE200_owwdxjbx', + '_TZE200_2cs6g9i7', + '_TZE200_04yfvweb', + '_TZE200_lrznf59v', + ]), model: 'GS361A-H04', vendor: 'Siterwell', description: 'Radiator valve with thermostat', diff --git a/src/devices/skydance.ts b/src/devices/skydance.ts index 9d1b40d91116b..ca51ac1481049 100644 --- a/src/devices/skydance.ts +++ b/src/devices/skydance.ts @@ -8,10 +8,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_6qoazbre'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_fcooykb4'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_6qoazbre', '_TZE200_fcooykb4']), model: 'WZ5_dim_1', vendor: 'Skydance', description: 'Zigbee & RF 5 in 1 LED controller (DIM mode)', @@ -20,12 +17,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness', ea.STATE_SET)], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_gz3n0tzf'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_nthosjmx'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_na98lvjp'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_2gtsuokt'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_gz3n0tzf', '_TZE200_nthosjmx', '_TZE200_na98lvjp', '_TZE200_2gtsuokt']), model: 'WZ5_cct', vendor: 'Skydance', description: 'Zigbee & RF 5 in 1 LED controller (CCT mode)', @@ -46,10 +38,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_9hghastn'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_9mt3kgn0'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_9hghastn', '_TZE200_9mt3kgn0']), model: 'WZ5_rgb', vendor: 'Skydance', description: 'Zigbee & RF 5 in 1 LED controller (RGB mode)', @@ -66,17 +55,14 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0503B', manufacturerName: '_TZB210_zdvrsts8'}], + fingerprint: tuya.fingerprint('TS0503B', ['_TZB210_zdvrsts8']), model: 'WZ5_rgb_1', vendor: 'Tuya', description: 'Zigbee & RF 5 in 1 LED controller (RGB mode)', extend: [tuya.modernExtend.tuyaLight({color: {modes: ['hs', 'xy']}})], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_3thxjahu'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_g9jdneiu'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_3thxjahu', '_TZE200_g9jdneiu']), model: 'WZ5_rgbw', vendor: 'Skydance', description: 'Zigbee & RF 5 in 1 LED controller (RGBW mode)', @@ -95,10 +81,7 @@ const definitions: DefinitionWithExtend[] = [ meta: {separateWhite: true}, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_mde0utnv'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_aa9awrng'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_mde0utnv', '_TZE200_aa9awrng']), model: 'WZ5_rgbcct', vendor: 'Skydance', description: 'Zigbee & RF 5 in 1 LED controller (RGB+CCT mode)', diff --git a/src/devices/slv.ts b/src/devices/slv.ts index 69d1110af0570..cbdeaa1884d74 100644 --- a/src/devices/slv.ts +++ b/src/devices/slv.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '1001248', vendor: 'SLV', description: 'VALETO CCT LED driver', - extend: [light({colorTemp: {range: [153, 370]}})], + extend: [m.light({colorTemp: {range: [153, 370]}})], }, { zigbeeModel: ['1002994'], @@ -23,14 +23,14 @@ const definitions: DefinitionWithExtend[] = [ model: '1001923', vendor: 'SLV', description: 'VALETO LED GU10 RGBW', - extend: [light({colorTemp: {range: [153, 556]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 556]}, color: true})], }, { zigbeeModel: ['1005318'], model: '1005318', vendor: 'SLV', description: 'VALETO LED E27 RGBW', - extend: [light({colorTemp: {range: [153, 555]}, color: true})], + extend: [m.light({colorTemp: {range: [153, 555]}, color: true})], }, ]; diff --git a/src/devices/smart_home_pty.ts b/src/devices/smart_home_pty.ts index 7884cacb87789..3c1a529b97f07 100644 --- a/src/devices/smart_home_pty.ts +++ b/src/devices/smart_home_pty.ts @@ -1,4 +1,4 @@ -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'HGZB-07A', vendor: 'Smart Home Pty', description: 'RGBW Downlight', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['FNB56-SKT1EHG1.2'], model: 'HGZB-20-DE', vendor: 'Smart Home Pty', description: 'Power plug', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/smartthings.ts b/src/devices/smartthings.ts index 29f4bb545f250..186b0656b65f8 100644 --- a/src/devices/smartthings.ts +++ b/src/devices/smartthings.ts @@ -4,7 +4,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import {electricityMeter, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -134,7 +134,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Outlet with power meter', // This plug only actively reports power. The voltage and current values are always 0, so we can ignore them. // https://github.com/Koenkk/zigbee2mqtt/issues/5198 - extend: [onOff(), electricityMeter({current: false, voltage: false})], + extend: [m.onOff(), m.electricityMeter({current: false, voltage: false})], }, { zigbeeModel: ['outlet'], @@ -479,14 +479,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'GP-LBU019BBAWU', vendor: 'SmartThings', description: 'Smart bulb', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['ZBT-DIMLight-GLS0044'], model: '7ZA-A806ST-Q1R', vendor: 'SmartThings', description: 'Smart bulb', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/smlight.ts b/src/devices/smlight.ts index 60c63767348ed..6d2de146d3c05 100644 --- a/src/devices/smlight.ts +++ b/src/devices/smlight.ts @@ -1,4 +1,4 @@ -import {forcePowerSource, linkQuality} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -14,7 +14,7 @@ const definitions: DefinitionWithExtend[] = [ {vendor: 'SMLIGHT', model: 'SLZB-0xp7', description: 'Router', fingerprint: [{modelID: 'SLZB-0xp7'}]}, {vendor: 'SMLIGHT', model: 'SLZB-07Mg24', description: 'Router', fingerprint: [{modelID: 'SLZB-07Mg24'}]}, ], - extend: [linkQuality({reporting: true}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.linkQuality({reporting: true}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, ]; diff --git a/src/devices/sohan_electric.ts b/src/devices/sohan_electric.ts index 4f31360b19407..fc7b15d4e4602 100644 --- a/src/devices/sohan_electric.ts +++ b/src/devices/sohan_electric.ts @@ -1,14 +1,15 @@ import fz from '../converters/fromZigbee'; -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0001', manufacturerName: '_TZ3000_bezfthwc'}], + fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_bezfthwc']), model: 'RDCBC/Z', vendor: 'SOHAN Electric', description: 'DIN circuit breaker (1 pole / 2 poles)', - extend: [onOff()], + extend: [m.onOff()], fromZigbee: [fz.ignore_basic_report, fz.ignore_time_read], }, ]; diff --git a/src/devices/solaredge.ts b/src/devices/solaredge.ts index 0c9663b2b2f22..9171b6607d78f 100644 --- a/src/devices/solaredge.ts +++ b/src/devices/solaredge.ts @@ -1,4 +1,4 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SEHAZB-DR-SWITCH-2', vendor: 'SolarEdge', description: 'Smart energy switch', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/soma.ts b/src/devices/soma.ts index c27ec9f22740c..cb0a13ed989bc 100644 --- a/src/devices/soma.ts +++ b/src/devices/soma.ts @@ -1,4 +1,4 @@ -import {battery, windowCovering} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SmartShades3', vendor: 'SOMA', description: 'Smart shades 3', - extend: [battery(), windowCovering({controls: ['lift', 'tilt']})], + extend: [m.battery(), m.windowCovering({controls: ['lift', 'tilt']})], }, ]; diff --git a/src/devices/somfy.ts b/src/devices/somfy.ts index 73cea92a9148d..ad41852aa042a 100644 --- a/src/devices/somfy.ts +++ b/src/devices/somfy.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {battery, iasZoneAlarm, identify, windowCovering} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -13,7 +13,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SOMFY-1241752', vendor: 'SOMFY', description: 'Blinds', - extend: [windowCovering({controls: ['lift']}), battery()], + extend: [m.windowCovering({controls: ['lift']}), m.battery()], }, { zigbeeModel: ['1822647'], @@ -38,14 +38,14 @@ const definitions: DefinitionWithExtend[] = [ model: '1811680', vendor: 'SOMFY', description: 'Zigbee opening sensor', - extend: [identify(), iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'battery_low']}), battery()], + extend: [m.identify(), m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'battery_low']}), m.battery()], }, { zigbeeModel: ['1811681'], model: '1811681', vendor: 'SOMFY', description: 'Zigbee motion sensor', - extend: [identify(), iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low']}), battery()], + extend: [m.identify(), m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low']}), m.battery()], }, ]; diff --git a/src/devices/somgoms.ts b/src/devices/somgoms.ts index 4135116c16953..6c5c225df5207 100644 --- a/src/devices/somgoms.ts +++ b/src/devices/somgoms.ts @@ -1,6 +1,7 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const e = exposes.presets; @@ -26,7 +27,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.cover_position().setAccess('position', ea.STATE_SET)], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_sbordckq'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_sbordckq']), model: 'SM-1CTW-EU', vendor: 'Somgoms', description: 'Curtain switch', diff --git a/src/devices/sonoff.ts b/src/devices/sonoff.ts index d8afb00b517bd..325dc7c74b983 100644 --- a/src/devices/sonoff.ts +++ b/src/devices/sonoff.ts @@ -6,23 +6,7 @@ import * as constants from '../lib/constants'; import {modernExtend as ewelinkModernExtend} from '../lib/ewelink'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import { - battery, - binary, - bindCluster, - commandsOnOff, - customTimeResponse, - deviceAddCustomCluster, - deviceEndpoints, - enumLookup, - forcePowerSource, - humidity, - iasZoneAlarm, - numeric, - occupancy, - onOff, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend, Fz, KeyValue, KeyValueAny, ModernExtend, Tz} from '../lib/types'; @@ -54,7 +38,7 @@ const fzLocal = { const sonoffExtend = { addCustomClusterEwelink: () => - deviceAddCustomCluster('customClusterEwelink', { + m.deviceAddCustomCluster('customClusterEwelink', { ID: 0xfc11, attributes: { networkLed: {ID: 0x0001, type: Zcl.DataType.BOOLEAN}, @@ -675,14 +659,14 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'SONOFF', description: 'Zigbee smart switch', // configureReporting fails for this device - extend: [onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], + extend: [m.onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], }, { zigbeeModel: ['ZBMINI-L'], model: 'ZBMINI-L', vendor: 'SONOFF', description: 'Zigbee smart switch (no neutral)', - extend: [onOff()], + extend: [m.onOff()], ota: true, configure: async (device, coordinatorEndpoint) => { // Unbind genPollCtrl to prevent device from sending checkin message. @@ -702,7 +686,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZBMINIL2', vendor: 'SONOFF', description: 'Zigbee smart switch (no neutral)', - extend: [onOff()], + extend: [m.onOff()], ota: true, configure: async (device, coordinatorEndpoint) => { // Unbind genPollCtrl to prevent device from sending checkin message. @@ -722,14 +706,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZBMINI', vendor: 'SONOFF', description: 'Zigbee two way smart switch', - extend: [onOff({powerOnBehavior: false}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff({powerOnBehavior: false}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['S31 Lite zb'], model: 'S31ZB', vendor: 'SONOFF', description: 'Zigbee smart plug (US version)', - extend: [onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], + extend: [m.onOff({powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false})], configure: async (device, coordinatorEndpoint) => { // Device does not support configureReporting for onOff, therefore just bind here. // https://github.com/Koenkk/zigbee2mqtt/issues/20618 @@ -758,15 +742,10 @@ const definitions: DefinitionWithExtend[] = [ model: 'SNZB-04', fingerprint: [{modelID: 'SNZB-04', manufacturerName: 'eWeLink'}], }, - { - vendor: 'Zbeacon', - model: 'TH01', - fingerprint: [{modelID: 'TH01', manufacturerName: 'Zbeacon'}], - }, tuya.whitelabel('Tuya', 'WL-19DWZ', 'Contact sensor', ['_TZ3000_n2egfsli']), ], description: 'Contact sensor', - extend: [ewelinkBattery(), iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']})], + extend: [ewelinkBattery(), m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']})], }, { zigbeeModel: ['WB01', 'WB-01', 'SNZB-01'], @@ -826,6 +805,11 @@ const definitions: DefinitionWithExtend[] = [ modelID: 'DS01', endpoints: [{ID: 1, profileID: 260, deviceID: 770, inputClusters: [0, 3, 1026, 1029, 1], outputClusters: [3]}], }, + { + type: 'EndDevice', + manufacturerName: 'Zbeacon', + modelID: 'TH01', + }, ], zigbeeModel: ['TH01', 'SNZB-02'], model: 'SNZB-02', @@ -837,6 +821,11 @@ const definitions: DefinitionWithExtend[] = [ model: 'SNZB-02', fingerprint: [{modelID: 'SNZB-02', manufacturerName: 'eWeLink'}], }, + { + vendor: 'Zbeacon', + model: 'TH01', + fingerprint: [{modelID: 'TH01', manufacturerName: 'Zbeacon'}], + }, ], description: 'Temperature and humidity sensor', exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()], @@ -864,7 +853,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SNZB-02D', vendor: 'SONOFF', description: 'Temperature and humidity sensor with screen', - extend: [battery(), temperature(), humidity(), bindCluster({cluster: 'genPollCtrl', clusterType: 'input'})], + extend: [m.battery(), m.temperature(), m.humidity(), m.bindCluster({cluster: 'genPollCtrl', clusterType: 'input'})], }, { fingerprint: [ @@ -915,21 +904,21 @@ const definitions: DefinitionWithExtend[] = [ }, ], description: 'Motion sensor', - extend: [ewelinkBattery(), iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low']})], + extend: [ewelinkBattery(), m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low']})], }, { zigbeeModel: ['S26R2ZB'], model: 'S26R2ZB', vendor: 'SONOFF', description: 'Zigbee smart plug', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['S40LITE'], model: 'S40ZBTPB', vendor: 'SONOFF', description: '15A Zigbee smart plug', - extend: [onOff({powerOnBehavior: false, skipDuplicateTransaction: true})], + extend: [m.onOff({powerOnBehavior: false, skipDuplicateTransaction: true})], ota: true, }, { @@ -960,7 +949,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'SONOFF', whiteLabel: [{vendor: 'Woolley', model: 'SA-029-1'}], description: 'Smart Plug', - extend: [onOff(), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff(), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['Z111PL0H-1JX'], @@ -968,7 +957,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'SONOFF', whiteLabel: [{vendor: 'Woolley', model: 'SA-028-1'}], description: 'Smart Plug', - extend: [onOff({powerOnBehavior: false}), forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.onOff({powerOnBehavior: false}), m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { zigbeeModel: ['SNZB-01P'], @@ -977,7 +966,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Wireless button', extend: [ ewelinkAction(), - battery({ + m.battery({ percentageReportingConfig: {min: 3600, max: 7200, change: 0}, voltage: true, voltageReporting: true, @@ -991,7 +980,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SNZB-02P', vendor: 'SONOFF', description: 'Temperature and humidity sensor', - extend: [battery({percentage: true}), temperature(), humidity(), bindCluster({cluster: 'genPollCtrl', clusterType: 'input'})], + extend: [m.battery({percentage: true}), m.temperature(), m.humidity(), m.bindCluster({cluster: 'genPollCtrl', clusterType: 'input'})], }, { zigbeeModel: ['SNZB-04P'], @@ -999,8 +988,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'SONOFF', description: 'Contact sensor', extend: [ - iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']}), - binary({ + m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']}), + m.binary({ name: 'tamper', cluster: 0xfc11, attribute: {ID: 0x2000, type: 0x20}, @@ -1020,8 +1009,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'SONOFF', description: 'Zigbee PIR sensor', extend: [ - occupancy(), - numeric({ + m.occupancy(), + m.numeric({ name: 'motion_timeout', cluster: 0x0406, attribute: {ID: 0x0020, type: 0x21}, @@ -1029,7 +1018,7 @@ const definitions: DefinitionWithExtend[] = [ valueMin: 5, valueMax: 60, }), - enumLookup({ + m.enumLookup({ name: 'illumination', lookup: {dim: 0, bright: 1}, cluster: 0xfc11, @@ -1047,7 +1036,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SNZB-05P', vendor: 'SONOFF', description: 'Zigbee water sensor', - extend: [battery(), iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'battery_low']})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'battery_low']})], }, { zigbeeModel: ['SNZB-06P'], @@ -1055,8 +1044,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'SONOFF', description: 'Zigbee occupancy sensor', extend: [ - occupancy({reporting: false}), - numeric({ + m.occupancy({reporting: false}), + m.numeric({ name: 'occupancy_timeout', cluster: 0x0406, attribute: {ID: 0x0020, type: 0x21}, @@ -1064,14 +1053,14 @@ const definitions: DefinitionWithExtend[] = [ valueMin: 15, valueMax: 65535, }), - enumLookup({ + m.enumLookup({ name: 'occupancy_sensitivity', lookup: {low: 1, medium: 2, high: 3}, cluster: 0x0406, attribute: {ID: 0x0022, type: 0x20}, description: 'Sensitivity of human presence detection', }), - enumLookup({ + m.enumLookup({ name: 'illumination', lookup: {dim: 0, bright: 1}, cluster: 0xfc11, @@ -1107,7 +1096,7 @@ const definitions: DefinitionWithExtend[] = [ tz.thermostat_running_state, ], extend: [ - deviceAddCustomCluster('customSonoffTrvzb', { + m.deviceAddCustomCluster('customSonoffTrvzb', { ID: 0xfc11, attributes: { childLock: {ID: 0x0000, type: Zcl.DataType.BOOLEAN}, @@ -1126,7 +1115,7 @@ const definitions: DefinitionWithExtend[] = [ commands: {}, commandsResponse: {}, }), - binary({ + m.binary({ name: 'child_lock', cluster: 'customSonoffTrvzb', attribute: 'childLock', @@ -1135,7 +1124,7 @@ const definitions: DefinitionWithExtend[] = [ valueOn: ['LOCK', 0x01], valueOff: ['UNLOCK', 0x00], }), - binary({ + m.binary({ name: 'open_window', cluster: 'customSonoffTrvzb', attribute: 'openWindow', @@ -1144,7 +1133,7 @@ const definitions: DefinitionWithExtend[] = [ valueOn: ['ON', 0x01], valueOff: ['OFF', 0x00], }), - numeric({ + m.numeric({ name: 'frost_protection_temperature', cluster: 'customSonoffTrvzb', attribute: 'frostProtectionTemperature', @@ -1156,7 +1145,7 @@ const definitions: DefinitionWithExtend[] = [ unit: '°C', scale: 100, }), - numeric({ + m.numeric({ name: 'idle_steps', cluster: 'customSonoffTrvzb', attribute: 'idleSteps', @@ -1164,7 +1153,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Number of steps used for calibration (no-load steps)', access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'closing_steps', cluster: 'customSonoffTrvzb', attribute: 'closingSteps', @@ -1172,7 +1161,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Number of steps it takes to close the valve', access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'valve_opening_limit_voltage', cluster: 'customSonoffTrvzb', attribute: 'valveOpeningLimitVoltage', @@ -1181,7 +1170,7 @@ const definitions: DefinitionWithExtend[] = [ unit: 'mV', access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'valve_closing_limit_voltage', cluster: 'customSonoffTrvzb', attribute: 'valveClosingLimitVoltage', @@ -1190,7 +1179,7 @@ const definitions: DefinitionWithExtend[] = [ unit: 'mV', access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'valve_motor_running_voltage', cluster: 'customSonoffTrvzb', attribute: 'valveMotorRunningVoltage', @@ -1199,7 +1188,7 @@ const definitions: DefinitionWithExtend[] = [ unit: 'mV', access: 'STATE_GET', }), - numeric({ + m.numeric({ name: 'valve_opening_degree', cluster: 'customSonoffTrvzb', attribute: 'valveOpeningDegree', @@ -1215,7 +1204,7 @@ const definitions: DefinitionWithExtend[] = [ valueStep: 1.0, unit: '%', }), - numeric({ + m.numeric({ name: 'valve_closing_degree', cluster: 'customSonoffTrvzb', attribute: 'valveClosingDegree', @@ -1232,7 +1221,7 @@ const definitions: DefinitionWithExtend[] = [ unit: '%', }), sonoffExtend.weeklySchedule(), - customTimeResponse('1970_UTC'), + m.customTimeResponse('1970_UTC'), ], ota: true, configure: async (device, coordinatorEndpoint) => { @@ -1250,14 +1239,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'S60ZBTPF', vendor: 'SONOFF', description: 'Zigbee smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['S60ZBTPG'], model: 'S60ZBTPG', vendor: 'SONOFF', description: 'Zigbee smart plug', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['SWV'], @@ -1267,14 +1256,14 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.flow], exposes: [e.numeric('flow', ea.STATE).withDescription('Current water flow').withUnit('m³/h')], extend: [ - battery(), - onOff({ + m.battery(), + m.onOff({ powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: true, }), sonoffExtend.addCustomClusterEwelink(), - enumLookup({ + m.enumLookup({ name: 'current_device_status', lookup: {normal_state: 0, water_shortage: 1, water_leakage: 2, 'water_shortage & water_leakage': 3}, cluster: 'customClusterEwelink', @@ -1282,7 +1271,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'The water valve is in normal state, water shortage or water leakage', access: 'STATE_GET', }), - binary({ + m.binary({ name: 'auto_close_when_water_shortage', cluster: 'customClusterEwelink', attribute: 'lackWaterCloseValveTimeout', @@ -1309,9 +1298,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'SONOFF', description: 'Zigbee USB repeater plug', extend: [ - onOff(), + m.onOff(), sonoffExtend.addCustomClusterEwelink(), - binary({ + m.binary({ name: 'rf_turbo_mode', cluster: 'customClusterEwelink', attribute: 'radioPowerWithManuCode', @@ -1337,10 +1326,10 @@ const definitions: DefinitionWithExtend[] = [ description: 'Zigbee smart switch', exposes: [], extend: [ - commandsOnOff({commands: ['toggle']}), - onOff({configureReporting: false}), + m.commandsOnOff({commands: ['toggle']}), + m.onOff({configureReporting: false}), sonoffExtend.addCustomClusterEwelink(), - binary({ + m.binary({ name: 'network_indicator', cluster: 'customClusterEwelink', attribute: 'networkLed', @@ -1348,7 +1337,7 @@ const definitions: DefinitionWithExtend[] = [ valueOff: [false, 0], valueOn: [true, 1], }), - binary({ + m.binary({ name: 'turbo_mode', cluster: 'customClusterEwelink', attribute: 'radioPower', @@ -1356,7 +1345,7 @@ const definitions: DefinitionWithExtend[] = [ valueOff: [false, 0x09], valueOn: [true, 0x14], }), - binary({ + m.binary({ name: 'delayed_power_on_state', cluster: 'customClusterEwelink', attribute: 'delayedPowerOnState', @@ -1364,7 +1353,7 @@ const definitions: DefinitionWithExtend[] = [ valueOff: [false, 0], valueOn: [true, 1], }), - numeric({ + m.numeric({ name: 'delayed_power_on_time', cluster: 'customClusterEwelink', attribute: 'delayedPowerOnTime', @@ -1375,7 +1364,7 @@ const definitions: DefinitionWithExtend[] = [ unit: 'seconds', scale: 2, }), - binary({ + m.binary({ name: 'detach_relay_mode', cluster: 'customClusterEwelink', attribute: 'detachRelayMode', @@ -1402,10 +1391,10 @@ const definitions: DefinitionWithExtend[] = [ exposes: [], ota: true, extend: [ - deviceEndpoints({endpoints: {l1: 1}}), - onOff(), + m.deviceEndpoints({endpoints: {l1: 1}}), + m.onOff(), sonoffExtend.addCustomClusterEwelink(), - enumLookup({ + m.enumLookup({ name: 'device_work_mode', lookup: {'Zigbee end device': 0, 'Zigbee router': 1}, cluster: 'customClusterEwelink', @@ -1413,7 +1402,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'The device runs as a Zigbee End device or Zigbee router.', access: 'STATE_GET', }), - binary({ + m.binary({ name: 'network_indicator', cluster: 'customClusterEwelink', attribute: 'networkLed', @@ -1439,10 +1428,10 @@ const definitions: DefinitionWithExtend[] = [ exposes: [], ota: true, extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), - onOff({endpointNames: ['l1', 'l2']}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.onOff({endpointNames: ['l1', 'l2']}), sonoffExtend.addCustomClusterEwelink(), - enumLookup({ + m.enumLookup({ name: 'device_work_mode', lookup: {'Zigbee end device': 0, 'Zigbee router': 1}, cluster: 'customClusterEwelink', @@ -1450,7 +1439,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'The device runs as a Zigbee End device or Zigbee router.', access: 'STATE_GET', }), - binary({ + m.binary({ name: 'network_indicator', cluster: 'customClusterEwelink', attribute: 'networkLed', @@ -1480,10 +1469,10 @@ const definitions: DefinitionWithExtend[] = [ exposes: [], ota: true, extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), - onOff({endpointNames: ['l1', 'l2', 'l3']}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), + m.onOff({endpointNames: ['l1', 'l2', 'l3']}), sonoffExtend.addCustomClusterEwelink(), - enumLookup({ + m.enumLookup({ name: 'device_work_mode', lookup: {'Zigbee end device': 0, 'Zigbee router': 1}, cluster: 'customClusterEwelink', @@ -1491,7 +1480,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'The device runs as a Zigbee End device or Zigbee router.', access: 'STATE_GET', }), - binary({ + m.binary({ name: 'network_indicator', cluster: 'customClusterEwelink', attribute: 'networkLed', diff --git a/src/devices/sowilo.ts b/src/devices/sowilo.ts index 9a5e2338f7ecd..6fb6ee5eacc4c 100644 --- a/src/devices/sowilo.ts +++ b/src/devices/sowilo.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'L258', vendor: 'Sowilo DS', description: 'Heimdall Pro 5 channel RGBWW controller', - extend: [light({colorTemp: {range: [150, 575]}, color: {modes: ['xy', 'hs']}, turnsOffAtBrightness1: true})], + extend: [m.light({colorTemp: {range: [150, 575]}, color: {modes: ['xy', 'hs']}, turnsOffAtBrightness1: true})], }, ]; diff --git a/src/devices/spotmau.ts b/src/devices/spotmau.ts index cb334e811c639..dd1a847fd4ec9 100644 --- a/src/devices/spotmau.ts +++ b/src/devices/spotmau.ts @@ -1,4 +1,4 @@ -import {deviceEndpoints, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP-PS1-02', vendor: 'Spotmau', description: 'Smart wall switch - 1 gang', - extend: [onOff()], + extend: [m.onOff()], endpoint: (device) => { return {default: 16}; }, @@ -17,21 +17,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'SP-PS2-02', vendor: 'Spotmau', description: 'Smart wall switch - 2 gang', - extend: [deviceEndpoints({endpoints: {left: 16, right: 17}}), onOff({endpointNames: ['left', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 16, right: 17}}), m.onOff({endpointNames: ['left', 'right']})], }, { zigbeeModel: ['1719SP-PS3-02'], model: 'SP-PS3-02', vendor: 'Spotmau', description: 'Smart wall switch - 3 gang', - extend: [deviceEndpoints({endpoints: {left: 16, center: 17, right: 18}}), onOff({endpointNames: ['left', 'center', 'right']})], + extend: [m.deviceEndpoints({endpoints: {left: 16, center: 17, right: 18}}), m.onOff({endpointNames: ['left', 'center', 'right']})], }, { zigbeeModel: ['1719SP-WS-02'], model: 'SP-WS-02', vendor: 'Spotmau', description: 'Smart wall switch - Socket', - extend: [onOff()], + extend: [m.onOff()], endpoint: (device) => { return {default: 16}; }, diff --git a/src/devices/sunricher.ts b/src/devices/sunricher.ts index d60e11678048c..f80eba25489e7 100644 --- a/src/devices/sunricher.ts +++ b/src/devices/sunricher.ts @@ -5,26 +5,7 @@ import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import { - battery, - commandsColorCtrl, - commandsLevelCtrl, - commandsOnOff, - commandsScenes, - commandsWindowCovering, - deviceEndpoints, - electricityMeter, - enumLookup, - humidity, - iasZoneAlarm, - identify, - illuminance, - light, - numeric, - occupancy, - onOff, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import * as sunricher from '../lib/sunricher'; @@ -426,19 +407,66 @@ async function syncTime(endpoint: Zh.Endpoint) { } const definitions: DefinitionWithExtend[] = [ + { + zigbeeModel: ['HK-SENSOR-PRE'], + model: 'SR-ZG9030F-PS', + vendor: 'Sunricher', + description: 'Smart human presence sensor', + extend: [m.illuminance(), m.occupancy(), m.commandsOnOff()], + }, + { + zigbeeModel: ['HK-SENSOR-GAS'], + model: 'SR-ZG9060A-GS', + vendor: 'Sunricher', + description: 'Smart Combustible Gas Sensor', + extend: [m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'alarm_2', 'tamper', 'battery_low']}), m.iasWarning()], + }, + { + zigbeeModel: ['HK-SENSOR-CO'], + model: 'SR-ZG9060B-CS', + vendor: 'Sunricher', + description: 'Smart Carbon Monoxide Alarm', + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'alarm_2', 'tamper', 'battery_low']}), m.iasWarning()], + }, + { + zigbeeModel: ['HK-SENSOR-WT1'], + model: 'SR-ZG9050C-WS', + vendor: 'Sunricher', + description: 'Smart Water Leakage Sensor', + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'alarm_2', 'tamper', 'battery_low']})], + }, + { + zigbeeModel: ['HK-SENSOR-WT2'], + model: 'SR-ZG9050B-WS', + vendor: 'Sunricher', + description: 'Water Leakage Alarm', + extend: [ + m.battery(), + m.temperature(), + m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1', 'alarm_2', 'tamper', 'battery_low']}), + m.iasWarning(), + ], + }, + { + zigbeeModel: ['HK-SL-DIM-UK'], + model: 'SR-ZG2835RAC-UK', + vendor: 'Sunricher', + description: 'Push compatible zigBee knob smart dimmer', + extend: [m.light(), m.electricityMeter(), sunricherExternalSwitchType()], + }, { zigbeeModel: ['ZG2837RAC-K4'], model: 'SR-ZG2835RAC-NK4', vendor: 'Sunricher', description: '4-Key zigbee rotary & push button smart dimmer', - extend: [light(), electricityMeter(), commandsScenes()], + extend: [m.light(), m.electricityMeter(), m.commandsScenes()], }, { zigbeeModel: ['HK-ZRC-K5&RS-TL'], model: 'SR-ZG2836D5', vendor: 'Sunricher', description: 'Zigbee smart remote', - extend: [battery(), commandsOnOff(), commandsLevelCtrl(), commandsWindowCovering(), commandsColorCtrl()], + extend: [m.battery(), m.commandsOnOff(), m.commandsLevelCtrl(), m.commandsWindowCovering(), m.commandsColorCtrl()], }, { zigbeeModel: ['ZG9032B'], @@ -446,11 +474,11 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sunricher', description: 'Zigbee temperature and humidity sensor', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2}}), - battery(), - temperature(), - humidity({endpointNames: ['2']}), - numeric({ + m.deviceEndpoints({endpoints: {'1': 1, '2': 2}}), + m.battery(), + m.temperature(), + m.humidity({endpointNames: ['2']}), + m.numeric({ name: 'temperature_sensor_compensation', cluster: 0x0402, attribute: {ID: 0x1000, type: 0x28}, @@ -463,7 +491,7 @@ const definitions: DefinitionWithExtend[] = [ zigbeeCommandOptions: {manufacturerCode: 0x1224}, endpointNames: ['1'], }), - enumLookup({ + m.enumLookup({ name: 'temperature_display_unit', cluster: 0x0402, attribute: {ID: 0x1001, type: 0x30}, @@ -476,7 +504,7 @@ const definitions: DefinitionWithExtend[] = [ endpointName: '1', zigbeeCommandOptions: {manufacturerCode: 0x1224}, }), - numeric({ + m.numeric({ name: 'humidity_sensor_compensation', cluster: 0x0405, attribute: {ID: 0x1000, type: 0x28}, @@ -497,7 +525,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SR-ZG9002K16-Pro', vendor: 'Sunricher', description: 'Zigbee smart wall panel remote', - extend: [battery(), sunricherSRZG9002K16Pro()], + extend: [m.battery(), sunricherSRZG9002K16Pro()], }, { zigbeeModel: ['ZG9030A-MW'], @@ -505,7 +533,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sunricher', description: 'Zigbee compatible ceiling mount occupancy sensor', extend: [ - numeric({ + m.numeric({ name: 'light_pwm_frequency', cluster: 'genBasic', attribute: {ID: 0x9001, type: 0x21}, @@ -514,7 +542,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Light PWM frequency (0-65535, default: 3300)', access: 'ALL', }), - enumLookup({ + m.enumLookup({ name: 'brightness_curve', cluster: 'genBasic', attribute: {ID: 0x8806, type: 0x20}, @@ -526,7 +554,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Brightness curve (default: Linear)', access: 'ALL', }), - enumLookup({ + m.enumLookup({ name: 'start_up_on_off', cluster: 'genOnOff', attribute: {ID: 0x4003, type: 0x30}, @@ -538,7 +566,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Start up on/off (default: last_state)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_light_duration', cluster: 'genBasic', attribute: {ID: 0x8902, type: 0x21}, @@ -548,7 +576,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor light duration (0s-65535s, default: 5s)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_light_sensitivity', cluster: 'genBasic', attribute: {ID: 0x8903, type: 0x21}, @@ -557,7 +585,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor light sensitivity (0-255, default: 0)', access: 'ALL', }), - enumLookup({ + m.enumLookup({ name: 'motion_sensor_working_mode', cluster: 'genBasic', attribute: {ID: 0x8904, type: 0x20}, @@ -568,7 +596,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor working mode (default: Automatic)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_sensing_distance', cluster: 'genBasic', attribute: {ID: 0x8905, type: 0x20}, @@ -577,7 +605,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor sensing distance (0-15, default: 1)', access: 'ALL', }), - enumLookup({ + m.enumLookup({ name: 'motion_sensor_microwave_switch', cluster: 'genBasic', attribute: {ID: 0x8906, type: 0x20}, @@ -588,7 +616,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor microwave switch (default: On)', access: 'ALL', }), - enumLookup({ + m.enumLookup({ name: 'motion_sensor_onoff_broadcast', cluster: 'genBasic', attribute: {ID: 0x8907, type: 0x20}, @@ -599,7 +627,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor on/off broadcast (default: On)', access: 'ALL', }), - enumLookup({ + m.enumLookup({ name: 'motion_sensor_light_state', cluster: 'genBasic', attribute: {ID: 0x890c, type: 0x20}, @@ -610,7 +638,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor light state (default: On)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_in_pwm_brightness', cluster: 'genBasic', attribute: {ID: 0x8908, type: 0x21}, @@ -620,7 +648,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor IN PWM brightness (0-1000 lux, default: 0)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_in_pwm_output', cluster: 'genBasic', attribute: {ID: 0x8909, type: 0x20}, @@ -629,7 +657,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor IN PWM output (0-254, default: 254)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_leave_pwm_output', cluster: 'genBasic', attribute: {ID: 0x890a, type: 0x20}, @@ -639,7 +667,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor LEAVE PWM output (0%-100%, default: 0%)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_leave_delay', cluster: 'genBasic', attribute: {ID: 0x8901, type: 0x21}, @@ -649,7 +677,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor LEAVE delay (0s-65535s, default: 0s)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'motion_sensor_pwm_output_after_delay', cluster: 'genBasic', attribute: {ID: 0x890b, type: 0x20}, @@ -659,7 +687,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor PWM output after delay (0%-100%, default: 0%)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'linear_error_ratio_coefficient_of_lux_measurement', cluster: 'genBasic', attribute: {ID: 0x890d, type: 0x21}, @@ -668,7 +696,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Linear error ratio coefficient of LUX measurement (100‰-10000‰, default: 1000‰)', access: 'ALL', }), - numeric({ + m.numeric({ name: 'fixed_deviation_of_lux_measurement', cluster: 'genBasic', attribute: {ID: 0x890e, type: 0x29}, @@ -677,12 +705,12 @@ const definitions: DefinitionWithExtend[] = [ description: 'Fixed deviation of LUX measurement (-100~100, default: 0)', access: 'ALL', }), - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3}}), - light(), - occupancy(), - illuminance({endpointNames: ['3']}), - commandsOnOff(), - commandsLevelCtrl(), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3}}), + m.light(), + m.occupancy(), + m.illuminance({endpointNames: ['3']}), + m.commandsOnOff(), + m.commandsLevelCtrl(), ], meta: {multiEndpoint: true}, toZigbee: [sunricher.tz.setModel], @@ -693,42 +721,42 @@ const definitions: DefinitionWithExtend[] = [ model: 'SR-ZG2836D5-Pro', vendor: 'Sunricher', description: 'Zigbee smart remote', - extend: [battery(), sunricherSRZG2836D5Pro()], + extend: [m.battery(), sunricherSRZG2836D5Pro()], }, { zigbeeModel: ['HK-ZRC-K12&RS-E'], model: 'SR-ZG9002KR12-Pro', vendor: 'Sunricher', description: 'Zigbee smart wall panel remote', - extend: [battery(), sunricherSRZG9002KR12Pro()], + extend: [m.battery(), sunricherSRZG9002KR12Pro()], }, { zigbeeModel: ['ZV9380A', 'ZG9380A'], model: 'SR-ZG9042MP', vendor: 'Sunricher', description: 'Zigbee three phase power meter', - extend: [electricityMeter()], + extend: [m.electricityMeter()], }, { zigbeeModel: ['HK-SL-DIM-AU-K-A'], model: 'SR-ZG2835PAC-AU', vendor: 'Sunricher', description: 'Zigbee push button smart dimmer', - extend: [light({configureReporting: true}), sunricherExternalSwitchType(), electricityMeter()], + extend: [m.light({configureReporting: true}), sunricherExternalSwitchType(), m.electricityMeter()], }, { zigbeeModel: ['HK-SL-DIM-CLN'], model: 'SR-ZG9101SAC-HP-CLN', vendor: 'Sunricher', description: 'Zigbee micro smart dimmer', - extend: [light({configureReporting: true}), sunricherExternalSwitchType(), sunricherMinimumPWM()], + extend: [m.light({configureReporting: true}), sunricherExternalSwitchType(), sunricherMinimumPWM()], }, { zigbeeModel: ['HK-SENSOR-CT-MINI'], model: 'SR-ZG9011A-DS', vendor: 'Sunricher', description: 'Door/window sensor', - extend: [battery(), iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']})], + extend: [m.battery(), m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']})], }, { zigbeeModel: ['ZG2858A'], @@ -736,13 +764,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Sunricher', description: 'Zigbee handheld remote RGBCCT 3 channels', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3}}), - battery(), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsColorCtrl(), - commandsScenes(), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3}}), + m.battery(), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsColorCtrl(), + m.commandsScenes(), ], }, { @@ -750,28 +778,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'HK-SL-DIM-US-A', vendor: 'Sunricher', description: 'Keypad smart dimmer', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], }, { zigbeeModel: ['HK-SENSOR-4IN1-A'], model: 'HK-SENSOR-4IN1-A', vendor: 'Sunricher', description: '4IN1 Sensor', - extend: [battery(), identify(), occupancy(), temperature(), humidity(), illuminance()], + extend: [m.battery(), m.identify(), m.occupancy(), m.temperature(), m.humidity(), m.illuminance()], }, { zigbeeModel: ['SR-ZG9023A-EU'], model: 'SR-ZG9023A-EU', vendor: 'Sunricher', description: '4 ports switch with 2 usb ports (no metering)', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5}}), m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4', 'l5']})], }, { zigbeeModel: ['ON/OFF(2CH)'], model: 'UP-SA-9127D', vendor: 'Sunricher', description: 'LED-Trading 2 channel AC switch', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2}}), onOff({endpointNames: ['l1', 'l2']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), m.onOff({endpointNames: ['l1', 'l2']})], }, { fingerprint: [{modelID: 'ON/OFF(2CH)', softwareBuildID: '2.9.2_r54'}], @@ -813,7 +841,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HK-ZD-CCT-A', vendor: 'Sunricher', description: '50W Zigbee CCT LED driver (constant current)', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, { zigbeeModel: ['ZGRC-KEY-004'], @@ -970,28 +998,28 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZG192910-4', vendor: 'Sunricher', description: 'Zigbee LED-controller', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['ZG9101SAC-HP'], model: 'ZG9101SAC-HP', vendor: 'Sunricher', description: 'ZigBee AC phase-cut dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['ON/OFF -M', 'ON/OFF', 'ZIGBEE-SWITCH'], model: 'ZG9101SAC-HP-Switch', vendor: 'Sunricher', description: 'Zigbee AC in wall switch', - extend: [onOff({powerOnBehavior: false}), sunricherExternalSwitchType()], + extend: [m.onOff({powerOnBehavior: false}), sunricherExternalSwitchType()], }, { zigbeeModel: ['Micro Smart Dimmer', 'SM311', 'HK-SL-RDIM-A', 'HK-SL-DIM-EU-A'], model: 'ZG2835RAC', vendor: 'Sunricher', description: 'ZigBee knob smart dimmer', - extend: [light({configureReporting: true}), electricityMeter()], + extend: [m.light({configureReporting: true}), m.electricityMeter()], whiteLabel: [ {vendor: 'YPHIX', model: '50208695'}, {vendor: 'Samotech', model: 'SM311'}, @@ -1002,7 +1030,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'HK-SL-DIM-AU-R-A', vendor: 'Sunricher', description: 'ZigBee knob smart dimmer', - extend: [identify(), electricityMeter(), light({configureReporting: true})], + extend: [m.identify(), m.electricityMeter(), m.light({configureReporting: true})], }, { zigbeeModel: ['ZG2835'], @@ -1018,21 +1046,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'SR-ZG9040A/ZG9041A-D', vendor: 'Sunricher', description: 'Zigbee micro smart dimmer', - extend: [light({configureReporting: true}), electricityMeter(), sunricherExternalSwitchType(), sunricherMinimumPWM()], + extend: [m.light({configureReporting: true}), m.electricityMeter(), sunricherExternalSwitchType(), sunricherMinimumPWM()], }, { zigbeeModel: ['HK-ZD-DIM-A'], model: 'SRP-ZG9105-CC', vendor: 'Sunricher', description: 'Constant Current Zigbee LED dimmable driver', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['HK-DIM'], model: '50208702', vendor: 'Sunricher', description: 'LED dimmable driver', - extend: [light()], + extend: [m.light()], whiteLabel: [{vendor: 'Yphix', model: '50208702'}], toZigbee: [sunricher.tz.setModel], // Some ZG9030A-MW devices were mistakenly set with the modelId HK-DIM during manufacturing. @@ -1044,14 +1072,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'SR-ZG9040A-S', vendor: 'Sunricher', description: 'ZigBee AC phase-cut dimmer single-line', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['Micro Smart OnOff', 'HK-SL-RELAY-A'], model: 'SR-ZG9100A-S', vendor: 'Sunricher', description: 'Zigbee AC in wall switch single-line', - extend: [onOff()], + extend: [m.onOff()], }, { zigbeeModel: ['ZG2819S-CCT'], diff --git a/src/devices/tci.ts b/src/devices/tci.ts index e8759f6445138..8d9990af11626 100644 --- a/src/devices/tci.ts +++ b/src/devices/tci.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,21 +7,21 @@ const definitions: DefinitionWithExtend[] = [ model: '676-00301024955Z', vendor: 'TCI', description: 'Dash L DC Volare', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['MAXI JOLLY ZB3'], model: '151570', vendor: 'TCI', description: 'LED driver for wireless control (60 watt)', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['PROFESSIONALE ZB3'], model: '122576', vendor: 'TCI', description: 'Direct current wireless dimmable electronic drivers with DIP-SWITCH', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/tech.ts b/src/devices/tech.ts index 7ab0f286c0ec3..4cca279f17c9a 100644 --- a/src/devices/tech.ts +++ b/src/devices/tech.ts @@ -7,10 +7,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE204_r7brscr6'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_p1qrtljn'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_r7brscr6', '_TZE204_p1qrtljn']), model: 'VNTH-T2', vendor: 'TECH', description: 'Smart radiator valve', diff --git a/src/devices/terncy.ts b/src/devices/terncy.ts index 91789b498955e..09ea4d9e25384 100644 --- a/src/devices/terncy.ts +++ b/src/devices/terncy.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -14,14 +14,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'TERNCY-WS01', vendor: 'TERNCY', description: 'Smart light switch - 4 gang without neutral wire', - extend: [deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), onOff({endpointNames: ['l1', 'l2', 'l3', 'l4']})], + extend: [m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3, l4: 4}}), m.onOff({endpointNames: ['l1', 'l2', 'l3', 'l4']})], }, { zigbeeModel: ['DL001'], model: 'DL001', vendor: 'TERNCY', description: 'Two color temperature intelligent downlight', - extend: [light({colorTemp: {range: [156, 476]}})], + extend: [m.light({colorTemp: {range: [156, 476]}})], }, { zigbeeModel: ['TERNCY-DC01'], @@ -38,10 +38,11 @@ const definitions: DefinitionWithExtend[] = [ model: 'TERNCY-PP01', vendor: 'TERNCY', description: 'Awareness switch', - fromZigbee: [fz.terncy_temperature, fz.occupancy_with_timeout, fz.illuminance, fz.terncy_raw, fz.battery], - exposes: [e.temperature(), e.occupancy(), e.illuminance(), e.action(['single', 'double', 'triple', 'quadruple'])], + fromZigbee: [fz.terncy_temperature, fz.occupancy_with_timeout, fz.terncy_raw, fz.battery], + exposes: [e.temperature(), e.occupancy(), e.action(['single', 'double', 'triple', 'quadruple'])], toZigbee: [], meta: {battery: {dontDividePercentage: true}}, + extend: [m.illuminance()], }, { zigbeeModel: ['TERNCY-SD01'], @@ -73,7 +74,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'TERNCY', description: 'Beevon ceiling light', ota: true, - extend: [light({colorTemp: {range: [50, 500]}, powerOnBehavior: false, effect: false})], + extend: [m.light({colorTemp: {range: [50, 500]}, powerOnBehavior: false, effect: false})], }, ]; diff --git a/src/devices/the_light_group.ts b/src/devices/the_light_group.ts index 6684aa9e4e478..10197ba02b936 100644 --- a/src/devices/the_light_group.ts +++ b/src/devices/the_light_group.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -73,21 +73,21 @@ const definitions: DefinitionWithExtend[] = [ model: 'S24013', vendor: 'The Light Group', description: 'SLC SmartOne AC dimmer mini 200W Zigbee LN', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, { zigbeeModel: ['S32053'], model: 'S32053', vendor: 'The Light Group', description: 'SLC SmartOne CV led dimmable driver', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['S32055'], model: 'S32055', vendor: 'The Light Group', description: 'SLC SmartOne TW led dimmable driver 24V/75W', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, ]; diff --git a/src/devices/third_reality.ts b/src/devices/third_reality.ts index 0620bf709d38c..e1a20eba8a993 100644 --- a/src/devices/third_reality.ts +++ b/src/devices/third_reality.ts @@ -3,17 +3,7 @@ import {Zcl} from 'zigbee-herdsman'; import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import { - battery, - deviceAddCustomCluster, - deviceEndpoints, - electricityMeter, - humidity, - iasZoneAlarm, - light, - onOff, - temperature, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue} from '../lib/types'; @@ -58,7 +48,7 @@ const definitions: DefinitionWithExtend[] = [ device.save(); }, extend: [ - deviceAddCustomCluster('3rSwitchGen3SpecialCluster', { + m.deviceAddCustomCluster('3rSwitchGen3SpecialCluster', { ID: 0xff02, manufacturerCode: 0x1233, attributes: { @@ -85,7 +75,7 @@ const definitions: DefinitionWithExtend[] = [ model: '3RSS007Z', vendor: 'Third Reality', description: 'Smart light switch', - extend: [onOff()], + extend: [m.onOff()], meta: {disableDefaultResponse: true}, }, { @@ -93,14 +83,14 @@ const definitions: DefinitionWithExtend[] = [ model: '3RSL011Z', vendor: 'Third Reality', description: 'Smart light A19', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['3RSL012Z'], model: '3RSL012Z', vendor: 'Third Reality', description: 'Smart light BR30', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { zigbeeModel: ['3RWS18BZ'], @@ -111,7 +101,7 @@ const definitions: DefinitionWithExtend[] = [ toZigbee: [], ota: true, extend: [ - deviceAddCustomCluster('r3Specialcluster', { + m.deviceAddCustomCluster('r3Specialcluster', { ID: 0xff01, manufacturerCode: 0x1233, attributes: { @@ -146,7 +136,7 @@ const definitions: DefinitionWithExtend[] = [ device.save(); }, extend: [ - deviceAddCustomCluster('3rMotionSpecialCluster', { + m.deviceAddCustomCluster('3rMotionSpecialCluster', { ID: 0xff01, manufacturerCode: 0x1233, attributes: { @@ -173,7 +163,7 @@ const definitions: DefinitionWithExtend[] = [ device.save(); }, extend: [ - deviceAddCustomCluster('3rDoorSpecialCluster', { + m.deviceAddCustomCluster('3rDoorSpecialCluster', { ID: 0xff01, manufacturerCode: 0x1233, attributes: { @@ -190,9 +180,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Third Reality', description: 'Garage door tilt sensor', extend: [ - battery(), - iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']}), - deviceAddCustomCluster('3rGarageDoorSpecialCluster', { + m.battery(), + m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'battery_low']}), + m.deviceAddCustomCluster('3rGarageDoorSpecialCluster', { ID: 0xff01, manufacturerCode: 0x1407, attributes: { @@ -211,8 +201,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Third Reality', description: 'Zigbee / BLE smart plug', extend: [ - onOff(), - deviceAddCustomCluster('3rPlugGen1SpecialCluster', { + m.onOff(), + m.deviceAddCustomCluster('3rPlugGen1SpecialCluster', { ID: 0xff03, manufacturerCode: 0x1233, attributes: { @@ -246,7 +236,7 @@ const definitions: DefinitionWithExtend[] = [ }, exposes: [e.cover_position(), e.battery()], extend: [ - deviceAddCustomCluster('3rRollerShadeSpecialCluster', { + m.deviceAddCustomCluster('3rRollerShadeSpecialCluster', { ID: 0xfff1, manufacturerCode: 0x1233, attributes: { @@ -262,7 +252,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TRZB3', vendor: 'Third Reality', description: 'Roller blind motor', - extend: [battery()], + extend: [m.battery()], fromZigbee: [fz.cover_position_tilt], toZigbee: [tz.cover_state, tz.cover_position_tilt], exposes: [e.cover_position()], @@ -289,10 +279,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Third Reality', description: 'Temperature and humidity sensor', extend: [ - temperature(), - humidity(), - battery(), - deviceAddCustomCluster('3rSpecialCluster', { + m.temperature(), + m.humidity(), + m.battery(), + m.deviceAddCustomCluster('3rSpecialCluster', { ID: 0xff01, manufacturerCode: 0x1233, attributes: { @@ -312,10 +302,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Third Reality', description: 'Soil sensor', extend: [ - temperature(), - humidity(), - battery(), - deviceAddCustomCluster('3rSoilSpecialCluster', { + m.temperature(), + m.humidity(), + m.battery(), + m.deviceAddCustomCluster('3rSoilSpecialCluster', { ID: 0xff01, manufacturerCode: 0x1407, attributes: { @@ -335,10 +325,10 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Third Reality', description: 'Temperature and humidity sensor lite', extend: [ - temperature(), - humidity(), - battery(), - deviceAddCustomCluster('3rSpecialCluster', { + m.temperature(), + m.humidity(), + m.battery(), + m.deviceAddCustomCluster('3rSpecialCluster', { ID: 0xff01, manufacturerCode: 0x1407, attributes: { @@ -358,9 +348,9 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Third Reality', description: 'Smart watering kit', extend: [ - battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: true}), - onOff({powerOnBehavior: false}), - deviceAddCustomCluster('3rWateringSpecialCluster', { + m.battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: true}), + m.onOff({powerOnBehavior: false}), + m.deviceAddCustomCluster('3rWateringSpecialCluster', { ID: 0xfff2, manufacturerCode: 0x1407, attributes: { @@ -403,7 +393,7 @@ const definitions: DefinitionWithExtend[] = [ device.save(); }, extend: [ - deviceAddCustomCluster('3rPlugGen2SpecialCluster', { + m.deviceAddCustomCluster('3rPlugGen2SpecialCluster', { ID: 0xff03, manufacturerCode: 0x1233, attributes: { @@ -416,6 +406,22 @@ const definitions: DefinitionWithExtend[] = [ }), ], }, + { + zigbeeModel: ['3RSP02065Z'], + model: '3RSP02065Z', + vendor: 'Third Reality', + description: 'Zigbee / BLE smart plug with power', + extend: [m.onOff(), m.electricityMeter()], + ota: true, + }, + { + zigbeeModel: ['3RSP02064Z'], + model: '3RSP02064Z', + vendor: 'Third Reality', + description: 'Zigbee / BLE smart plug with power', + extend: [m.onOff(), m.electricityMeter()], + ota: true, + }, { zigbeeModel: ['3RDP01072Z'], model: '3RDP01072Z', @@ -423,9 +429,9 @@ const definitions: DefinitionWithExtend[] = [ description: 'Zigbee / BLE dual plug with power', ota: true, extend: [ - deviceEndpoints({endpoints: {left: 1, right: 2}}), - onOff({endpointNames: ['left', 'right']}), - electricityMeter({acFrequency: true, powerFactor: true, endpointNames: ['left', 'right']}), + m.deviceEndpoints({endpoints: {left: 1, right: 2}}), + m.onOff({endpointNames: ['left', 'right']}), + m.electricityMeter({acFrequency: true, powerFactor: true, endpointNames: ['left', 'right']}), ], }, { @@ -444,7 +450,7 @@ const definitions: DefinitionWithExtend[] = [ device.save(); }, extend: [ - deviceAddCustomCluster('3rVirationSpecialcluster', { + m.deviceAddCustomCluster('3rVirationSpecialcluster', { ID: 0xfff1, manufacturerCode: 0x1233, attributes: { @@ -465,8 +471,8 @@ const definitions: DefinitionWithExtend[] = [ description: 'Zigbee multi-function night light', ota: true, extend: [ - light({color: true}), - deviceAddCustomCluster('r3Specialcluster', { + m.light({color: true}), + m.deviceAddCustomCluster('r3Specialcluster', { ID: 0xfc00, manufacturerCode: 0x130d, attributes: { @@ -477,9 +483,10 @@ const definitions: DefinitionWithExtend[] = [ commands: {}, commandsResponse: {}, }), + m.illuminance(), ], - fromZigbee: [fzLocal.thirdreality_private_motion_sensor, fz.illuminance, fz.ias_occupancy_alarm_1_report], - exposes: [e.occupancy(), e.illuminance()], + fromZigbee: [fzLocal.thirdreality_private_motion_sensor, fz.ias_occupancy_alarm_1_report], + exposes: [e.occupancy()], configure: async (device, coordinatorEndpoint) => { device.powerSource = 'Mains (single phase)'; device.save(); @@ -491,7 +498,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Third Reality', description: 'Zigbee color lights', ota: true, - extend: [light({colorTemp: {range: [154, 500]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [154, 500]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['3RSPE01044BZ'], @@ -523,7 +530,7 @@ const definitions: DefinitionWithExtend[] = [ device.save(); }, extend: [ - deviceAddCustomCluster('3rPlugE2Specialcluster', { + m.deviceAddCustomCluster('3rPlugE2Specialcluster', { ID: 0xff03, manufacturerCode: 0x1233, attributes: { diff --git a/src/devices/tlwglobal.ts b/src/devices/tlwglobal.ts index 967b3a59bd47a..05041daf5372c 100644 --- a/src/devices/tlwglobal.ts +++ b/src/devices/tlwglobal.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -9,7 +9,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'K10-1220Z', vendor: 'TLW Global', description: '12V LED smart driver 15W with 6-port micro plug connector', - extend: [light()], + extend: [m.light()], }, // K10-1230Z and K10-1250Z untested, but assumed to be consistent with K10-1220W { @@ -17,14 +17,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'K10-1230Z', vendor: 'TLW Global', description: '12V LED smart driver 30W with 6-port micro plug connector', - extend: [light()], + extend: [m.light()], }, { zigbeeModel: ['K10-1250Z'], model: 'K10-1250Z', vendor: 'TLW Global', description: '12V LED smart driver 50W with 6-port micro plug connector', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/tplink.ts b/src/devices/tplink.ts index 9671553132d8f..2b8a90f76825a 100644 --- a/src/devices/tplink.ts +++ b/src/devices/tplink.ts @@ -1,5 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -11,19 +12,17 @@ const definitions: DefinitionWithExtend[] = [ model: 'MS100', vendor: 'TP-Link', description: 'Smart motion sensor', - fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.illuminance], + fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery], toZigbee: [], - exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery(), e.illuminance()], + exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery()], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); - const endpoint2 = device.getEndpoint(2); await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']); await reporting.batteryPercentageRemaining(endpoint); - await reporting.bind(endpoint2, coordinatorEndpoint, ['msIlluminanceMeasurement']); - await reporting.illuminance(endpoint2); device.powerSource = 'Battery'; device.save(); }, + extend: [m.illuminance()], }, { zigbeeModel: ['CS100'], diff --git a/src/devices/trust.ts b/src/devices/trust.ts index 3bb33c7d3a0ad..614caa78e3921 100644 --- a/src/devices/trust.ts +++ b/src/devices/trust.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -53,7 +53,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZLED-2709', vendor: 'Trust', description: 'Smart Dimmable LED Bulb', - extend: [light()], + extend: [m.light()], }, { fingerprint: [ @@ -78,7 +78,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZLED-TUNE9', vendor: 'Trust', description: 'Smart tunable LED bulb', - extend: [light({colorTemp: {range: undefined}})], + extend: [m.light({colorTemp: {range: undefined}})], }, { fingerprint: [ @@ -102,7 +102,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZLED-RGB9', vendor: 'Trust', description: 'Smart RGB LED bulb', - extend: [light({colorTemp: {range: [153, 500]}, color: true, powerOnBehavior: false})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: true, powerOnBehavior: false})], endpoint: (device) => { return {default: 2}; }, @@ -140,7 +140,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZCM-300', vendor: 'Trust', description: 'Zigbee smart dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 5fd3c2fc089e5..976f1081d6acc 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -5,22 +5,7 @@ import {ColorMode, colorModeLookup} from '../lib/constants'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; import {logger} from '../lib/logger'; -import { - actionEnumLookup, - battery, - commandsLevelCtrl, - commandsOnOff, - deviceEndpoints, - electricityMeter, - humidity, - iasZoneAlarm, - identify, - light, - onOff, - quirkCheckinInterval, - temperature, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import * as tuya from '../lib/tuya'; @@ -829,7 +814,7 @@ const definitions: DefinitionWithExtend[] = [ ], // Configure battery % fails // https://github.com/Koenkk/zigbee2mqtt/issues/22421 - extend: [battery({percentageReporting: false}), iasZoneAlarm({zoneType: 'smoke', zoneAttributes: ['alarm_1', 'tamper']})], + extend: [m.battery({percentageReporting: false}), m.iasZoneAlarm({zoneType: 'smoke', zoneAttributes: ['alarm_1', 'tamper']})], configure: async (device, coordinatorEndpoint) => { if (device?.manufacturerName === '_TZ3210_up3pngle') { // Required for this version @@ -901,7 +886,7 @@ const definitions: DefinitionWithExtend[] = [ if (!device || !noBatteryLowModels.includes(device.manufacturerName)) { exps.push(e.battery_low()); } - exps.push(e.linkquality()); + return exps; }, meta: { @@ -947,7 +932,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Linkoze', 'LKDSZ001', 'Door sensor with scene switch', ['_TZ3210_jowhpxop'])], }, { - fingerprint: [{modelID: 'TS0021', manufacturerName: '_TZ3210_3ulg9kpo'}], + fingerprint: tuya.fingerprint('TS0021', ['_TZ3210_3ulg9kpo']), model: 'LKWSZ211', vendor: 'Tuya', description: 'Scene remote with 2 keys', @@ -985,15 +970,15 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Linkoze', 'LKWSZ211', 'Wireless switch (2-key)', ['_TZ3210_3ulg9kpo'])], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_bq5c8xfe'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_bjawzodf'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_qyflbnbj'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_vs0skpuc'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_44af8vyi'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_zl1kmjqx'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_qyflbnbj'}, - ], + fingerprint: tuya.fingerprint('TS0601', [ + '_TZE200_bq5c8xfe', + '_TZE200_bjawzodf', + '_TZE200_qyflbnbj', + '_TZE200_vs0skpuc', + '_TZE200_44af8vyi', + '_TZE200_zl1kmjqx', + '_TZE204_qyflbnbj', + ]), model: 'TS0601_temperature_humidity_sensor_1', vendor: 'Tuya', description: 'Temperature & humidity sensor', @@ -1005,12 +990,12 @@ const definitions: DefinitionWithExtend[] = [ exps.push(e.battery_low()); exps.push(e.enum('battery_level', ea.STATE, ['low', 'middle', 'high']).withDescription('Battery level state')); } - exps.push(e.linkquality()); + return exps; }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_mfamvsdb'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_mfamvsdb']), model: 'F00MB00-04-1', vendor: 'FORIA', description: '4 scenes switch', @@ -1057,7 +1042,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE200_dhke3p9w']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_dhke3p9w', '_TZE284_dhke3p9w']), model: 'F00YK04-18-1', vendor: 'FORIA', description: '18 scenes remote', @@ -1096,6 +1081,7 @@ const definitions: DefinitionWithExtend[] = [ '_TZE200_cirvgep4', '_TZE200_upagmta9', '_TZE204_yjjdcqsq', + '_TZE204_jygvp6fk', '_TZE204_cirvgep4', ]), model: 'TS0601_temperature_humidity_sensor_2', @@ -1127,7 +1113,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_s1xgth2u'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_s1xgth2u']), model: 'TS0601_temperature_humidity_sensor_3', vendor: 'Tuya', description: 'Temperature & humidity sensor', @@ -1254,7 +1240,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Aubess', '1005005194831629', 'Contact, temperature and humidity sensor', ['_TZE200_nvups4nh'])], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vzqtvljm'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_vzqtvljm']), model: 'TS0601_illuminance_temperature_humidity_sensor_1', vendor: 'Tuya', description: 'Illuminance, temperature & humidity sensor', @@ -1263,15 +1249,15 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.temperature(), e.humidity(), e.illuminance(), e.battery()], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_8ygsuhe1'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_yvx5lh6k'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ryfmq5rl'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_c2fmom5z'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_mja3fuja'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_c2fmom5z'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_yvx5lh6k'}, - ], + fingerprint: tuya.fingerprint('TS0601', [ + '_TZE200_8ygsuhe1', + '_TZE200_yvx5lh6k', + '_TZE200_ryfmq5rl', + '_TZE200_c2fmom5z', + '_TZE200_mja3fuja', + '_TZE204_c2fmom5z', + '_TZE204_yvx5lh6k', + ]), model: 'TS0601_air_quality_sensor', vendor: 'Tuya', description: 'Air quality sensor', @@ -1280,7 +1266,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.temperature(), e.humidity(), e.co2(), e.voc().withUnit('ppm'), e.formaldehyd()], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_rbbx5mfq'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_rbbx5mfq']), model: 'TS0601_illuminance_temperature_humidity_sensor_2', vendor: 'Tuya', description: 'Illuminance sensor', @@ -1331,7 +1317,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.co2()], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_7bztmfm1'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_7bztmfm1', '_TZE204_7bztmfm1']), model: 'TS0601_smart_CO_air_box', vendor: 'Tuya', description: 'Smart air box (carbon monoxide)', @@ -1424,7 +1410,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE200_mby4kbtq', '_TZE204_mby4kbtq']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_mby4kbtq', '_TZE204_mby4kbtq', '_TZE204_uo8qcagc']), model: 'TS0601_gas_sensor_4', // _TZE200_mby4kbtq looks like TS0601_gas_sensor_2 vendor: 'Tuya', description: 'Gas sensor', @@ -1452,26 +1438,30 @@ const definitions: DefinitionWithExtend[] = [ }, { fingerprint: [ - {modelID: 'TS0001', manufacturerName: '_TZ3000_hktqahrq'}, - {manufacturerName: '_TZ3000_hktqahrq'}, - {manufacturerName: '_TZ3000_q6a3tepg'}, - {modelID: 'TS000F', manufacturerName: '_TZ3000_m9af2l6g'}, - {modelID: 'TS000F', manufacturerName: '_TZ3000_mx3vgyea'}, - {modelID: 'TS000F', manufacturerName: '_TZ3000_skueekg3'}, - {modelID: 'TS000F', manufacturerName: '_TZ3000_dlhhrhs8'}, - {modelID: 'TS000F', manufacturerName: '_TZ3000_fdxihpp7'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_skueekg3'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_npzfdcof'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_5ng23zjs'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_rmjr4ufz'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_v7gnj3ad'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_3a9beq8a'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_ark8nv4y'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_mx3vgyea'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_fdxihpp7'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_qsp2pwtf'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_kycczpw8'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_46t1rvdu'}, + ...tuya.fingerprint('TS0001', [ + '_TZ3000_hktqahrq', + '_TZ3000_q6a3tepg', + '_TZ3000_skueekg3', + '_TZ3000_npzfdcof', + '_TZ3000_5ng23zjs', + '_TZ3000_rmjr4ufz', + '_TZ3000_v7gnj3ad', + '_TZ3000_3a9beq8a', + '_TZ3000_ark8nv4y', + '_TZ3000_mx3vgyea', + '_TZ3000_fdxihpp7', + '_TZ3000_qsp2pwtf', + '_TZ3000_kycczpw8', + '_TZ3000_46t1rvdu', + ]), + ...tuya.fingerprint('TS000F', [ + '_TZ3000_hktqahrq', + '_TZ3000_m9af2l6g', + '_TZ3000_mx3vgyea', + '_TZ3000_skueekg3', + '_TZ3000_dlhhrhs8', + '_TZ3000_fdxihpp7', + ]), ], model: 'WHD02', vendor: 'Tuya', @@ -1523,17 +1513,18 @@ const definitions: DefinitionWithExtend[] = [ }, { fingerprint: [ - {modelID: 'TS011F', manufacturerName: '_TZ3000_rk2yzt0u'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_o4cjetlm'}, - {manufacturerName: '_TZ3000_o4cjetlm'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_iedbgyxt'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_h3noz0a5'}, - {modelID: 'TS0001', manufacturerName: '_TYZB01_4tlksk8a'}, - {modelID: 'TS0011', manufacturerName: '_TYZB01_rifa0wlb'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_5ucujjts'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_h8ngtlxy'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_w0ypwa1f'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_wpueorev'}, + ...tuya.fingerprint('TS011F', ['_TZ3000_rk2yzt0u', '_TZ3000_o4cjetlm']), + ...tuya.fingerprint('TS0001', [ + '_TZ3000_o4cjetlm', + '_TZ3000_iedbgyxt', + '_TZ3000_h3noz0a5', + '_TYZB01_4tlksk8a', + '_TZ3000_5ucujjts', + '_TZ3000_h8ngtlxy', + '_TZ3000_w0ypwa1f', + '_TZ3000_wpueorev', + ]), + ...tuya.fingerprint('TS0011', ['_TYZB01_rifa0wlb']), ], model: 'ZN231392', vendor: 'Tuya', @@ -1569,7 +1560,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TS0505', vendor: 'Tuya', description: ' GU10 zbeacon Zigbee LED bulb', - extend: [light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['TS0505B'], @@ -1656,7 +1647,7 @@ const definitions: DefinitionWithExtend[] = [ tuya.whitelabel('Skydance', 'WZ5_dim_2', 'Zigbee & RF 5 in 1 LED controller (DIM mode)', ['_TZB210_3zfp8mki']), tuya.whitelabel('QA', 'QADZC5', '5 in 1 LED controller', ['_TZB210_gj0ccsar']), ], - extend: [light({colorTemp: {range: [153, 500]}, color: {modes: ['hs'], applyRedFix: true, enhancedHue: false}})], + extend: [m.light({colorTemp: {range: [153, 500]}, color: {modes: ['hs'], applyRedFix: true, enhancedHue: false}})], configure: async (device, coordinatorEndpoint) => { device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29}); }, @@ -1733,11 +1724,12 @@ const definitions: DefinitionWithExtend[] = [ model: 'TS0202_3', vendor: 'Tuya', description: 'Motion detector with illuminance', - fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1_report, fz.illuminance], + fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1_report], toZigbee: [], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, - exposes: [e.occupancy(), e.battery_low(), e.battery(), e.tamper(), e.illuminance()], + exposes: [e.occupancy(), e.battery_low(), e.battery(), e.tamper()], + extend: [m.illuminance()], }, { fingerprint: tuya.fingerprint('TS0202', ['_TZ3210_cwamkvua']), @@ -1768,20 +1760,14 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [{vendor: 'Linkoze', model: 'LKMSZ001'}], }, { - fingerprint: [ - {modelID: 'TS0202', manufacturerName: '_TYZB01_jytabjkb'}, - {modelID: 'TS0202', manufacturerName: '_TZ3000_lltemgsf'}, - {modelID: 'TS0202', manufacturerName: '_TYZB01_5nr7ncpl'}, - {modelID: 'TS0202', manufacturerName: '_TZ3000_mg4dy6z6'}, - {modelID: 'TS0202', manufacturerName: '_TZ3000_bsvqrxru'}, - ], + fingerprint: tuya.fingerprint('TS0202', ['_TYZB01_jytabjkb', '_TZ3000_lltemgsf', '_TYZB01_5nr7ncpl', '_TZ3000_mg4dy6z6', '_TZ3000_bsvqrxru']), model: 'TS0202_1', vendor: 'Tuya', description: 'Motion sensor', // Requires alarm_1_with_timeout https://github.com/Koenkk/zigbee2mqtt/issues/2818#issuecomment-776119586 fromZigbee: [fz.ias_occupancy_alarm_1_with_timeout, fz.battery, fz.ignore_basic_report], toZigbee: [], - exposes: [e.occupancy(), e.battery_low(), e.linkquality(), e.battery(), e.battery_voltage()], + exposes: [e.occupancy(), e.battery_low(), e.battery(), e.battery_voltage()], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']); @@ -1815,7 +1801,7 @@ const definitions: DefinitionWithExtend[] = [ if (!device || !['_TZ3000_bsvqrxru', '_TZ3000_nss8amz9'].includes(device.manufacturerName)) { exps.push(e.tamper()); } - exps.push(e.linkquality()); + return exps; }, configure: async (device, coordinatorEndpoint) => { @@ -1836,7 +1822,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor', fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ZM35HQ_attr, legacy.fromZigbee.ZM35HQ_battery], toZigbee: [tz.ZM35HQ_attr], - extend: [quirkCheckinInterval(15000)], + extend: [m.quirkCheckinInterval(15000)], exposes: [ e.occupancy(), e.battery_low(), @@ -1855,9 +1841,9 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.ignore_basic_report, fz.ZM35HQ_attr, fz.battery], toZigbee: [tz.ZM35HQ_attr], extend: [ - quirkCheckinInterval(15000), + m.quirkCheckinInterval(15000), // Occupancy reporting interval is 60s, so allow for one dropped update plus a small safety margin of 5s - iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low'], keepAliveTimeout: 125}), + m.iasZoneAlarm({zoneType: 'occupancy', zoneAttributes: ['alarm_1', 'battery_low'], keepAliveTimeout: 125}), ], exposes: [ e.battery(), @@ -1880,7 +1866,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor', fromZigbee: [fz.ias_occupancy_alarm_1, fz.ignore_basic_report, fz.ZM35HQ_attr, fz.battery], toZigbee: [tz.ZM35HQ_attr], - extend: [quirkCheckinInterval(15000)], + extend: [m.quirkCheckinInterval(15000)], exposes: [ e.occupancy(), e.battery_low(), @@ -1898,19 +1884,19 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0207', manufacturerName: '_TZ3000_m0vaazab'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_ufttklsz'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_nkkl7uzv'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_misw04hq'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_nlsszmzl'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_gszjt2xx'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_wlquqiiz'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_5k5vh43t'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_kxlmv9ag'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_wmlc9p9z'}, - {modelID: 'TS0207', manufacturerName: '_TZ3000_shopg9ss'}, - ], + fingerprint: tuya.fingerprint('TS0207', [ + '_TZ3000_m0vaazab', + '_TZ3000_ufttklsz', + '_TZ3000_nkkl7uzv', + '_TZ3000_misw04hq', + '_TZ3000_nlsszmzl', + '_TZ3000_gszjt2xx', + '_TZ3000_wlquqiiz', + '_TZ3000_5k5vh43t', + '_TZ3000_kxlmv9ag', + '_TZ3000_wmlc9p9z', + '_TZ3000_shopg9ss', + ]), model: 'TS0207_repeater', vendor: 'Tuya', description: 'Repeater', @@ -1956,17 +1942,17 @@ const definitions: DefinitionWithExtend[] = [ if (!device || !noTamperModels.includes(device.manufacturerName)) { exps.push(e.tamper()); } - exps.push(e.linkquality()); + return exps; }, }, { - fingerprint: [{modelID: 'TS0207', manufacturerName: '_TZ3210_tgvtvdoc'}], + fingerprint: tuya.fingerprint('TS0207', ['_TZ3210_tgvtvdoc']), model: 'RB-SRAIN01', vendor: 'Tuya', description: 'Solar rain sensor', fromZigbee: [tuya.fz.datapoints], - extend: [iasZoneAlarm({zoneType: 'rain', zoneAttributes: ['alarm_1']}), battery({percentageReporting: false})], + extend: [m.iasZoneAlarm({zoneType: 'rain', zoneAttributes: ['alarm_1']}), m.battery({percentageReporting: false})], exposes: [ e.illuminance().withUnit('lx'), e.numeric('illuminance_average_20min', ea.STATE).withUnit('lx').withDescription('Illuminance average for the last 20 minutes'), @@ -2003,7 +1989,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0108', manufacturerName: '_TYZB01_7yidyqxd'}], + fingerprint: tuya.fingerprint('TS0108', ['_TYZB01_7yidyqxd']), model: 'TS0108', vendor: 'Tuya', description: 'Socket with 2 USB', @@ -2157,6 +2143,7 @@ const definitions: DefinitionWithExtend[] = [ '_TZE200_ebwgzdqq', '_TZE204_vevc4c6g', '_TZE200_0nauxa0p', + '_TZE200_ykgar0ow', ]), model: 'TS0601_dimmer_1_gang_1', vendor: 'Tuya', @@ -2164,13 +2151,19 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], configure: tuya.configureMagicPacket, - exposes: [ - tuya.exposes.lightBrightnessWithMinMax(), - tuya.exposes.countdown(), - tuya.exposes.lightType(), - e.power_on_behavior().withAccess(ea.STATE_SET), - tuya.exposes.backlightModeOffNormalInverted().withAccess(ea.STATE_SET), - ], + exposes: (device, options) => { + const exps: Expose[] = [ + tuya.exposes.lightBrightnessWithMinMax(), + tuya.exposes.countdown(), + e.power_on_behavior().withAccess(ea.STATE_SET), + ]; + + if (!device || !['_TZE200_ykgar0ow'].includes(device.manufacturerName)) { + exps.push(tuya.exposes.lightType(), tuya.exposes.backlightModeOffNormalInverted().withAccess(ea.STATE_SET)); + } + + return exps; + }, meta: { tuyaDatapoints: [ [1, 'state', tuya.valueConverter.onOff, {skip: tuya.skip.stateOnAndBrightnessPresent}], @@ -2198,6 +2191,7 @@ const definitions: DefinitionWithExtend[] = [ tuya.whitelabel('Mercator Ikuü', 'SSWM-DIMZ', 'Switch Mechanism', ['_TZE200_9cxuhakf']), tuya.whitelabel('Mercator Ikuü', 'SSWRM-ZB', 'Rotary dimmer mechanism', ['_TZE200_a0syesf5']), tuya.whitelabel('Lonsonho', 'EDM-1ZBB-EU', 'Smart Dimmer Switch', ['_TZE200_0nauxa0p']), + tuya.whitelabel('ION Industries', 'ID200W-ZIGB', 'LED Zigbee Dimmer', ['_TZE200_ykgar0ow']), ], }, { @@ -2239,7 +2233,7 @@ const definitions: DefinitionWithExtend[] = [ ], extend: [ tuya.modernExtend.tuyaMagicPacket(), - deviceEndpoints({endpoints: {l1: 1, l2: 1}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 1}}), tuya.modernExtend.dpLight({ state: { dp: 1, @@ -2413,18 +2407,9 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [{vendor: 'Moes', model: 'MS-105-M'}], }, { - fingerprint: [ - { - modelID: 'TS0601', - manufacturerName: '_TZE204_5cuocqty', - }, - { - modelID: 'TS0601', - manufacturerName: '_TZE204_nqqylykc', - }, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_5cuocqty', '_TZE204_nqqylykc', '_TZE204_2cyb66xl', '_TZE204_tgdnh7pw']), model: 'ZDMS16-1', - vendor: 'Avatto', + vendor: 'AVATTO', description: 'Zigbee 1 channel Dimmer', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], @@ -2448,18 +2433,9 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - { - modelID: 'TS0601', - manufacturerName: '_TZE204_o9gyszw2', - }, - { - modelID: 'TS0601', - manufacturerName: '_TZE204_jtbgusdc', - }, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_o9gyszw2', '_TZE204_jtbgusdc']), model: 'ZDMS16-2', - vendor: 'Avatto', + vendor: 'AVATTO', description: 'Zigbee 2 channels Dimmer', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], @@ -2523,7 +2499,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_oiymh3qu'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_oiymh3qu']), model: 'TS011F_socket_module', vendor: 'Tuya', description: 'Socket module', @@ -2540,10 +2516,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS011F', manufacturerName: '_TZ3000_wxtp7c5y'}, - {modelID: 'TS011F', manufacturerName: '_TYZB01_mtunwanm'}, - ], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_wxtp7c5y', '_TYZB01_mtunwanm']), model: 'TS011F_wall_outlet', vendor: 'Tuya', description: 'In-wall outlet', @@ -2555,14 +2528,14 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0003', manufacturerName: '_TYZB01_u9kkqh5o'}], + fingerprint: tuya.fingerprint('TS0003', ['_TYZB01_u9kkqh5o']), model: 'CSP043', vendor: 'ClickSmart+', description: '1 gang switch module with neutral wire', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { - fingerprint: [{modelID: 'TS0012', manufacturerName: '_TZ3000_biakwrag'}], + fingerprint: tuya.fingerprint('TS0012', ['_TZ3000_biakwrag']), model: 'CSP042', vendor: 'ClickSmart+', description: '2 gang switch module without neutral wire', @@ -2577,14 +2550,11 @@ const definitions: DefinitionWithExtend[] = [ model: 'CSP051', vendor: 'ClickSmart+', description: '1 gang smart dimmer switch module without neutral', - extend: [light()], + extend: [m.light()], whiteLabel: [tuya.whitelabel('Lonsonho', 'QS-Zigbee-D02-TRIAC-L', '1 gang smart dimmer switch module without neutral', ['_TZ3000_ktuoyvt5'])], }, { - fingerprint: [ - {modelID: 'isltm67\u0000', manufacturerName: '_TYST11_pisltm67'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_pisltm67'}, - ], + fingerprint: [...tuya.fingerprint('isltm67\u0000', ['_TYST11_pisltm67']), ...tuya.fingerprint('TS0601', ['_TZE200_pisltm67'])], model: 'S-LUX-ZB', vendor: 'Tuya', description: 'Light sensor', @@ -2594,7 +2564,7 @@ const definitions: DefinitionWithExtend[] = [ const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']); }, - exposes: [e.battery(), e.illuminance(), e.linkquality(), e.enum('brightness_level', ea.STATE, ['LOW', 'MEDIUM', 'HIGH'])], + exposes: [e.battery(), e.illuminance(), e.enum('brightness_level', ea.STATE, ['LOW', 'MEDIUM', 'HIGH'])], }, { zigbeeModel: ['TS130F'], @@ -2641,7 +2611,7 @@ const definitions: DefinitionWithExtend[] = [ if (device?.manufacturerName !== '_TZ3210_xbpt8ewc' && device?.manufacturerName !== '_TZ3000_e3vhyirx') { exps.push(tuya.exposes.indicatorMode(), tuya.exposes.backlightModeOffOn()); } - exps.push(e.linkquality()); + return exps; }, }, @@ -2664,13 +2634,7 @@ const definitions: DefinitionWithExtend[] = [ }, { zigbeeModel: ['qnazj70', 'kjintbl'], - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_oisqyl4o'}, - {modelID: 'TS0601', manufacturerName: '_TZ3000_uim07oem'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_js3mgbjb'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_7deq70b8'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_ptaqh9tk'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_oisqyl4o', '_TZ3000_uim07oem', '_TZE200_js3mgbjb', '_TZE200_7deq70b8', '_TZE204_ptaqh9tk']), model: 'TS0601_switch', vendor: 'Tuya', description: '1, 2, 3 or 4 gang switch', @@ -2706,7 +2670,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TS0301', vendor: 'Tuya', description: 'Cover', - extend: [battery(), windowCovering({controls: ['lift', 'tilt']})], + extend: [m.battery(), m.windowCovering({controls: ['lift', 'tilt']})], whiteLabel: [tuya.whitelabel('Yookee', 'D10110_1', 'Smart blind', ['_TZE200_9caxna4s'])], }, { @@ -2892,13 +2856,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_kyfqmmyl'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_2hf7x9n3'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_atpwqgml'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_bynnczcb'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_atpwqgml'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_kyfqmmyl', '_TZE200_2hf7x9n3', '_TZE204_atpwqgml', '_TZE200_bynnczcb', '_TZE200_atpwqgml']), model: 'TS0601_switch_3_gang', vendor: 'Tuya', description: '3 gang switch', @@ -2977,14 +2935,14 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0215A', manufacturerName: '_TZ3000_p6ju8myv'}, - {modelID: 'TS0215A', manufacturerName: '_TZ3000_0zrccfgx'}, - {modelID: 'TS0215A', manufacturerName: '_TZ3000_fsiepnrh'}, - {modelID: 'TS0215A', manufacturerName: '_TZ3000_ug1vtuzn'}, - {modelID: 'TS0215A', manufacturerName: '_TZ3000_eo3dttwe'}, - {modelID: 'TS0215A', manufacturerName: '_TZ3000_jwcixnrz'}, - ], + fingerprint: tuya.fingerprint('TS0215A', [ + '_TZ3000_p6ju8myv', + '_TZ3000_0zrccfgx', + '_TZ3000_fsiepnrh', + '_TZ3000_ug1vtuzn', + '_TZ3000_eo3dttwe', + '_TZ3000_jwcixnrz', + ]), model: 'TS0215A_remote', vendor: 'Tuya', description: 'Security remote control', @@ -3001,7 +2959,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0503A', manufacturerName: '_TZ3000_obacbukl'}], + fingerprint: tuya.fingerprint('TS0503A', ['_TZ3000_obacbukl']), model: 'TS0503A', vendor: 'Tuya', description: 'Led strip controller', @@ -3066,7 +3024,7 @@ const definitions: DefinitionWithExtend[] = [ extend: [tuya.modernExtend.tuyaLight({colorTemp: {range: undefined}, color: true})], }, { - fingerprint: [{modelID: 'TS0505A', manufacturerName: '_TZ3000_sosdczdl'}], + fingerprint: tuya.fingerprint('TS0505A', ['_TZ3000_sosdczdl']), model: 'TS0505A_led', vendor: 'Tuya', description: 'RGB+CCT LED', @@ -3094,7 +3052,6 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{manufacturerName: '_TZ2000_a476raq2'}], zigbeeModel: ['TS0201', 'SNTZ003', 'TY0201'], model: 'TS0201', vendor: 'Tuya', @@ -3108,20 +3065,21 @@ const definitions: DefinitionWithExtend[] = [ {vendor: 'BlitzWolf', model: 'BW-IS4'}, tuya.whitelabel('Tuya', 'TS0201_1', 'Zigbee 3.0 temperature humidity sensor with display', ['_TZ3210_alxkwn0h']), tuya.whitelabel('Tuya', 'ZTH01/ZTH02', 'Temperature and humidity sensor', ['_TZ3000_0s1izerx']), + tuya.whitelabel('Tuya', 'ZY-ZTH02', 'Temperature and humidity sensor', ['_TZ3000_v1w2k9dd']), tuya.whitelabel('SEDEA', 'eTH730', 'Temperature and humidity sensor', ['_TZ3000_lqmvrwa2']), tuya.whitelabel('Danfoss', '014G2480', 'Temperature and humidity sensor', ['_TZ3000_mxzo5rhf']), ], }, { - fingerprint: [ - {modelID: 'TS0201', manufacturerName: '_TZ3000_bguser20'}, - {modelID: 'TS0201', manufacturerName: '_TZ3000_yd2e749y'}, - {modelID: 'TS0201', manufacturerName: '_TZ3000_6uzkisv2'}, - {modelID: 'TS0201', manufacturerName: '_TZ3000_xr3htd96'}, - {modelID: 'TS0201', manufacturerName: '_TZ3000_fllyghyj'}, - {modelID: 'TS0201', manufacturerName: '_TZ3000_saiqcn0y'}, - {modelID: 'TS0201', manufacturerName: '_TZ3000_bjawzodf'}, - ], + fingerprint: tuya.fingerprint('TS0201', [ + '_TZ3000_bguser20', + '_TZ3000_yd2e749y', + '_TZ3000_6uzkisv2', + '_TZ3000_xr3htd96', + '_TZ3000_fllyghyj', + '_TZ3000_saiqcn0y', + '_TZ3000_bjawzodf', + ]), model: 'WSD500A', vendor: 'Tuya', description: 'Temperature & humidity sensor', @@ -3191,15 +3149,14 @@ const definitions: DefinitionWithExtend[] = [ description: '2 gang socket with power monitoring and USB', extend: [ tuyaMagicPacket(), - deviceEndpoints({endpoints: {left: 1, right: 2}, multiEndpointSkip: ['current', 'voltage', 'power', 'energy']}), - onOff({powerOnBehavior: false, endpointNames: ['left', 'right']}), - identify(), - electricityMeter(), + m.deviceEndpoints({endpoints: {left: 1, right: 2}, multiEndpointSkip: ['current', 'voltage', 'power', 'energy']}), + m.onOff({powerOnBehavior: false, endpointNames: ['left', 'right']}), + m.identify(), + m.electricityMeter(), ], }, { zigbeeModel: ['TS0041'], - fingerprint: [{manufacturerName: '_TZ3000_tk3s5tyg'}], model: 'TS0041', vendor: 'Tuya', description: 'Wireless switch with 1 button', @@ -3613,7 +3570,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_qq9mpfhw'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_qq9mpfhw']), model: 'TS0601_water_sensor', vendor: 'Tuya', description: 'Water leak sensor', @@ -3623,7 +3580,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [{vendor: 'Neo', model: 'NAS-WS02B0'}], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_jthf7vb6'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_jthf7vb6']), model: 'WLS-100z', vendor: 'Tuya', description: 'Water leak sensor', @@ -3649,6 +3606,7 @@ const definitions: DefinitionWithExtend[] = [ '_TZ3000_qaabwu5c', '_TZ3000_ikuxinvo', '_TZ3000_hzlsaltw', + '_TZ3000_jsfzkftc', ]), model: 'TS0001_power', description: 'Switch with power monitoring', @@ -3680,7 +3638,7 @@ const definitions: DefinitionWithExtend[] = [ tuya.whitelabel('Nous', 'B2Z', '1 gang switch with power monitoring', ['_TZ3000_qlai3277']), tuya.whitelabel('Colorock', 'CR-MNZ1', '1 gang switch 30A with power monitoring', ['_TZ3000_tgddllx4']), tuya.whitelabel('Nous', 'L6Z', 'Switch with power monitoring', ['_TZ3000_qaabwu5c']), - tuya.whitelabel('Tuya', 'TS0001_power_polling', 'Switch with power monitoring (via polling)', ['_TZ3000_x3ewpzyr']), + tuya.whitelabel('Tuya', 'XSH01A', '1 gang switch', ['_TZ3000_x3ewpzyr']), ], onEvent: async (type, data, device, options) => { if (['_TZ3000_x3ewpzyr'].includes(device.manufacturerName)) { @@ -3771,7 +3729,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0001', manufacturerName: '_TZ3000_gbshwgag'}], + fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_gbshwgag']), model: 'TS0001_switch_module_2', vendor: 'Tuya', description: '1 gang switch with backlight', @@ -3926,8 +3884,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Tuya', description: '3 gang switch', extend: [ - deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), - onOff({endpointNames: ['left', 'center', 'right'], powerOnBehavior: false}), + m.deviceEndpoints({endpoints: {left: 1, center: 2, right: 3}}), + m.onOff({endpointNames: ['left', 'center', 'right'], powerOnBehavior: false}), ], whiteLabel: [ {vendor: 'BSEED', model: 'TS0003', description: 'Zigbee switch'}, @@ -4028,62 +3986,62 @@ const definitions: DefinitionWithExtend[] = [ 'mcdj3aq\u0000', // Tubular motors ], fingerprint: [ - // Curtain motors: - {modelID: 'TS0601', manufacturerName: '_TZE200_5zbp6j0u'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_nkoabg8w'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_xuzcvlku'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_4vobcgd3'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_nogaemzt'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_r0jdjrvi'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_pk0sfzvr'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_fdtjuw7u'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_zpzndjez'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_wmcdj3aq'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_cowvfni3'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_rddyvrci'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_nueqqe6k'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_bqcqqjpb'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_xaabybja'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_rmymn92d'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_feolm6rk'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_3i3exuay'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_tvrvdj6o'}, - {modelID: 'zo2pocs\u0000', manufacturerName: '_TYST11_fzo2pocs'}, - {modelID: 'dank5zs\u0000', manufacturerName: '_TYST11_udank5zs'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_b2u1drdv'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ol5jlkkr'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_guvc7pdy'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_zxxfv8wi'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_1fuxihti'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_1fuxihti'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_57hjqelq'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_m1wl5fvq'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_en3wvcbx'}, - // Roller blinds: - {modelID: 'TS0601', manufacturerName: '_TZE200_fctwhugx'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_hsgrhjpf'}, - // Window pushers: - {modelID: 'TS0601', manufacturerName: '_TZE200_g5wdnuow'}, - // Tubular motors: - {modelID: 'TS0601', manufacturerName: '_TZE200_5sbebbzs'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_udank5zs'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_dpqsvdbi'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_zuz7f94z'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_nv6nxo0c'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_3ylew7b4'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_llm0epxg'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_n1aauwb4'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_xu4a5rhj'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_bjzrowv2'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_bjzrowv2'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_axgvo9jh'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_gaj531w3'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_yia0p3tr'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_rsj5pu8y'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_xu4a5rhj'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_2odrmqwq'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_lh3arisb'}, - {modelID: 'TS0601', manufacturerName: '_TZE284_udank5zs'}, + ...tuya.fingerprint('TS0601', [ + '_TZE200_5zbp6j0u', + '_TZE200_nkoabg8w', + '_TZE200_xuzcvlku', + '_TZE200_4vobcgd3', + '_TZE200_nogaemzt', + '_TZE200_r0jdjrvi', + '_TZE200_pk0sfzvr', + '_TZE200_fdtjuw7u', + '_TZE200_zpzndjez', + '_TZE200_wmcdj3aq', + '_TZE200_cowvfni3', + '_TZE200_rddyvrci', + '_TZE200_nueqqe6k', + '_TZE200_bqcqqjpb', + '_TZE200_xaabybja', + '_TZE200_rmymn92d', + '_TZE200_feolm6rk', + '_TZE200_3i3exuay', + '_TZE200_tvrvdj6o', + '_TZE200_b2u1drdv', + '_TZE200_ol5jlkkr', + '_TZE204_guvc7pdy', + '_TZE200_zxxfv8wi', + '_TZE200_1fuxihti', + '_TZE204_1fuxihti', + '_TZE204_57hjqelq', + '_TZE204_m1wl5fvq', + '_TZE200_en3wvcbx', + '_TZE200_fctwhugx', + '_TZE200_hsgrhjpf', + '_TZE200_g5wdnuow', + '_TZE200_5sbebbzs', + '_TZE200_udank5zs', + '_TZE204_dpqsvdbi', + '_TZE200_zuz7f94z', + '_TZE200_nv6nxo0c', + '_TZE200_3ylew7b4', + '_TZE200_llm0epxg', + '_TZE200_n1aauwb4', + '_TZE200_xu4a5rhj', + '_TZE200_bjzrowv2', + '_TZE204_bjzrowv2', + '_TZE200_axgvo9jh', + '_TZE200_gaj531w3', + '_TZE200_yia0p3tr', + '_TZE200_rsj5pu8y', + '_TZE204_xu4a5rhj', + '_TZE200_2odrmqwq', + '_TZE204_lh3arisb', + '_TZE284_udank5zs', + '_TZE200_7shyddj3', + '_TZE204_a2jcoyuk', + ]), + ...tuya.fingerprint('zo2pocs\u0000', ['_TYST11_fzo2pocs']), + ...tuya.fingerprint('dank5zs\u0000', ['_TYST11_udank5zs']), ], model: 'TS0601_cover_1', vendor: 'Tuya', @@ -4106,6 +4064,7 @@ const definitions: DefinitionWithExtend[] = [ {vendor: 'A-OK', model: 'AM25', description: 'Tubular motor'}, {vendor: 'Alutech', model: 'AM/R-Sm', description: 'Tubular motor'}, tuya.whitelabel('Shenzhen Golden Security Technology', 'GM46', 'Curtain motor', ['_TZE204_guvc7pdy']), + tuya.whitelabel('Roximo', 'CRTZ01', 'Curtain motor', ['_TZE204_57hjqelq']), {vendor: 'Quoya', model: 'AT8510-TY'}, tuya.whitelabel('Somgoms', 'ZSTY-SM-1DMZG-US-W_1', 'Curtain switch', ['_TZE200_axgvo9jh']), tuya.whitelabel('HUARUI', 'CMD900LE', 'Lithium battery intelligent curtain opening and closing motor', ['_TZE200_zxxfv8wi']), @@ -4122,10 +4081,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - // Curtain motors: - {modelID: 'TS0601', manufacturerName: '_TZE200_eegnwoyw'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_eegnwoyw']), model: 'TS0601_cover_2', vendor: 'Tuya', description: 'Curtain motor fixed speed', @@ -4135,11 +4091,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.cover_position().setAccess('position', ea.STATE_SET)], }, { - fingerprint: [ - // Curtain motors: - {modelID: 'TS0601', manufacturerName: '_TZE200_cpbo62rn'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_libht6ua'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_cpbo62rn', '_TZE200_libht6ua']), model: 'TS0601_cover_6', vendor: 'Tuya', description: 'Cover motor', @@ -4191,7 +4143,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE204_r0jdjrvi', '_TZE200_g5xqosu7', '_TZE284_fzo2pocs']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_r0jdjrvi', '_TZE200_g5xqosu7', '_TZE204_g5xqosu7', '_TZE284_fzo2pocs']), model: 'TS0601_cover_8', vendor: 'Tuya', description: 'Cover motor', @@ -4264,27 +4216,27 @@ const definitions: DefinitionWithExtend[] = [ }, { zigbeeModel: ['kud7u2l'], - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_ckud7u2l'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ywdxldoj'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_do5qy8zo'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_cwnjrr72'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_pvvbommb'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_9sfg7gm0'}, // HomeCloud - {modelID: 'TS0601', manufacturerName: '_TZE200_2atgpdho'}, // HY367 - {modelID: 'TS0601', manufacturerName: '_TZE200_cpmgn2cf'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_znlqjmih'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_8thwkzxl'}, // Tervix eva2 - {modelID: 'TS0601', manufacturerName: '_TZE200_4eeyebrt'}, // Immax 07732B - {modelID: 'TS0601', manufacturerName: '_TZE200_8whxpsiw'}, // EVOLVEO - {modelID: 'TS0601', manufacturerName: '_TZE200_xby0s3ta'}, // Sandy Beach HY367 - {modelID: 'TS0601', manufacturerName: '_TZE200_7fqkphoq'}, // AFINTEK - {modelID: 'TS0601', manufacturerName: '_TZE200_rufdtfyv'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_lpwgshtl'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_rk1wojce'}, // Emos P5630S - {modelID: 'TS0601', manufacturerName: '_TZE200_rndg81sf'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_qjp4ynvi'}, - ], + fingerprint: tuya.fingerprint('TS0601', [ + '_TZE200_ckud7u2l', + '_TZE200_ywdxldoj', + '_TZE200_do5qy8zo', + '_TZE200_cwnjrr72', + '_TZE200_pvvbommb', + '_TZE200_9sfg7gm0', + '_TZE200_2atgpdho', + '_TZE200_cpmgn2cf', + '_TZE200_znlqjmih', + '_TZE200_8thwkzxl', + '_TZE200_4eeyebrt', + '_TZE200_8whxpsiw', + '_TZE200_xby0s3ta', + '_TZE200_7fqkphoq', + '_TZE200_rufdtfyv', + '_TZE200_lpwgshtl', + '_TZE200_rk1wojce', + '_TZE200_rndg81sf', + '_TZE200_qjp4ynvi', + ]), model: 'TS0601_thermostat', vendor: 'Tuya', description: 'Radiator valve with thermostat', @@ -4502,7 +4454,7 @@ const definitions: DefinitionWithExtend[] = [ tuyaDatapoints: [ [1, 'state', tuya.valueConverterBasic.lookup({OPEN: tuya.enum(0), STOP: tuya.enum(1), CLOSE: tuya.enum(2)})], [2, 'position', tuya.valueConverter.coverPosition], - [3, 'position', tuya.valueConverter.raw], + [3, 'position', tuya.valueConverter.coverPosition], [5, 'reverse_direction', tuya.valueConverterBasic.lookup({forward: tuya.enum(0), back: tuya.enum(1)})], [12, 'motor_fault', tuya.valueConverter.trueFalse1], [13, 'battery', tuya.valueConverter.raw], @@ -4753,8 +4705,10 @@ const definitions: DefinitionWithExtend[] = [ '_TZE200_bvu2wnxz' /* model: 'ME167', vendor: 'AVATTO' */, '_TZE200_6rdj8dzm' /* model: 'ME167', vendor: 'AVATTO' */, '_TZE200_9xfjixap' /* model: 'ME167', vendor: 'AVATTO' */, + '_TZE200_jkfbph7l' /* model: 'ME167', vendor: 'AVATTO' */, '_TZE200_p3dbf6qs' /* model: 'ME168', vendor: 'AVATTO' */, '_TZE200_rxntag7i' /* model: 'ME168', vendor: 'AVATTO' */, + '_TZE200_ybsqljjg' /* model: 'ME168', vendor: 'AVATTO' */, '_TZE200_yqgbrdyo', '_TZE284_p3dbf6qs', '_TZE200_rxq4iti9', @@ -4774,8 +4728,9 @@ const definitions: DefinitionWithExtend[] = [ '_TZE200_bvu2wnxz', '_TZE200_6rdj8dzm', '_TZE200_9xfjixap', + '_TZE200_jkfbph7l', ]), - tuya.whitelabel('AVATTO', 'ME168', 'Thermostatic radiator valve', ['_TZE200_rxntag7i']), + tuya.whitelabel('AVATTO', 'ME168', 'Thermostatic radiator valve', ['_TZE200_rxntag7i', '_TZE200_ybsqljjg']), tuya.whitelabel('AVATTO', 'TRV06_1', 'Thermostatic radiator valve', ['_TZE200_hvaxb2tc', '_TZE284_o3x45p96']), tuya.whitelabel('EARU', 'TRV06', 'Smart thermostat module', ['_TZE200_yqgbrdyo', '_TZE200_rxq4iti9']), tuya.whitelabel('AVATTO', 'AVATTO_TRV06', 'Thermostatic radiator valve', ['_TZE284_c6wv4xyo', '_TZE204_o3x45p96']), @@ -4908,10 +4863,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'v90ladg\u0000', manufacturerName: '_TYST11_wv90ladg'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_wv90ladg'}, - ], + fingerprint: [...tuya.fingerprint('v90ladg\u0000', ['_TYST11_wv90ladg']), ...tuya.fingerprint('TS0601', ['_TZE200_wv90ladg'])], model: 'HT-08', vendor: 'ETOP', description: 'Wall-mount thermostat', @@ -4948,10 +4900,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'dpplnsn\u0000', manufacturerName: '_TYST11_2dpplnsn'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_2dpplnsn'}, - ], + fingerprint: [...tuya.fingerprint('dpplnsn\u0000', ['_TYST11_2dpplnsn']), ...tuya.fingerprint('TS0601', ['_TZE200_2dpplnsn'])], model: 'HT-10', vendor: 'ETOP', description: 'Radiator valve', @@ -4990,18 +4939,13 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_a4bpgplm'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_dv8abrrz'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_z1tyspqw'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_bvrlmajk'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_a4bpgplm', '_TZE200_dv8abrrz', '_TZE200_z1tyspqw', '_TZE200_bvrlmajk']), model: 'TS0601_thermostat_1', vendor: 'Tuya', description: 'Thermostatic radiator valve', whiteLabel: [ tuya.whitelabel('id3', 'GTZ06', 'Thermostatic radiator valve', ['_TZE200_z1tyspqw']), - tuya.whitelabel('Avatto', 'TRV07', 'Thermostatic radiator valve', ['_TZE200_bvrlmajk']), + tuya.whitelabel('AVATTO', 'TRV07', 'Thermostatic radiator valve', ['_TZE200_bvrlmajk']), ], onEvent: tuya.onEventSetLocalTime, fromZigbee: [tuya.fz.datapoints], @@ -5070,7 +5014,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_rtrmfadk'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_rtrmfadk']), model: 'TRV601', vendor: 'Tuya', description: 'Thermostatic radiator valve.', @@ -5346,7 +5290,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE284_ymldrmzx'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE284_ymldrmzx']), model: 'TRV603-WZ', vendor: 'Tuya', description: 'Thermostatic radiator valve.', @@ -5491,7 +5435,7 @@ const definitions: DefinitionWithExtend[] = [ onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, false), }, { - fingerprint: [{modelID: 'TS0111', manufacturerName: '_TYZB01_ymcdbl3u'}], + fingerprint: tuya.fingerprint('TS0111', ['_TYZB01_ymcdbl3u']), model: 'TS0111_valve', vendor: 'Tuya', whiteLabel: [{vendor: 'Tuya', model: 'SM-AW713Z'}], @@ -5522,6 +5466,7 @@ const definitions: DefinitionWithExtend[] = [ tuya.whitelabel('Elivco', 'LSPA9', 'Smart plug (with power monitoring)', ['_TZ3000_okaz9tjs']), tuya.whitelabel('PSMART', 'T440', 'Smart wallsocket (with power monitoring)', ['_TZ3000_y4ona9me']), tuya.whitelabel('Nous', 'A6Z', 'Outdoor smart socket', ['_TZ3000_266azbg3']), + tuya.whitelabel('Nedis', 'ZBPO130FWT', 'Outdoor smart plug (with power monitoring)', ['_TZ3000_3ias4w4o']), ], ota: true, extend: [ @@ -5670,7 +5615,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Nous', 'E8', 'Smoke sensor', ['_TZE200_0zaf1cr8', '_TZE284_0zaf1cr8'])], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_ntcy3xu1'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ntcy3xu1']), model: 'TS0601_smoke_6', vendor: 'Tuya', description: 'Smoke sensor', @@ -5687,7 +5632,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE200_m9skfctm', '_TZE200_rccxox8p']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_m9skfctm', '_TZE200_rccxox8p', '_TZE284_rccxox8p']), model: 'PA-44Z', vendor: 'Tuya', description: 'Photoelectric smoke detector', @@ -5715,9 +5660,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_ux5v4dbd'}, // [KnockautX / Brelag AG, Switzerland](https://www.brelag.com) - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ux5v4dbd']), vendor: 'Tuya', model: 'TS0601_smoke_3', description: 'Photoelectric smoke detector', @@ -5817,7 +5760,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_5d3vhjro'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_5d3vhjro']), model: 'SA12IZL', vendor: 'Tuya', description: 'Smart smoke alarm', @@ -6330,11 +6273,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_byzdayie'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_fsb6zw01'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ewxhg6o9'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_byzdayie', '_TZE200_fsb6zw01', '_TZE200_ewxhg6o9']), model: 'TS0601_din', vendor: 'Tuya', description: 'Zigbee smart energy meter DDS238-2 Zigbee', @@ -6347,20 +6286,20 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.switch().setAccess('state', ea.STATE_SET), e.voltage(), e.power(), e.current(), e.energy()], }, { - fingerprint: [{modelID: 'TS1101', manufacturerName: '_TZ3000_xfs39dbf'}], + fingerprint: tuya.fingerprint('TS1101', ['_TZ3000_xfs39dbf']), model: 'TS1101_dimmer_module_1ch', vendor: 'Tuya', description: 'Zigbee dimmer module 1 channel', extend: [tuyaLight({minBrightness: 'attribute'})], }, { - fingerprint: [{modelID: 'TS1101', manufacturerName: '_TZ3000_7ysdnebc'}], + fingerprint: tuya.fingerprint('TS1101', ['_TZ3000_7ysdnebc']), model: 'TS1101_dimmer_module_2ch', vendor: 'Tuya', description: 'Zigbee dimmer module 2 channel', whiteLabel: [{vendor: 'OXT', model: 'SWTZ25'}], extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), tuyaLight({minBrightness: 'attribute', endpointNames: ['l1', 'l2'], configureReporting: true}), ], configure: async (device, coordinatorEndpoint) => { @@ -6433,7 +6372,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.humidity(), e.temperature(), e.battery()], }, { - fingerprint: [{modelID: 'TS0011', manufacturerName: '_TZ3000_l8fsgo6p'}], + fingerprint: tuya.fingerprint('TS0011', ['_TZ3000_l8fsgo6p']), zigbeeModel: ['TS0011'], model: 'TS0011', vendor: 'Tuya', @@ -6455,11 +6394,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0011', manufacturerName: '_TZ3000_qmi1cfuq'}, - {modelID: 'TS0011', manufacturerName: '_TZ3000_txpirhfq'}, - {modelID: 'TS0011', manufacturerName: '_TZ3000_ji4araar'}, - ], + fingerprint: tuya.fingerprint('TS0011', ['_TZ3000_qmi1cfuq', '_TZ3000_txpirhfq', '_TZ3000_ji4araar']), model: 'TS0011_switch_module', vendor: 'Tuya', description: '1 gang switch module - (without neutral)', @@ -6502,13 +6437,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0012', manufacturerName: '_TZ3000_jl7qyupf'}, - {modelID: 'TS0012', manufacturerName: '_TZ3000_nPGIPl5D'}, - {modelID: 'TS0012', manufacturerName: '_TZ3000_kpatq5pq'}, - {modelID: 'TS0012', manufacturerName: '_TZ3000_ljhbw1c9'}, - {modelID: 'TS0012', manufacturerName: '_TZ3000_4zf0crgo'}, - ], + fingerprint: tuya.fingerprint('TS0012', ['_TZ3000_jl7qyupf', '_TZ3000_nPGIPl5D', '_TZ3000_kpatq5pq', '_TZ3000_ljhbw1c9', '_TZ3000_4zf0crgo']), model: 'TS0012_switch_module', vendor: 'Tuya', description: '2 gang switch module - (without neutral)', @@ -6555,10 +6484,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0013', manufacturerName: '_TZ3000_ypgri8yz'}, - {modelID: 'TS0013', manufacturerName: '_TZ3000_sznawwyw'}, - ], + fingerprint: tuya.fingerprint('TS0013', ['_TZ3000_ypgri8yz', '_TZ3000_sznawwyw']), model: 'TS0013_switch_module', vendor: 'Tuya', description: '3 gang switch module - (without neutral)', @@ -6669,7 +6595,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [ tuya.whitelabel('Tuya', 'DS-111', 'Smart light switch - 4 gang with neutral wire', ['_TZ3000_mdj7kra9']), tuya.whitelabel('MHCOZY', 'TYWB 4ch-RF', '4 channel relay', ['_TZ3000_u3oupgdy', '_TZ3000_imaccztn']), - tuya.whitelabel('Avatto', 'TS0004_1', 'Smart light switch - 4 gang with neutral wire', ['_TZ3000_nivavasg', '_TZ3000_gexniqbq']), + tuya.whitelabel('AVATTO', 'TS0004_1', 'Smart light switch - 4 gang with neutral wire', ['_TZ3000_nivavasg', '_TZ3000_gexniqbq']), ], meta: {multiEndpoint: true}, configure: async (device, coordinatorEndpoint) => { @@ -6704,6 +6630,30 @@ const definitions: DefinitionWithExtend[] = [ } }, }, + { + fingerprint: tuya.fingerprint('TS0726', ['_TZ3002_rbnycsav']), + model: 'TS0726_3_gang', + vendor: 'Tuya', + description: '3 gang switch with neutral wire', + fromZigbee: [fz.on_off, tuya.fz.power_on_behavior_2, fz.ignore_basic_report, fzLocal.TS0726_action], + toZigbee: [tz.on_off, tuya.tz.power_on_behavior_2, tzLocal.TS0726_switch_mode], + exposes: [ + ...[1, 2, 3].map((ep) => e.switch().withEndpoint(`l${ep}`)), + ...[1, 2, 3].map((ep) => e.power_on_behavior().withEndpoint(`l${ep}`)), + ...[1, 2, 3].map((ep) => e.enum('switch_mode', ea.STATE_SET, ['switch', 'scene']).withEndpoint(`l${ep}`)), + e.action(['scene_1', 'scene_2', 'scene_3']), + ], + endpoint: (device) => { + return {l1: 1, l2: 2, l3: 3}; + }, + meta: {multiEndpoint: true}, + configure: async (device, coordinatorEndpoint) => { + await tuya.configureMagicPacket(device, coordinatorEndpoint); + for (const ep of [1, 2, 3]) { + await reporting.bind(device.getEndpoint(ep), coordinatorEndpoint, ['genOnOff']); + } + }, + }, { zigbeeModel: ['TS0726'], model: 'TS0726_4_gang', @@ -6729,7 +6679,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0726', manufacturerName: '_TZ3002_sal078g8'}], + fingerprint: tuya.fingerprint('TS0726', ['_TZ3002_sal078g8']), model: 'TS0726_switch_4g_2s', vendor: 'Tuya', description: 'COSWALL smart switch (4 gang + 2 scene)', @@ -6889,7 +6839,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_znzs7yaw'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_znzs7yaw']), model: 'HY08WE', vendor: 'Tuya', description: 'Wall-mount thermostat', @@ -6906,7 +6856,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_g9a3awaj'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_g9a3awaj']), model: 'ZWT07', vendor: 'Tuya', description: 'Wall-mount thermostat', @@ -6936,7 +6886,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_2ekuz3dz'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_2ekuz3dz']), model: 'X5H-GB-B', vendor: 'Tuya', description: 'Wall-mount thermostat', @@ -6998,10 +6948,10 @@ const definitions: DefinitionWithExtend[] = [ onEvent: tuya.onEventSetTime, }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE200_viy9ihs7', '_TZE204_lzriup1j', '_TZE204_xnbkhhdr']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_viy9ihs7', '_TZE204_lzriup1j', '_TZE204_xnbkhhdr', '_TZE284_xnbkhhdr']), model: 'ZWT198/ZWT100-BH', vendor: 'Tuya', - description: 'Avatto wall thermostat', + description: 'Wall thermostat', onEvent: tuya.onEvent({timeStart: '1970', respondToMcuVersionResponse: false}), fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], @@ -7065,10 +7015,10 @@ const definitions: DefinitionWithExtend[] = [ 'preset', tuya.valueConverterBasic.lookup((_, device) => { // https://github.com/Koenkk/zigbee2mqtt/issues/21353#issuecomment-1938328429 - if (device.manufacturerName === '_TZE200_viy9ihs7') { - return {auto: tuya.enum(0), manual: tuya.enum(1), temporary_manual: tuya.enum(2)}; - } else { + if (device.manufacturerName === '_TZE204_lzriup1j') { return {auto: tuya.enum(1), manual: tuya.enum(0), temporary_manual: tuya.enum(2)}; + } else { + return {auto: tuya.enum(0), manual: tuya.enum(1), temporary_manual: tuya.enum(2)}; } }), ], @@ -7190,45 +7140,46 @@ const definitions: DefinitionWithExtend[] = [ model: 'TS0222_temperature_humidity', vendor: 'Tuya', description: 'Temperature & humidity sensor', - fromZigbee: [fzLocal.TS0222_humidity, fz.battery, fz.temperature, fz.illuminance], + fromZigbee: [fzLocal.TS0222_humidity, fz.battery, fz.temperature], toZigbee: [], configure: tuya.configureMagicPacket, - exposes: [e.battery(), e.temperature(), e.humidity(), e.illuminance()], + exposes: [e.battery(), e.temperature(), e.humidity()], whiteLabel: [tuya.whitelabel('Tuya', 'QT-07S', 'Soil sensor', ['_TZE204_myd45weu'])], + extend: [m.illuminance()], }, { fingerprint: tuya.fingerprint('TS0222', ['_TZ3000_8uxxzz4b', '_TZ3000_hy6ncvmw', '_TZ3000_9kbbfeho', '_TZ3000_l6rsaipj']), model: 'TS0222_light', vendor: 'Tuya', description: 'Light sensor', - fromZigbee: [fz.battery, fz.illuminance], + fromZigbee: [fz.battery], toZigbee: [], configure: tuya.configureMagicPacket, whiteLabel: [tuya.whitelabel('Moes', 'ZSS-QT-LS-C', 'Light sensor', ['_TZ3000_9kbbfeho'])], - exposes: [e.battery(), e.illuminance()], + exposes: [e.battery()], + extend: [m.illuminance()], }, { fingerprint: tuya.fingerprint('TS0222', ['_TZ3000_t9qqxn70']), model: 'THE01860A', vendor: 'Tuya', description: 'Temp & humidity flower sensor with illuminance', - fromZigbee: [fz.humidity, fz.battery, fz.temperature, fz.illuminance], + fromZigbee: [fz.humidity, fz.battery, fz.temperature], toZigbee: [], configure: tuya.configureMagicPacket, - exposes: [e.battery(), e.temperature(), e.humidity(), e.illuminance()], + exposes: [e.battery(), e.temperature(), e.humidity()], + extend: [m.illuminance()], }, { - fingerprint: [ - {modelID: 'TS0222', manufacturerName: '_TYZB01_4mdqxxnn'}, - {modelID: 'TS0222', manufacturerName: '_TYZB01_m6ec2pgj'}, - ], + fingerprint: tuya.fingerprint('TS0222', ['_TYZB01_4mdqxxnn', '_TYZB01_m6ec2pgj', '_TZ3000_do6txrcw']), model: 'TS0222', vendor: 'Tuya', description: 'Light intensity sensor', - fromZigbee: [fz.battery, fz.illuminance, legacy.fromZigbee.TS0222], + fromZigbee: [fz.battery, legacy.fromZigbee.TS0222], toZigbee: [], - exposes: [e.battery(), e.illuminance()], + exposes: [e.battery()], configure: tuya.configureMagicPacket, + extend: [m.illuminance()], }, { zigbeeModel: ['TS0210'], @@ -7281,10 +7232,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS011F', manufacturerName: '_TZ3000_8bxrzyxz'}, - {modelID: 'TS011F', manufacturerName: '_TZ3000_ky0fq4ho'}, - ], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_8bxrzyxz', '_TZ3000_ky0fq4ho']), model: 'TS011F_din_smart_relay', description: 'Din smart relay (with power monitoring)', vendor: 'Tuya', @@ -7363,7 +7311,7 @@ const definitions: DefinitionWithExtend[] = [ onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, false), }, { - fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_7issjl2q'}], + fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_7issjl2q']), model: 'ATMS1601Z', description: 'Din smart relay (without power monitoring)', vendor: 'Tuya', @@ -7444,7 +7392,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_wfxuhoea'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_wfxuhoea']), model: 'GDC311ZBQ1', vendor: 'Tuya', description: 'LoraTap garage door opener with wireless sensor', @@ -7464,10 +7412,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS0603', manufacturerName: '_TZE608_c75zqghm'}, - {modelID: 'TS0603', manufacturerName: '_TZE608_fmemczv1'}, - ], + fingerprint: tuya.fingerprint('TS0603', ['_TZE608_c75zqghm', '_TZE608_fmemczv1']), model: 'TS0603', vendor: 'Tuya', meta: { @@ -7493,11 +7438,11 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_qaaysllp'}], + fingerprint: tuya.fingerprint('TS0201', ['_TZ3000_qaaysllp']), model: 'LCZ030', vendor: 'Tuya', description: 'Temperature & humidity & illuminance sensor with display', - fromZigbee: [fz.battery, fz.illuminance, fz.temperature, fz.humidity, fz.ts0201_temperature_humidity_alarm], + fromZigbee: [fz.battery, fz.temperature, fz.humidity, fz.ts0201_temperature_humidity_alarm], toZigbee: [tz.ts0201_temperature_humidity_alarm], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); @@ -7507,7 +7452,6 @@ const definitions: DefinitionWithExtend[] = [ 'genBasic', 'genPowerCfg', 'msTemperatureMeasurement', - 'msIlluminanceMeasurement', 'msRelativeHumidity', 'manuSpecificTuya_2', ]); @@ -7516,7 +7460,6 @@ const definitions: DefinitionWithExtend[] = [ e.temperature(), e.humidity(), e.battery(), - e.illuminance(), e .numeric('alarm_temperature_max', ea.STATE_SET) .withUnit('°C') @@ -7534,9 +7477,10 @@ const definitions: DefinitionWithExtend[] = [ e.enum('alarm_humidity', ea.STATE, ['below_min_humdity', 'over_humidity', 'off']).withDescription('Alarm humidity status'), e.enum('alarm_temperature', ea.STATE, ['below_min_temperature', 'over_temperature', 'off']).withDescription('Alarm temperature status'), ], + extend: [m.illuminance()], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_auin8mzr'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_auin8mzr']), model: 'TS0601_motion_sensor', vendor: 'Tuya', description: 'Human presence sensor AIR', @@ -7724,7 +7668,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_hkdl5fmv'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_hkdl5fmv']), model: 'TS0601_rcbo', vendor: 'Tuya', whiteLabel: [ @@ -7757,14 +7701,14 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS004F', manufacturerName: '_TZ3000_4fjiwweb'}, - {modelID: 'TS004F', manufacturerName: '_TZ3000_uri7ongn'}, - {modelID: 'TS004F', manufacturerName: '_TZ3000_ixla93vd'}, - {modelID: 'TS004F', manufacturerName: '_TZ3000_qja6nq5z'}, - {modelID: 'TS004F', manufacturerName: '_TZ3000_abrsvsou'}, - {modelID: 'TS004F', manufacturerName: '_TZ3000_402vrq2i'}, - ], + fingerprint: tuya.fingerprint('TS004F', [ + '_TZ3000_4fjiwweb', + '_TZ3000_uri7ongn', + '_TZ3000_ixla93vd', + '_TZ3000_qja6nq5z', + '_TZ3000_abrsvsou', + '_TZ3000_402vrq2i', + ]), model: 'ERS-10TZBVK-AA', vendor: 'Tuya', description: 'Smart knob', @@ -7820,7 +7764,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_kzm5w4iz'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_kzm5w4iz']), model: 'TS0601_vibration_sensor', vendor: 'Tuya', description: 'Smart vibration sensor', @@ -7829,11 +7773,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.contact(), e.battery(), e.vibration()], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_yi4jtqq1'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_khx7nnka'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_khx7nnka'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_yi4jtqq1', '_TZE200_khx7nnka', '_TZE204_khx7nnka']), model: 'XFY-CGQ-ZIGB', vendor: 'Tuya', description: 'Illuminance sensor', @@ -7842,10 +7782,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.illuminance(), e.brightness_state()], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_kltffuzl'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_fwoorn8y'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_kltffuzl', '_TZE200_fwoorn8y']), model: 'TM001-ZA/TM081', vendor: 'Tuya', description: 'Door and window sensor', @@ -7854,7 +7791,7 @@ const definitions: DefinitionWithExtend[] = [ exposes: [e.contact(), e.battery()], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_2m38mh6k'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_2m38mh6k']), model: 'SS9600ZB', vendor: 'Tuya', description: '6 gang remote', @@ -7898,7 +7835,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Tuya', description: 'Zigbee dimmer module 2 channel', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), tuyaLight({powerOnBehavior: true, configureReporting: true, switchType: true, minBrightness: 'attribute', endpointNames: ['l1', 'l2']}), ], configure: async (device, coordinatorEndpoint) => { @@ -7906,20 +7843,20 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_ikvncluo'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_lyetpprm'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_jva8ink8'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_xpq2rzhq'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_holel4dk'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_xpq2rzhq'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_wukb7rhc'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_xsm7l9xa'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_ztc6ggyl'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ztc6ggyl'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_sgpeacqp'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_fwondbzy'}, - ], + fingerprint: tuya.fingerprint('TS0601', [ + '_TZE200_ikvncluo', + '_TZE200_lyetpprm', + '_TZE200_jva8ink8', + '_TZE204_xpq2rzhq', + '_TZE200_holel4dk', + '_TZE200_xpq2rzhq', + '_TZE200_wukb7rhc', + '_TZE204_xsm7l9xa', + '_TZE204_ztc6ggyl', + '_TZE200_ztc6ggyl', + '_TZE200_sgpeacqp', + '_TZE204_fwondbzy', + ]), model: 'TS0601_smart_human_presence_sensor_1', vendor: 'Tuya', description: 'Smart Human presence sensor', @@ -7963,11 +7900,11 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE284_atuj3i0w'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE284_atuj3i0w']), model: 'M8Pro', vendor: 'Tuya', description: '4 gang switch with LCD', - extend: [tuyaBase({dp: true}), deviceEndpoints({endpoints: {l1: 1, l2: 1, l3: 1, l4: 1}})], + extend: [tuyaBase({dp: true}), m.deviceEndpoints({endpoints: {l1: 1, l2: 1, l3: 1, l4: 1}})], exposes: [ tuya.exposes.switch().withEndpoint('l1'), tuya.exposes.switch().withEndpoint('l2'), @@ -8117,7 +8054,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('iHseno', 'TY_24G_Sensor_V2', 'Human presence sensor 24G', ['_TZE204_ztqnh5cg'])], }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE204_laokfqwu']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_laokfqwu', '_TZE200_clrdrnya']), model: 'WZ-M100', vendor: 'Wenzhi', description: 'Human presence sensor', @@ -8289,7 +8226,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_whkgqxse'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_whkgqxse']), model: 'JM-TRH-ZGB-V1', vendor: 'Tuya', description: 'Temperature & humidity sensor with clock', @@ -8321,7 +8258,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_zyrdrmno'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_zyrdrmno']), model: 'ZB-Sm', vendor: 'Tuya', description: 'Tubular motor', @@ -8369,7 +8306,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_itnrsufe'}], + fingerprint: tuya.fingerprint('TS0201', ['_TZ3000_itnrsufe']), model: 'KCTW1Z', vendor: 'Tuya', description: 'Temperature & humidity sensor with LCD', @@ -8391,11 +8328,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_0u3bj3rc'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_v6ossqfy'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_mx6u6l4y'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_0u3bj3rc', '_TZE200_v6ossqfy', '_TZE200_mx6u6l4y']), model: 'TS0601_human_presence_sensor', vendor: 'Tuya', description: 'Human presence sensor Zigbee', @@ -8433,7 +8366,7 @@ const definitions: DefinitionWithExtend[] = [ tuyaDatapoints: [ [1, 'temperature', tuya.valueConverter.divideBy10], [2, 'humidity', tuya.valueConverter.raw], - [4, 'battery', tuya.valueConverter.divideBy2], + [4, 'battery', tuya.valueConverter.raw], [9, 'temperature_unit', tuya.valueConverter.temperatureUnit], [23, 'temperature_calibration', tuya.valueConverter.divideBy10], [24, 'humidity_calibration', tuya.valueConverter.raw], @@ -8608,10 +8541,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_8isdky6j'}, - {modelID: 'TS0225', manufacturerName: '_TZE200_p6fuhvez'}, - ], + fingerprint: [...tuya.fingerprint('TS0601', ['_TZE200_8isdky6j']), ...tuya.fingerprint('TS0225', ['_TZE200_p6fuhvez'])], model: 'ZG-225Z', vendor: 'Tuya', description: 'Gas sensor', @@ -8693,7 +8623,7 @@ const definitions: DefinitionWithExtend[] = [ .withValueStep(0.01) .withUnit('m') .withDescription('Motion detection distance'), - e.enum('motion_state', ea.STATE, ['none', 'small', 'medium', 'large']).withDescription('State of the motion'), + e.enum('motion_state', ea.STATE, ['none', 'small', 'medium', 'large', 'huge', 'gigantic']).withDescription('State of the motion'), e .numeric('fading_time', ea.STATE_SET) .withValueMin(0) @@ -8739,7 +8669,14 @@ const definitions: DefinitionWithExtend[] = [ [ 101, 'motion_state', - tuya.valueConverterBasic.lookup({none: tuya.enum(0), large: tuya.enum(1), medium: tuya.enum(2), small: tuya.enum(3)}), + tuya.valueConverterBasic.lookup({ + none: tuya.enum(0), + large: tuya.enum(1), + medium: tuya.enum(2), + small: tuya.enum(3), + huge: tuya.enum(4), + gigantic: tuya.enum(5), + }), ], [102, 'fading_time', tuya.valueConverter.raw], [104, 'medium_motion_detection_distance', tuya.valueConverter.divideBy100], @@ -8849,7 +8786,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'TS110E_1gang_1', vendor: 'Tuya', description: '1 channel dimmer', - extend: [light({powerOnBehavior: false, configureReporting: true})], + extend: [m.light({powerOnBehavior: false, configureReporting: true})], fromZigbee: [tuya.fz.power_on_behavior_1, fz.TS110E_switch_type, fz.TS110E, fz.on_off], toZigbee: [tz.TS110E_light_onoff_brightness, tuya.tz.power_on_behavior_1, tz.TS110E_options], exposes: [e.power_on_behavior(), tuya.exposes.switchType(), e.min_brightness(), e.max_brightness()], @@ -8896,13 +8833,13 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS110E', manufacturerName: '_TZ3210_wdexaypg'}], + fingerprint: tuya.fingerprint('TS110E', ['_TZ3210_wdexaypg']), model: 'TS110E_2gang_1', vendor: 'Tuya', description: '2 channel dimmer', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), - light({powerOnBehavior: false, endpointNames: ['l1', 'l2'], configureReporting: true}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.light({powerOnBehavior: false, endpointNames: ['l1', 'l2'], configureReporting: true}), ], fromZigbee: [tuya.fz.power_on_behavior_1, fz.TS110E_switch_type, fz.TS110E], toZigbee: [tz.TS110E_light_onoff_brightness, tuya.tz.power_on_behavior_1, tz.TS110E_options], @@ -9195,7 +9132,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.temperature, fzLocal.TS011F_threshold], toZigbee: [tzLocal.TS011F_threshold], exposes: (device, options) => { - const exposes: Expose[] = [e.linkquality()]; + const exposes: Expose[] = []; if (!['_TZ3000_303avxxt', '_TZ3000_zjchz7pd'].includes(device?.manufacturerName)) { exposes.push( e.temperature(), @@ -9296,10 +9233,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0001', manufacturerName: '_TZ3000_bmqxalil'}, - {modelID: 'TS0001', manufacturerName: '_TZ3000_w1tcofu8'}, - ], + fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_bmqxalil', '_TZ3000_w1tcofu8']), model: 'TS0001_switch_1_gang', vendor: 'Tuya', description: '1-Gang switch with backlight', @@ -9314,12 +9248,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS0003', manufacturerName: '_TZ3000_pv4puuxi'}, - {modelID: 'TS0003', manufacturerName: '_TZ3000_avky2mvc'}, - {modelID: 'TS0003', manufacturerName: '_TZ3000_785olaiq'}, - {modelID: 'TS0003', manufacturerName: '_TZ3000_qxcnwv26'}, - ], + fingerprint: tuya.fingerprint('TS0003', ['_TZ3000_pv4puuxi', '_TZ3000_avky2mvc', '_TZ3000_785olaiq', '_TZ3000_qxcnwv26']), model: 'TS0003_switch_3_gang', vendor: 'Tuya', description: '3-Gang switch with backlight', @@ -9342,7 +9271,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_hewlydpz'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_hewlydpz']), model: 'TS0601_switch_4_gang_2', vendor: 'Tuya', description: '4 gang switch with backlight', @@ -9372,7 +9301,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Homeetec', '37022714', '4 Gang switch with backlight', ['_TZE200_hewlydpz'])], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_p6vz3wzt'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_p6vz3wzt']), model: 'TS0601_cover_5', vendor: 'Tuya', description: 'Curtain/blind switch', @@ -9425,7 +9354,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_jhkttplm'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_jhkttplm']), model: 'TS0601_cover_with_1_switch', vendor: 'Tuya', description: 'Curtain/blind switch with 1 Gang switch', @@ -9458,7 +9387,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Homeetec', '37022493', 'Curtain/blind switch with 1 Gang switch', ['_TZE200_jhkttplm'])], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_5nldle7w'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_5nldle7w']), model: 'TS0601_cover_with_2_switch', vendor: 'Tuya', description: 'Curtain/blind switch with 2 Gang switch', @@ -9493,7 +9422,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('Homeetec', '37022173', 'Curtain/blind switch with 2 Gang switch', ['_TZE200_5nldle7w'])], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_bcusnqt8'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_bcusnqt8']), model: 'SPM01', vendor: 'Tuya', description: 'Smart energy monitor for 1P+N system', @@ -9533,10 +9462,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE204_ves1ycwx'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ves1ycwx'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_ves1ycwx', '_TZE200_ves1ycwx']), model: 'SPM02', vendor: 'Tuya', description: 'Smart energy monitor for 3P+N system', @@ -9569,10 +9495,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_qhlxve78'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_qhlxve78'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_qhlxve78', '_TZE204_qhlxve78']), model: 'SPM01V2', vendor: 'Tuya', description: 'Smart energy monitor for 1P+N system', @@ -9603,10 +9526,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE204_v9hkz2yn'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_v9hkz2yn'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_v9hkz2yn', '_TZE200_v9hkz2yn']), model: 'SPM02V2', vendor: 'Tuya', description: 'Smart energy monitor for 3P+N system', @@ -9652,10 +9572,100 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_iwn0gpzz'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_iwn0gpzz'}, + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_dhotiauw']), + model: '2CT', + vendor: 'Tuya', + description: 'Bidirectional energy meter with 80A current clamp', + extend: [tuyaBase({dp: true})], + exposes: [ + e.ac_frequency(), + e.voltage(), + tuya.exposes.powerWithPhase('a'), + tuya.exposes.powerWithPhase('b'), + tuya.exposes.currentWithPhase('a'), + tuya.exposes.currentWithPhase('b'), + tuya.exposes.powerFactorWithPhase('a'), + tuya.exposes.powerFactorWithPhase('b'), + tuya.exposes.energyWithPhase('a'), + tuya.exposes.energyWithPhase('b'), + e + .numeric('update_frequency', ea.STATE_SET) + .withUnit('s') + .withDescription('Update frequency') + .withValueMin(3) + .withValueMax(60) + .withPreset('default', 10, 'Default value'), + e.numeric('timestamp_a', ea.STATE).withDescription('Timestamp at power measure (phase a)'), + e.numeric('timestamp_b', ea.STATE).withDescription('Timestamp at power measure (phase b)'), + e + .numeric('calibration_ac_frequency', ea.STATE_SET) + .withDescription('Calibration AC frequency') + .withValueMin(0.5) + .withValueMax(1.5) + .withValueStep(0.01) + .withPreset('default', 1.0, 'Default value'), + e + .numeric('calibration_voltage', ea.STATE_SET) + .withDescription('Calibration voltage') + .withValueMin(0.5) + .withValueMax(1.5) + .withValueStep(0.01) + .withPreset('default', 1.0, 'Default value'), + e + .numeric('calibration_power_a', ea.STATE_SET) + .withDescription('Calibration power A') + .withValueMin(0.5) + .withValueMax(1.5) + .withValueStep(0.01) + .withPreset('default', 1.0, 'Default value'), + e + .numeric('calibration_current_a', ea.STATE_SET) + .withDescription('Calibration current A') + .withValueMin(0.5) + .withValueMax(1.5) + .withValueStep(0.01) + .withPreset('default', 1.0, 'Default value'), + e + .numeric('calibration_power_b', ea.STATE_SET) + .withDescription('Calibration power B') + .withValueMin(0.5) + .withValueMax(1.5) + .withValueStep(0.01) + .withPreset('default', 1.0, 'Default value'), + e + .numeric('calibration_current_b', ea.STATE_SET) + .withDescription('Calibration current B') + .withValueMin(0.5) + .withValueMax(1.5) + .withValueStep(0.01) + .withPreset('default', 1.0, 'Default value'), ], + meta: { + multiEndpointSkip: ['power_factor', 'power_factor_phase_a', 'power_factor_phase_b', 'energy'], + tuyaDatapoints: [ + [105, 'ac_frequency', tuya.valueConverter.divideBy100], + [103, 'power_a', tuya.valueConverter.divideBy10], + [104, 'power_b', tuya.valueConverter.divideBy10], + [19, 'power', tuya.valueConverter.divideBy10], + [20, 'voltage', tuya.valueConverter.divideBy10], + [101, 'current_a', tuya.valueConverter.divideBy1000], + [102, 'current_b', tuya.valueConverter.divideBy1000], + [120, 'power_factor_a', tuya.valueConverter.raw], + [121, 'power_factor_b', tuya.valueConverter.raw], + [115, 'energy_a', tuya.valueConverter.divideBy100], + [117, 'energy_b', tuya.valueConverter.divideBy100], + [122, 'update_frequency', tuya.valueConverter.raw], + [123, 'calibration_voltage', tuya.valueConverter.divideBy1000], + [125, 'calibration_current_a', tuya.valueConverter.divideBy1000], + [126, 'calibration_power_a', tuya.valueConverter.divideBy1000], + [130, 'calibration_current_b', tuya.valueConverter.divideBy1000], + [131, 'calibration_power_b', tuya.valueConverter.divideBy1000], + [124, 'calibration_ac_frequency', tuya.valueConverter.divideBy1000], + ], + }, + }, + { + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_iwn0gpzz', '_TZE204_iwn0gpzz', '_TZE284_iwn0gpzz']), model: 'SPM01V2.5', vendor: 'Tuya', description: 'Smart energy monitor for 1P+N system', @@ -9684,10 +9694,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE204_ny94onlb'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_ny94onlb'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_ny94onlb', '_TZE200_ny94onlb', '_TZE284_ny94onlb']), model: 'SPM02V2.5', vendor: 'Tuya', description: 'Smart energy monitor for 3P+N system', @@ -9730,10 +9737,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_dikb3dp6'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_dikb3dp6'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_dikb3dp6', '_TZE204_dikb3dp6']), model: 'SPM02V3', vendor: 'Tuya', description: 'Smart energy monitor for 3P+N system', @@ -9856,10 +9860,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE204_gomuk3dc'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_gomuk3dc'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_gomuk3dc', '_TZE200_gomuk3dc']), model: 'SDM01V1.5', vendor: 'Tuya', description: 'Smart energy monitor for 3P+N system', @@ -9920,10 +9921,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE204_78ioiaml'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_78ioiaml'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_78ioiaml', '_TZE200_78ioiaml']), model: 'SDM02V1', vendor: 'Tuya', description: 'Smart energy monitor for 2P+N system', @@ -9998,15 +9996,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_vmcgja59'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_dvosyycn'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_wktrysab'}, - { - modelID: 'TS0601', - manufacturerName: '_TZE204_wktrysab', - }, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_vmcgja59', '_TZE204_dvosyycn', '_TZE200_wktrysab', '_TZE204_wktrysab']), model: 'TS0601_switch_8', vendor: 'Tuya', description: 'ZYXH 8 gang switch', @@ -10041,7 +10031,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_adlblwab'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_adlblwab']), model: 'TS0601_switch_8_2', vendor: 'Tuya', description: '8 gang switch', @@ -10223,7 +10213,7 @@ const definitions: DefinitionWithExtend[] = [ description: 'Motion sensor', fromZigbee: [fz.ias_occupancy_alarm_1_with_timeout, fz.battery], toZigbee: [], - exposes: [e.occupancy(), e.battery_low(), e.linkquality(), e.battery(), e.battery_voltage()], + exposes: [e.occupancy(), e.battery_low(), e.battery(), e.battery_voltage()], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']); @@ -10310,7 +10300,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_0j5jma9b'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_0j5jma9b', '_TZE200_h2rctifa']), model: 'ZS-TYG3-SM-61Z', vendor: 'Tuya', description: 'Smart switch (4 gang + 2 scene) with backlight and neutral wire', @@ -10360,7 +10350,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_wunufsil'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_wunufsil']), model: 'ZS-TYG3-SM-21Z', vendor: 'Tuya', description: '2 gang smart switch with backlight and neutral wire', @@ -10394,7 +10384,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vhy3iakz'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_vhy3iakz']), model: 'ZS-TYG3-SM-31Z', vendor: 'Tuya', description: '3 gang smart switch with backlight and neutral wire', @@ -10432,7 +10422,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_k6jhsr0q'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_k6jhsr0q']), model: 'ZS-TYG3-SM-41Z', vendor: 'Tuya', description: '4 gang smart switch with backlight and neutral wire', @@ -11196,7 +11186,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE204_81yrt3lo']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_81yrt3lo', '_TZE284_81yrt3lo']), model: 'PJ-1203A', vendor: 'Tuya', description: 'Bidirectional energy meter with 80A current clamp', @@ -11665,7 +11655,7 @@ const definitions: DefinitionWithExtend[] = [ tuya.modernExtend.dpAction({dp: 26, lookup: {sos: 0}}), tuya.modernExtend.dpAction({dp: 29, lookup: {emergency: 0}}), ]), - iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['battery_low']}), + m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['battery_low']}), ], }, { @@ -11734,23 +11724,23 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [tuya.whitelabel('AVATTO', 'ZWSM16-4-Zigbee', '4 gang switch module', ['_TZ3000_5ajpkyq6'])], }, { - fingerprint: [{modelID: 'TS1002', manufacturerName: '_TZ3000_etufnltx'}], + fingerprint: tuya.fingerprint('TS1002', ['_TZ3000_etufnltx']), model: 'F00XN00-04-1', vendor: 'FORIA', description: 'Dimmer 4 scenes', extend: [ tuya.modernExtend.tuyaMagicPacket(), - battery({voltage: true}), + m.battery({voltage: true}), tuya.modernExtend.combineActions([ - actionEnumLookup({ + m.actionEnumLookup({ actionLookup: {scene_1: 1, scene_2: 2, scene_3: 3, scene_4: 4}, cluster: 'genOnOff', commands: ['commandTuyaAction'], attribute: 'data', parse: (msg, attr) => msg.data[attr][1], }), - commandsOnOff(), - commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop']}), + m.commandsOnOff(), + m.commandsLevelCtrl({commands: ['brightness_move_up', 'brightness_move_down', 'brightness_stop']}), ]), ], }, @@ -11949,7 +11939,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'SZT06 V2.0', vendor: 'Tuya', description: 'Smart mini temperature and humidity sensor', - extend: [temperature(), humidity(), identify({isSleepy: true}), battery({voltage: true})], + extend: [m.temperature(), m.humidity(), m.identify({isSleepy: true}), m.battery({voltage: true})], }, { fingerprint: tuya.fingerprint('TS0601', ['_TZE200_pl31aqf5']), @@ -12044,7 +12034,7 @@ const definitions: DefinitionWithExtend[] = [ whiteLabel: [{vendor: 'ELECTSMART', model: 'EST-120Z'}], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_tagezcph'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_tagezcph']), model: 'PRO-900Z', vendor: 'ElectSmart', description: 'Thermostat for electric floor', @@ -12062,7 +12052,6 @@ const definitions: DefinitionWithExtend[] = [ .withValueStep(1) .withUnit('°C') .withDescription('Max temperature in ECO mode. Default: 20'), - e.binary('valve_state', ea.STATE, false, true).withLabel('Heating in process'), e .climate() .withSystemMode(['off', 'heat'], ea.STATE_SET) @@ -12070,7 +12059,8 @@ const definitions: DefinitionWithExtend[] = [ .withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET) .withLocalTemperature(ea.STATE) .withLocalTemperatureCalibration(-9, 9, 1, ea.STATE_SET) - .withDescription('Default: -3'), + .withDescription('Default: -3') + .withRunningState(['idle', 'heat'], ea.STATE), e .numeric('deadzone_temperature', ea.STATE_SET) .withValueMin(1) @@ -12162,7 +12152,7 @@ const definitions: DefinitionWithExtend[] = [ [26, 'min_temperature', tuya.valueConverter.divideBy10], [27, 'local_temperature_calibration', tuya.valueConverter.raw], [28, 'factory_reset', tuya.valueConverterBasic.lookup({factory_reset: true})], - [36, 'valve_state', tuya.valueConverter.trueFalseInvert], + [36, 'running_state', tuya.valueConverterBasic.lookup({idle: tuya.enum(1), heat: tuya.enum(0)})], [39, 'child_lock', tuya.valueConverterBasic.lookup({ON: true, OFF: false})], [40, 'eco_mode', tuya.valueConverterBasic.lookup({ON: true, OFF: false})], [43, 'sensor', tuya.valueConverterBasic.lookup({IN: tuya.enum(0), OU: tuya.enum(2), AL: tuya.enum(1)})], @@ -12333,14 +12323,14 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: tuya.fingerprint('TS0601', ['_TZE204_q22avxbv', '_TZE204_mrffaamu']), + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_q22avxbv', '_TZE204_mrffaamu', '_TZE204_tzreobvu']), model: 'TOQCB2-80', vendor: 'Tuya', description: 'Smart circuit breaker', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], - // Important: respondToMcuVersionResponse should be false otherweise there are an avalanche of commandMcuVersionResponse messages every second. - // queryIntervalSeconds: is doing a pooling to update device's parameters, now define to update data every 3 minutes. + // Important: respondToMcuVersionResponse should be false otherwise there is an avalanche of commandMcuVersionResponse messages every second. + // queryIntervalSeconds: is doing a pooling to update the device's parameters, now defined to update data every 3 minutes. onEvent: tuya.onEvent({respondToMcuVersionResponse: false, queryIntervalSeconds: 3 * 60}), configure: tuya.configureMagicPacket, exposes: [ @@ -12621,7 +12611,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_ncti2pro'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_ncti2pro']), model: 'PN6', vendor: 'ZSVIOT', description: '6-way controller', @@ -12666,9 +12656,9 @@ const definitions: DefinitionWithExtend[] = [ { zigbeeModel: ['TS0105'], model: 'TS0105', - vendor: 'TuYa', + vendor: 'Tuya', description: '3 gang switch', - extend: [tuyaBase({dp: true}), deviceEndpoints({endpoints: {l1: 1, l2: 1, l3: 1}})], + extend: [tuyaBase({dp: true}), m.deviceEndpoints({endpoints: {l1: 1, l2: 1, l3: 1}})], exposes: [ e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET), e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET), @@ -12712,10 +12702,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE204_fhvdgeuh'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_abatw3kj'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_fhvdgeuh', '_TZE200_abatw3kj']), model: 'TS0601_din_4', vendor: 'Tuya', description: 'Din rail switch with power monitoring and threshold settings', @@ -12763,7 +12750,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_hcxvyxa5'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_hcxvyxa5']), model: 'ZA03', vendor: 'Tuya', description: 'Siren alarm', @@ -12965,7 +12952,7 @@ const definitions: DefinitionWithExtend[] = [ { fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ha0vwoew']), model: 'TS0601_thermostat_thermosphere', - vendor: 'TuYa', + vendor: 'Tuya', description: 'ThermoSphere thermostat', extend: [tuyaBase({dp: true})], exposes: [ @@ -13989,6 +13976,72 @@ const definitions: DefinitionWithExtend[] = [ ], }, }, + { + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_wem3gxyx']), + model: 'AE-940K', + vendor: 'ACMELEC', + description: 'Compatible with Daikin vrv system', + fromZigbee: [tuya.fz.datapoints], + toZigbee: [tuya.tz.datapoints], + onEvent: tuya.onEventSetTime, + configure: tuya.configureMagicPacket, + exposes: [ + e.binary('state', ea.STATE_SET, 'ON', 'OFF').withDescription('Turn the thermostat ON/OFF'), + e + .climate() + .withSystemMode(['cool', 'heat', 'fan_only', 'dry'], ea.STATE_SET) + .withSetpoint('current_heating_setpoint', 16, 32, 1, ea.STATE_SET) + .withFanMode(['low', 'medium', 'high', 'auto'], ea.STATE_SET) + .withLocalTemperature(ea.STATE), + e.child_lock(), + ], + meta: { + tuyaDatapoints: [ + [1, 'state', tuya.valueConverter.onOff], + [ + 2, + 'system_mode', + tuya.valueConverterBasic.lookup({cool: tuya.enum(0), heat: tuya.enum(1), fan_only: tuya.enum(2), dry: tuya.enum(3)}), + ], + [16, 'current_heating_setpoint', tuya.valueConverter.raw], + [28, 'fan_mode', tuya.valueConverterBasic.lookup({low: tuya.enum(0), medium: tuya.enum(1), high: tuya.enum(2), auto: tuya.enum(3)})], + [40, 'child_lock', tuya.valueConverter.lockUnlock], + ], + }, + }, + { + fingerprint: tuya.fingerprint('TS0601', ['_TZE204_mul9abs3']), + model: 'AE-669K', + vendor: 'ACMELEC', + description: 'Compatible with Mitsubishi Electric vrf system', + fromZigbee: [tuya.fz.datapoints], + toZigbee: [tuya.tz.datapoints], + onEvent: tuya.onEventSetTime, + configure: tuya.configureMagicPacket, + exposes: [ + e.binary('state', ea.STATE_SET, 'ON', 'OFF').withDescription('Turn the thermostat ON/OFF'), + e + .climate() + .withSystemMode(['cool', 'heat', 'fan_only', 'dry'], ea.STATE_SET) + .withSetpoint('current_heating_setpoint', 16, 32, 1, ea.STATE_SET) + .withFanMode(['low', 'medium', 'high', 'auto'], ea.STATE_SET) + .withLocalTemperature(ea.STATE), + e.child_lock(), + ], + meta: { + tuyaDatapoints: [ + [1, 'state', tuya.valueConverter.onOff], + [ + 2, + 'system_mode', + tuya.valueConverterBasic.lookup({cool: tuya.enum(0), heat: tuya.enum(1), fan_only: tuya.enum(2), dry: tuya.enum(3)}), + ], + [16, 'current_heating_setpoint', tuya.valueConverter.raw], + [28, 'fan_mode', tuya.valueConverterBasic.lookup({low: tuya.enum(0), medium: tuya.enum(1), high: tuya.enum(2), auto: tuya.enum(3)})], + [40, 'child_lock', tuya.valueConverter.lockUnlock], + ], + }, + }, ]; export default definitions; diff --git a/src/devices/ubisys.ts b/src/devices/ubisys.ts index ddfd842269997..537a5ed0af54d 100644 --- a/src/devices/ubisys.ts +++ b/src/devices/ubisys.ts @@ -8,7 +8,7 @@ import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; //import * as legacy from '../lib/legacy'; import {logger} from '../lib/logger'; -import {commandsColorCtrl, commandsLevelCtrl, commandsOnOff, deviceEndpoints, electricityMeter, identify, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend, Fz, KeyValue, KeyValueAny, OnEventData, OnEventType, Tz, Zh} from '../lib/types'; import {ubisysModernExtend} from '../lib/ubisys'; @@ -754,13 +754,13 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Ubisys', description: 'Power switch S1-R (Series 2)', extend: [ - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '232': 232}, multiEndpointSkip: ['state', 'power', 'energy']}), - identify(), - onOff({powerOnBehavior: false}), - electricityMeter({cluster: 'metering', configureReporting: false}), - commandsOnOff({endpointNames: ['2', '3']}), - commandsLevelCtrl({endpointNames: ['2', '3']}), - commandsColorCtrl({endpointNames: ['2', '3']}), + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '232': 232}, multiEndpointSkip: ['state', 'power', 'energy']}), + m.identify(), + m.onOff({powerOnBehavior: false}), + m.electricityMeter({cluster: 'metering', configureReporting: false}), + m.commandsOnOff({endpointNames: ['2', '3']}), + m.commandsLevelCtrl({endpointNames: ['2', '3']}), + m.commandsColorCtrl({endpointNames: ['2', '3']}), ], options: [exposes.options.measurement_poll_interval()], configure: async (device, coordinatorEndpoint) => { @@ -1081,7 +1081,7 @@ const definitions: DefinitionWithExtend[] = [ coverExpose.withPosition().withTilt(); break; } - return [coverExpose, e.power().withAccess(ea.STATE_GET), e.energy().withAccess(ea.STATE_GET), e.linkquality()]; + return [coverExpose, e.power().withAccess(ea.STATE_GET), e.energy().withAccess(ea.STATE_GET)]; }, extend: [ubisysModernExtend.addCustomClusterManuSpecificUbisysDeviceSetup(), ubisysModernExtend.addCustomClusterClosuresWindowCovering()], configure: async (device, coordinatorEndpoint) => { @@ -1284,6 +1284,16 @@ const definitions: DefinitionWithExtend[] = [ ], endpoint: (device) => { return { + th1: 1, + th2: 2, + th3: 3, + th4: 4, + th5: 5, + th6: 6, + th7: 7, + th8: 8, + th9: 9, + th10: 10, l1: 11, l2: 12, l3: 13, @@ -1308,9 +1318,102 @@ const definitions: DefinitionWithExtend[] = [ e.switch().withEndpoint('l8'), e.switch().withEndpoint('l9'), e.switch().withEndpoint('l10'), + e + .climate() + .withEndpoint('th1') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th2') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th3') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th4') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th5') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th6') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th7') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th8') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th9') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), + e + .climate() + .withEndpoint('th10') + .withSystemMode(['off', 'heat'], ea.ALL) + .withRunningMode(['off', 'heat']) + .withSetpoint('occupied_heating_setpoint', 7, 30, 0.5) + .withLocalTemperature() + .withPiHeatingDemand(ea.STATE_GET), ], extend: [ubisysModernExtend.addCustomClusterHvacThermostat(), ubisysModernExtend.addCustomClusterGenLevelCtrl()], configure: async (device, coordinatorEndpoint) => { + // setup ep 1-10 as thermostats + // NOTE: doesn't look like fz/tz.thermostat and friends support + // multiEndpoint + const thermostatBinds = ['hvacThermostat']; + for (let ep = 1; ep <= 10; ep++) { + const endpoint = device.getEndpoint(ep); + await reporting.bind(endpoint, coordinatorEndpoint, thermostatBinds); + await reporting.thermostatSystemMode(endpoint); + await reporting.thermostatTemperature(endpoint, {min: 0, max: constants.repInterval.HOUR, change: 50}); + await reporting.thermostatOccupiedHeatingSetpoint(endpoint, {min: 0, max: constants.repInterval.HOUR, change: 50}); + await reporting.thermostatPIHeatingDemand(endpoint, {min: 15, max: constants.repInterval.HOUR, change: 1}); + } + // setup ep 11-20 as on/off switches const heaterCoolerBinds = ['genOnOff']; for (let ep = 11; ep <= 20; ep++) { diff --git a/src/devices/vbled.ts b/src/devices/vbled.ts index e315ffabca0c5..f7ff453357f9d 100644 --- a/src/devices/vbled.ts +++ b/src/devices/vbled.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: '43023', vendor: 'VBLED', description: 'ZigBee AC phase-cut dimmer', - extend: [light({configureReporting: true})], + extend: [m.light({configureReporting: true})], }, ]; diff --git a/src/devices/vesternet.ts b/src/devices/vesternet.ts index 8a791667d82ce..79ec6d99189ab 100644 --- a/src/devices/vesternet.ts +++ b/src/devices/vesternet.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {electricityMeter, light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -17,8 +17,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Vesternet', description: 'Zigbee dimmer', extend: [ - light({configureReporting: true, levelConfig: {disabledFeatures: ['on_transition_time', 'off_transition_time']}}), - electricityMeter(), + m.light({configureReporting: true, levelConfig: {disabledFeatures: ['on_transition_time', 'off_transition_time']}}), + m.electricityMeter(), ], whiteLabel: [{vendor: 'Sunricher', model: 'SR-ZG9040A'}], }, diff --git a/src/devices/villeroy_boch.ts b/src/devices/villeroy_boch.ts index f6cb82fe6f5a9..c933bde524a54 100644 --- a/src/devices/villeroy_boch.ts +++ b/src/devices/villeroy_boch.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,14 +7,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'C5850000', vendor: 'Villeroy & Boch', description: 'Subway 3.0 Zigbee home automation kit', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, { zigbeeModel: ['EC1300'], model: 'C0040000', vendor: 'Villeroy & Boch', description: 'Zigbee home automation kit for mirror', - extend: [light({colorTemp: {range: [160, 450]}})], + extend: [m.light({colorTemp: {range: [160, 450]}})], }, ]; diff --git a/src/devices/vimar.ts b/src/devices/vimar.ts index 8782d4bbd516a..349ef9851fc59 100644 --- a/src/devices/vimar.ts +++ b/src/devices/vimar.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -13,14 +13,14 @@ const definitions: DefinitionWithExtend[] = [ model: '03981', vendor: 'Vimar', description: 'IoT connected relay module', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['DimmerSwitch_v1.0'], model: '14595.0', vendor: 'Vimar', description: 'IoT connected dimmer mechanism 220-240V', - extend: [light({configureReporting: true, powerOnBehavior: false})], + extend: [m.light({configureReporting: true, powerOnBehavior: false})], endpoint: (device) => { return {default: 11}; }, @@ -30,7 +30,7 @@ const definitions: DefinitionWithExtend[] = [ model: '14592.0', vendor: 'Vimar', description: '2-way switch IoT connected mechanism', - extend: [onOff({powerOnBehavior: false})], + extend: [m.onOff({powerOnBehavior: false})], }, { zigbeeModel: ['Window_Cov_v1.0'], diff --git a/src/devices/visonic.ts b/src/devices/visonic.ts index cdaf40914c135..2b465e7b343ca 100644 --- a/src/devices/visonic.ts +++ b/src/devices/visonic.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {battery, iasZoneAlarm, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -15,7 +15,7 @@ const definitions: DefinitionWithExtend[] = [ fromZigbee: [fz.ias_occupancy_alarm_1, fz.temperature, fz.battery], toZigbee: [], meta: {battery: {voltageToPercentage: {min: 2500, max: 3000}}}, - exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery_voltage(), e.linkquality(), e.temperature(), e.battery()], + exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery_voltage(), e.temperature(), e.battery()], }, { zigbeeModel: ['MP-841'], @@ -95,7 +95,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'MCT-302 SMA', vendor: 'Visonic', description: 'Magnetic door & window contact senso', - extend: [temperature(), battery(), iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']})], + extend: [m.temperature(), m.battery(), m.iasZoneAlarm({zoneType: 'contact', zoneAttributes: ['alarm_1', 'tamper', 'battery_low']})], }, ]; diff --git a/src/devices/vrey.ts b/src/devices/vrey.ts index 36253a65a2328..beecda28b2e6a 100644 --- a/src/devices/vrey.ts +++ b/src/devices/vrey.ts @@ -1,16 +1,14 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; +import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [ - {modelID: 'TS0001', manufacturerName: '_TYZB01_reyozfcg'}, - {modelID: 'TS0001', manufacturerName: '_TYZB01_4vgantdz'}, - ], + fingerprint: tuya.fingerprint('TS0001', ['_TYZB01_reyozfcg', '_TYZB01_4vgantdz']), model: 'VR-X701U', vendor: 'Vrey', description: '1 gang switch', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/weten.ts b/src/devices/weten.ts index 4867f280f4e58..aa47027766620 100644 --- a/src/devices/weten.ts +++ b/src/devices/weten.ts @@ -1,6 +1,6 @@ import fz from '../converters/fromZigbee'; import * as exposes from '../lib/exposes'; -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -9,11 +9,11 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0001', manufacturerName: '_TZ3000_wrhhi5h2'}], + fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_wrhhi5h2']), model: '1GNNTS', vendor: 'WETEN', description: '1 gang no neutral touch wall switch', - extend: [onOff()], + extend: [m.onOff()], fromZigbee: [fz.ignore_basic_report, fz.ignore_time_read], }, { diff --git a/src/devices/wirenboard.ts b/src/devices/wirenboard.ts index 56c8bcbb42c85..dde9a0e8f237a 100644 --- a/src/devices/wirenboard.ts +++ b/src/devices/wirenboard.ts @@ -1,8 +1,10 @@ +import {Zcl} from 'zigbee-herdsman'; + import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import * as exposes from '../lib/exposes'; -import * as modernExtend from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {Configure, DefinitionWithExtend, Fz, KeyValueAny, ModernExtend, Tz} from '../lib/types'; import {assertString, getFromLookup, getOptions, toNumber} from '../lib/utils'; @@ -10,8 +12,6 @@ import {assertString, getFromLookup, getOptions, toNumber} from '../lib/utils'; const e = exposes.presets; const ea = exposes.access; -const {forcePowerSource, temperature, humidity, co2, deviceEndpoints, onOff, illuminance, occupancy} = modernExtend; - const sprutCode = 0x6666; const manufacturerOptions = {manufacturerCode: sprutCode}; const switchActionValues = ['OFF', 'ON']; @@ -250,8 +250,8 @@ const tzLocal = { }; const sprutModernExtend = { - sprutActivityIndicator: (args?: Partial) => - modernExtend.binary({ + sprutActivityIndicator: (args?: Partial) => + m.binary({ name: 'activity_led', cluster: 'genBinaryOutput', attribute: 'presentValue', @@ -263,8 +263,37 @@ const sprutModernExtend = { entityCategory: 'config', ...args, }), - sprutTemperatureOffset: (args?: Partial) => - modernExtend.numeric({ + sprutIsConnected: (args?: Partial) => + m.binary({ + name: 'uart_connection', + cluster: 'sprutDevice', + attribute: 'isConnected', + valueOn: [true, 1], + valueOff: [false, 0], + description: 'Indicates whether the device is communicating with sensors via UART', + access: 'STATE_GET', + entityCategory: 'diagnostic', + ...args, + }), + sprutUartBaudRate: (args?: Partial) => + m.enumLookup({ + name: 'uart_baud_rate', + lookup: { + '9600': 9600, + '19200': 19200, + '38400': 38400, + '57600': 57600, + '115200': 115200, + }, + cluster: 'sprutDevice', + attribute: 'UartBaudRate', + description: 'UART baud rate', + access: 'ALL', + entityCategory: 'config', + ...args, + }), + sprutTemperatureOffset: (args?: Partial) => + m.numeric({ name: 'temperature_offset', cluster: 'msTemperatureMeasurement', attribute: 'sprutTemperatureOffset', @@ -278,8 +307,8 @@ const sprutModernExtend = { zigbeeCommandOptions: manufacturerOptions, ...args, }), - sprutThHeater: (args?: Partial) => - modernExtend.binary({ + sprutThHeater: (args?: Partial) => + m.binary({ name: 'th_heater', cluster: 'msRelativeHumidity', attribute: 'sprutHeater', @@ -291,8 +320,8 @@ const sprutModernExtend = { zigbeeCommandOptions: manufacturerOptions, ...args, }), - sprutOccupancyLevel: (args?: Partial) => - modernExtend.numeric({ + sprutOccupancyLevel: (args?: Partial) => + m.numeric({ name: 'occupancy_level', cluster: 'msOccupancySensing', attribute: 'sprutOccupancyLevel', @@ -302,8 +331,8 @@ const sprutModernExtend = { entityCategory: 'diagnostic', ...args, }), - sprutOccupancyTimeout: (args?: Partial) => - modernExtend.numeric({ + sprutOccupancyTimeout: (args?: Partial) => + m.numeric({ name: 'occupancy_timeout', cluster: 'msOccupancySensing', attribute: 'pirOToUDelay', @@ -315,8 +344,8 @@ const sprutModernExtend = { entityCategory: 'config', ...args, }), - sprutOccupancySensitivity: (args?: Partial) => - modernExtend.numeric({ + sprutOccupancySensitivity: (args?: Partial) => + m.numeric({ name: 'occupancy_sensitivity', cluster: 'msOccupancySensing', attribute: 'sprutOccupancySensitivity', @@ -328,8 +357,8 @@ const sprutModernExtend = { zigbeeCommandOptions: manufacturerOptions, ...args, }), - sprutNoise: (args?: Partial) => - modernExtend.numeric({ + sprutNoise: (args?: Partial) => + m.numeric({ name: 'noise', cluster: 'sprutNoise', attribute: 'noise', @@ -341,8 +370,8 @@ const sprutModernExtend = { entityCategory: 'diagnostic', ...args, }), - sprutNoiseDetectLevel: (args?: Partial) => - modernExtend.numeric({ + sprutNoiseDetectLevel: (args?: Partial) => + m.numeric({ name: 'noise_detect_level', cluster: 'sprutNoise', attribute: 'noiseDetectLevel', @@ -355,8 +384,8 @@ const sprutModernExtend = { zigbeeCommandOptions: manufacturerOptions, ...args, }), - sprutNoiseDetected: (args?: Partial) => - modernExtend.binary({ + sprutNoiseDetected: (args?: Partial) => + m.binary({ name: 'noise_detected', cluster: 'sprutNoise', attribute: 'noiseDetected', @@ -366,8 +395,8 @@ const sprutModernExtend = { access: 'STATE_GET', ...args, }), - sprutNoiseTimeout: (args?: Partial) => - modernExtend.numeric({ + sprutNoiseTimeout: (args?: Partial) => + m.numeric({ name: 'noise_timeout', cluster: 'sprutNoise', attribute: 'noiseAfterDetectDelay', @@ -379,8 +408,8 @@ const sprutModernExtend = { entityCategory: 'config', ...args, }), - sprutVoc: (args?: Partial) => - modernExtend.numeric({ + sprutVoc: (args?: Partial) => + m.numeric({ name: 'voc', label: 'VOC', cluster: 'sprutVoc', @@ -434,13 +463,15 @@ const sprutModernExtend = { }, }, ]; - const configure: Configure[] = [modernExtend.setupConfigureForBinding('sprutIrBlaster', 'input')]; + const configure: Configure[] = [m.setupConfigureForBinding('sprutIrBlaster', 'input')]; return {toZigbee, configure, isModernExtend: true}; }, }; const { sprutActivityIndicator, + sprutIsConnected, + sprutUartBaudRate, sprutOccupancyLevel, sprutNoise, sprutVoc, @@ -462,7 +493,6 @@ const definitions: DefinitionWithExtend[] = [ description: 'Wall-mounted multi sensor', fromZigbee: [ fzLocal.temperature, - fz.illuminance, fz.humidity, fz.occupancy, fzLocal.occupancy_level, @@ -491,7 +521,6 @@ const definitions: DefinitionWithExtend[] = [ ], exposes: [ e.temperature(), - e.illuminance(), e.humidity(), e.occupancy(), e.occupancy_level(), @@ -561,7 +590,6 @@ const definitions: DefinitionWithExtend[] = [ const binds = [ 'genBasic', 'msTemperatureMeasurement', - 'msIlluminanceMeasurement', 'msRelativeHumidity', 'msOccupancySensing', 'msCO2', @@ -574,7 +602,6 @@ const definitions: DefinitionWithExtend[] = [ // report configuration await reporting.temperature(endpoint1); - await reporting.illuminance(endpoint1); await reporting.humidity(endpoint1); await reporting.occupancy(endpoint1); @@ -598,6 +625,7 @@ const definitions: DefinitionWithExtend[] = [ }, meta: {multiEndpoint: true, multiEndpointSkip: ['humidity']}, ota: true, + extend: [m.illuminance()], }, { zigbeeModel: ['WBMSW4'], @@ -605,20 +633,36 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Wirenboard', description: 'Wall-mounted multi sensor', extend: [ - forcePowerSource({powerSource: 'Mains (single phase)'}), - deviceEndpoints({ + m.deviceAddCustomCluster('sprutDevice', { + ID: 26112, + manufacturerCode: 26214, + attributes: { + isConnected: {ID: 26116, type: Zcl.DataType.BOOLEAN}, + UartBaudRate: {ID: 26113, type: Zcl.DataType.UINT32}, + }, + commands: { + debug: { + ID: 103, + parameters: [{name: 'data', type: Zcl.DataType.UINT8}], + }, + }, + commandsResponse: {}, + }), + m.forcePowerSource({powerSource: 'Mains (single phase)'}), + m.deviceEndpoints({ endpoints: {default: 1, l1: 2, l2: 3, l3: 4, indicator: 5}, multiEndpointSkip: ['occupancy'], }), - onOff({powerOnBehavior: false, endpointNames: ['l1', 'l2', 'l3']}), + m.onOff({powerOnBehavior: false, endpointNames: ['l1', 'l2', 'l3']}), sprutActivityIndicator({endpointName: 'indicator'}), - temperature(), + sprutIsConnected(), + m.temperature(), sprutTemperatureOffset(), - humidity(), + m.humidity(), sprutThHeater(), - co2(), - illuminance(), - occupancy(), + m.co2(), + m.illuminance(), + m.occupancy(), sprutOccupancySensitivity(), sprutOccupancyLevel(), sprutOccupancyTimeout(), @@ -628,6 +672,7 @@ const definitions: DefinitionWithExtend[] = [ sprutNoiseTimeout(), sprutVoc(), sprutIrBlaster(), + sprutUartBaudRate(), ], ota: true, }, diff --git a/src/devices/wisdom.ts b/src/devices/wisdom.ts index d01c84658e261..d371b5ba29641 100644 --- a/src/devices/wisdom.ts +++ b/src/devices/wisdom.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'DMZ250', vendor: 'Wisdom', description: 'Zigbee led dimmer 5-250 Watt', - extend: [light()], + extend: [m.light()], }, ]; diff --git a/src/devices/woox.ts b/src/devices/woox.ts index 7c64cfbb150bd..b509846d8086d 100644 --- a/src/devices/woox.ts +++ b/src/devices/woox.ts @@ -11,7 +11,7 @@ const ea = exposes.access; const definitions: DefinitionWithExtend[] = [ { - fingerprint: [{modelID: 'TS0101', manufacturerName: '_TZ3210_eymunffl'}], + fingerprint: tuya.fingerprint('TS0101', ['_TZ3210_eymunffl']), model: 'R7060', vendor: 'Woox', description: 'Smart garden irrigation control', @@ -23,7 +23,7 @@ const definitions: DefinitionWithExtend[] = [ configure: tuya.configureMagicPacket, }, { - fingerprint: [{modelID: 'TS0505A', manufacturerName: '_TZ3000_keabpigv'}], + fingerprint: tuya.fingerprint('TS0505A', ['_TZ3000_keabpigv']), model: 'R9077', vendor: 'Woox', description: 'RGB+CCT LED', @@ -31,7 +31,7 @@ const definitions: DefinitionWithExtend[] = [ meta: {applyRedFix: true}, }, { - fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_rusu2vzb'}], + fingerprint: tuya.fingerprint('TS0201', ['_TZ3000_rusu2vzb']), model: 'R7048', vendor: 'Woox', description: 'Smart humidity & temperature sensor', @@ -68,11 +68,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS0219', manufacturerName: '_TYZB01_ynsiasng'}, - {modelID: 'TS0219', manufacturerName: '_TYZB01_bwsijaty'}, - {modelID: 'TS0219', manufacturerName: '_TYZB01_rs7ff6o7'}, - ], + fingerprint: tuya.fingerprint('TS0219', ['_TYZB01_ynsiasng', '_TYZB01_bwsijaty', '_TYZB01_rs7ff6o7']), model: 'R7051', vendor: 'Woox', description: 'Smart siren', diff --git a/src/devices/xal.ts b/src/devices/xal.ts index 6df2846df829a..60a1c2d82e025 100644 --- a/src/devices/xal.ts +++ b/src/devices/xal.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -6,15 +6,22 @@ const definitions: DefinitionWithExtend[] = [ zigbeeModel: ['050-0131558M'], model: '050-0131558M', vendor: 'XAL', - description: 'Just 45 MOVE IT 25 spotlight', - extend: [light()], + description: 'Spotlight for Just MOVE IT 25 track', + extend: [m.light()], }, { zigbeeModel: ['050-1212558H'], model: '050-1212558H', vendor: 'XAL', - description: 'Just 45 LIGHT opal floodlight', - extend: [light()], + description: 'Opal floodlight for Just MOVE IT 25 track', + extend: [m.light()], + }, + { + zigbeeModel: ['050-0511558F'], + model: '050-0511558F', + vendor: 'XAL', + description: 'Cable suspended spotlight for Just MOVE IT 25 track', + extend: [m.light()], }, ]; diff --git a/src/devices/xinghuoyuan.ts b/src/devices/xinghuoyuan.ts index b52f32cc3ca5c..3cd9d0487cce7 100644 --- a/src/devices/xinghuoyuan.ts +++ b/src/devices/xinghuoyuan.ts @@ -1,4 +1,4 @@ -import {onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'X2SK11', vendor: 'XingHuoYuan', description: 'Smart socket', - extend: [onOff()], + extend: [m.onOff()], }, ]; diff --git a/src/devices/xyzroe.ts b/src/devices/xyzroe.ts index 01d6c23b21bb4..5c607d4a0ee24 100644 --- a/src/devices/xyzroe.ts +++ b/src/devices/xyzroe.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {deviceEndpoints, electricityMeter, iasZoneAlarm, identify, onOff, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend, Fz, KeyValueAny, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -480,9 +480,9 @@ const definitions: DefinitionWithExtend[] = [ .withUnit('seconds'), ], extend: [ - deviceEndpoints({endpoints: {1: 1, 2: 2, 3: 3, 4: 4}}), - identify(), - electricityMeter({ + m.deviceEndpoints({endpoints: {1: 1, 2: 2, 3: 3, 4: 4}}), + m.identify(), + m.electricityMeter({ cluster: 'electrical', electricalMeasurementType: 'both', // Since this device measures lower voltage devices, lower the change value. @@ -491,11 +491,11 @@ const definitions: DefinitionWithExtend[] = [ voltage: {change: 100}, endpointNames: ['1'], }), - temperature(), - onOff({endpointNames: ['1'], description: 'Controls the USB port'}), - onOff({powerOnBehavior: false, endpointNames: ['2'], description: 'LED indicates the Zigbee status'}), - onOff({powerOnBehavior: false, endpointNames: ['3'], description: 'LED indicates the USB state'}), - iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1'], description: 'Over current alarm'}), + m.temperature(), + m.onOff({endpointNames: ['1'], description: 'Controls the USB port'}), + m.onOff({powerOnBehavior: false, endpointNames: ['2'], description: 'LED indicates the Zigbee status'}), + m.onOff({powerOnBehavior: false, endpointNames: ['3'], description: 'LED indicates the USB state'}), + m.iasZoneAlarm({zoneType: 'generic', zoneAttributes: ['alarm_1'], description: 'Over current alarm'}), ], meta: {multiEndpoint: true}, }, diff --git a/src/devices/yale.ts b/src/devices/yale.ts index 90d9e8f5c19e1..c2ebd118928af 100644 --- a/src/devices/yale.ts +++ b/src/devices/yale.ts @@ -6,7 +6,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import {battery, lock} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {getFromLookup} from '../lib/utils'; @@ -342,7 +342,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'YRM476', vendor: 'Yale', description: 'Assure lock', - extend: [battery(), lock({pinCodeCount: 250})], + extend: [m.battery(), m.lock({pinCodeCount: 250})], }, { zigbeeModel: ['YRD216 PBDB'], @@ -429,7 +429,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'YMI70A', vendor: 'Yale', description: 'Biometric digital lock', - extend: [battery(), lock({pinCodeCount: 100})], + extend: [m.battery(), m.lock({pinCodeCount: 100})], }, { fingerprint: [ diff --git a/src/devices/yandex.ts b/src/devices/yandex.ts index 4eb6188276e9b..e4124de069df0 100644 --- a/src/devices/yandex.ts +++ b/src/devices/yandex.ts @@ -4,24 +4,14 @@ import {Zcl} from 'zigbee-herdsman'; import {access as ea} from '../lib/exposes'; import {logger} from '../lib/logger'; -import { - binary, - BinaryArgs, - commandsOnOff, - determineEndpoint, - deviceAddCustomCluster, - deviceEndpoints, - enumLookup, - EnumLookupArgs, - onOff, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {Configure, DefinitionWithExtend, ModernExtend, OnEvent, Tz} from '../lib/types'; import {getFromLookup, isString} from '../lib/utils'; const NS = 'zhc:yandex'; const manufacturerCode = 0x140a; -interface EnumLookupWithSetCommandArgs extends EnumLookupArgs { +interface EnumLookupWithSetCommandArgs extends m.EnumLookupArgs { setCommand: string; } @@ -30,7 +20,7 @@ function enumLookupWithSetCommand(args: EnumLookupWithSetCommandArgs): ModernExt const attributeKey = isString(attribute) ? attribute : attribute.ID; const access = ea[args.access ?? 'ALL']; - const mExtend = enumLookup(args); + const mExtend = m.enumLookup(args); const toZigbee: Tz.Converter[] = [ { @@ -39,15 +29,15 @@ function enumLookupWithSetCommand(args: EnumLookupWithSetCommandArgs): ModernExt access & ea.SET ? async (entity, key, value, meta) => { const payloadValue = getFromLookup(value, lookup); - await determineEndpoint(entity, meta, cluster).command(cluster, setCommand, {value: payloadValue}, zigbeeCommandOptions); - await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); + await m.determineEndpoint(entity, meta, cluster).command(cluster, setCommand, {value: payloadValue}, zigbeeCommandOptions); + await m.determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); return {state: {[key]: value}}; } : undefined, convertGet: access & ea.GET ? async (entity, key, meta) => { - await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); + await m.determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); } : undefined, }, @@ -56,7 +46,7 @@ function enumLookupWithSetCommand(args: EnumLookupWithSetCommandArgs): ModernExt return {...mExtend, toZigbee}; } -interface BinaryWithSetCommandArgs extends BinaryArgs { +interface BinaryWithSetCommandArgs extends m.BinaryArgs { setCommand: string; } @@ -65,7 +55,7 @@ function binaryWithSetCommand(args: BinaryWithSetCommandArgs): ModernExtend { const attributeKey = isString(attribute) ? attribute : attribute.ID; const access = ea[args.access ?? 'ALL']; - const mExtend = binary(args); + const mExtend = m.binary(args); const toZigbee: Tz.Converter[] = [ { @@ -74,15 +64,15 @@ function binaryWithSetCommand(args: BinaryWithSetCommandArgs): ModernExtend { access & ea.SET ? async (entity, key, value, meta) => { const payloadValue = value === valueOn[0] ? valueOn[1] : valueOff[1]; - await determineEndpoint(entity, meta, cluster).command(cluster, setCommand, {value: payloadValue}, zigbeeCommandOptions); - await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); + await m.determineEndpoint(entity, meta, cluster).command(cluster, setCommand, {value: payloadValue}, zigbeeCommandOptions); + await m.determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); return {state: {[key]: value}}; } : undefined, convertGet: access & ea.GET ? async (entity, key, meta) => { - await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); + await m.determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions); } : undefined, }, @@ -92,7 +82,7 @@ function binaryWithSetCommand(args: BinaryWithSetCommandArgs): ModernExtend { } function YandexCluster(): ModernExtend { - return deviceAddCustomCluster('manuSpecificYandex', { + return m.deviceAddCustomCluster('manuSpecificYandex', { ID: 0xfc03, manufacturerCode, attributes: { @@ -167,10 +157,10 @@ const definitions: DefinitionWithExtend[] = [ extend: [ reinterview(), YandexCluster(), - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {'1': 1, '': 2}, }), - onOff({ + m.onOff({ endpointNames: ['1'], }), enumLookupWithSetCommand({ @@ -203,7 +193,7 @@ const definitions: DefinitionWithExtend[] = [ }, entityCategory: 'config', }), - commandsOnOff({endpointNames: ['']}), + m.commandsOnOff({endpointNames: ['']}), ], }, { @@ -214,10 +204,10 @@ const definitions: DefinitionWithExtend[] = [ extend: [ reinterview(), YandexCluster(), - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {'1': 1, '2': 2, b1: 3, b2: 4}, }), - onOff({ + m.onOff({ endpointNames: ['1', '2'], }), enumLookupWithSetCommand({ @@ -276,7 +266,7 @@ const definitions: DefinitionWithExtend[] = [ }, entityCategory: 'config', }), - commandsOnOff({endpointNames: ['b1', 'b2']}), + m.commandsOnOff({endpointNames: ['b1', 'b2']}), ], }, { @@ -286,10 +276,10 @@ const definitions: DefinitionWithExtend[] = [ description: 'Single gang wireless switch', extend: [ YandexCluster(), - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {down: 1, up: 2}, }), - commandsOnOff({endpointNames: ['up', 'down']}), + m.commandsOnOff({endpointNames: ['up', 'down']}), ], }, { @@ -299,10 +289,10 @@ const definitions: DefinitionWithExtend[] = [ description: 'Double gang wireless switch', extend: [ YandexCluster(), - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {b1_down: 1, b2_down: 2, b1_up: 3, b2_up: 4}, }), - commandsOnOff({endpointNames: ['b1_up', 'b1_down', 'b2_up', 'b2_down']}), + m.commandsOnOff({endpointNames: ['b1_up', 'b1_down', 'b2_up', 'b2_down']}), ], }, { @@ -313,10 +303,10 @@ const definitions: DefinitionWithExtend[] = [ extend: [ reinterview(), YandexCluster(), - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {'1': 1, down: 2, up: 3}, }), - onOff({ + m.onOff({ endpointNames: ['1'], }), enumLookupWithSetCommand({ @@ -334,7 +324,7 @@ const definitions: DefinitionWithExtend[] = [ }, entityCategory: 'config', }), - commandsOnOff({endpointNames: ['up', 'down']}), + m.commandsOnOff({endpointNames: ['up', 'down']}), enumLookupWithSetCommand({ name: 'operation_mode', cluster: 'manuSpecificYandex', @@ -372,10 +362,10 @@ const definitions: DefinitionWithExtend[] = [ extend: [ reinterview(), YandexCluster(), - deviceEndpoints({ + m.deviceEndpoints({ endpoints: {'1': 1, '2': 2, b1_down: 3, b2_down: 4, b1_up: 5, b2_up: 6}, }), - onOff({ + m.onOff({ endpointNames: ['1', '2'], }), enumLookupWithSetCommand({ @@ -393,7 +383,7 @@ const definitions: DefinitionWithExtend[] = [ }, entityCategory: 'config', }), - commandsOnOff({endpointNames: ['b1_up', 'b1_down', 'b2_up', 'b2_down']}), + m.commandsOnOff({endpointNames: ['b1_up', 'b1_down', 'b2_up', 'b2_down']}), enumLookupWithSetCommand({ name: 'operation_mode', cluster: 'manuSpecificYandex', diff --git a/src/devices/ynoa.ts b/src/devices/ynoa.ts index f76a238640adf..2a246a32e43da 100644 --- a/src/devices/ynoa.ts +++ b/src/devices/ynoa.ts @@ -1,7 +1,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import {DefinitionWithExtend} from '../lib/types'; @@ -13,14 +13,14 @@ const definitions: DefinitionWithExtend[] = [ model: '8718801528204', vendor: 'Ynoa', description: 'Smart LED E27 CCT', - extend: [light({colorTemp: {range: [250, 454]}, effect: false})], + extend: [m.light({colorTemp: {range: [250, 454]}, effect: false})], }, { zigbeeModel: ['ZBT-CCTLight-GU100001'], model: '8718801528273', vendor: 'Ynoa', description: 'Smart LED GU10 CCT', - extend: [light({colorTemp: {range: [153, 454]}})], + extend: [m.light({colorTemp: {range: [153, 454]}})], }, { zigbeeModel: ['ZBT-DIMSwitch-D0000'], @@ -41,7 +41,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'LA-GU10-RGBW', vendor: 'Ynoa', description: 'Smart LED GU10 RGB CCT', - extend: [light({colorTemp: {range: [153, 526]}, color: {modes: ['xy', 'hs']}})], + extend: [m.light({colorTemp: {range: [153, 526]}, color: {modes: ['xy', 'hs']}})], }, { zigbeeModel: ['ZBT-RGBWSwitch-D0800'], diff --git a/src/devices/yokis.ts b/src/devices/yokis.ts index 0f698a9cf643a..8a60399f0e031 100644 --- a/src/devices/yokis.ts +++ b/src/devices/yokis.ts @@ -3,21 +3,7 @@ import {ClusterDefinition} from 'zigbee-herdsman/dist/zspec/zcl/definition/tstyp import * as exposes from '../lib/exposes'; import {logger} from '../lib/logger'; -import { - binary, - commandsLevelCtrl, - commandsOnOff, - commandsWindowCovering, - deviceAddCustomCluster, - deviceEndpoints, - enumLookup, - // forcePowerSource, - identify, - light, - numeric, - onOff, - windowCovering, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend, KeyValueAny, ModernExtend, Tz} from '../lib/types'; import * as utils from '../lib/utils'; @@ -1444,7 +1430,7 @@ const YokisDeviceExtend: ModernExtend[] = [ const YokisInputExtend: ModernExtend[] = [ // InputMode - enumLookup({ + m.enumLookup({ name: 'input_mode', lookup: inputModeEnum, cluster: 'manuSpecificYokisInput', @@ -1459,7 +1445,7 @@ const YokisInputExtend: ModernExtend[] = [ }), // InputMode - enumLookup({ + m.enumLookup({ name: 'contact_mode', lookup: {nc: 0x00, no: 0x01}, cluster: 'manuSpecificYokisInput', @@ -1471,7 +1457,7 @@ const YokisInputExtend: ModernExtend[] = [ }), // LastLocalCommandState - binary({ + m.binary({ name: 'last_local_command_state', cluster: 'manuSpecificYokisInput', attribute: 'lastLocalCommandState', @@ -1483,7 +1469,7 @@ const YokisInputExtend: ModernExtend[] = [ }), // LastBPConnectState - binary({ + m.binary({ name: 'last_bp_connect_state', cluster: 'manuSpecificYokisInput', attribute: 'lastBPConnectState', @@ -1518,7 +1504,7 @@ const YokisInputExtendWithBacklight: ModernExtend[] = [ const YokisEntryExtend: ModernExtend[] = [ // eShortPress - binary({ + m.binary({ name: 'enable_short_press', cluster: 'manuSpecificYokisEntryConfigurator', attribute: 'eShortPress', @@ -1529,7 +1515,7 @@ const YokisEntryExtend: ModernExtend[] = [ }), // eLongPress - binary({ + m.binary({ name: 'enable_long_press', cluster: 'manuSpecificYokisEntryConfigurator', attribute: 'eLongPress', @@ -1540,7 +1526,7 @@ const YokisEntryExtend: ModernExtend[] = [ }), // LongPressDuration - numeric({ + m.numeric({ name: 'long_press_duration', cluster: 'manuSpecificYokisEntryConfigurator', attribute: 'longPressDuration', @@ -1553,7 +1539,7 @@ const YokisEntryExtend: ModernExtend[] = [ }), // TimeBetweenPress - numeric({ + m.numeric({ name: 'time_between_press', cluster: 'manuSpecificYokisEntryConfigurator', attribute: 'timeBetweenPress', @@ -1566,7 +1552,7 @@ const YokisEntryExtend: ModernExtend[] = [ }), // eR12MLongPress - binary({ + m.binary({ name: 'enable_R12M_long_press', cluster: 'manuSpecificYokisEntryConfigurator', attribute: 'eR12MLongPress', @@ -1577,7 +1563,7 @@ const YokisEntryExtend: ModernExtend[] = [ }), // eLocalConfigLock - binary({ + m.binary({ name: 'enable_local_config_lock', cluster: 'manuSpecificYokisEntryConfigurator', attribute: 'eLocalConfigLock', @@ -1589,7 +1575,7 @@ const YokisEntryExtend: ModernExtend[] = [ ]; const YokisSubSystemExtend: ModernExtend[] = [ - enumLookup({ + m.enumLookup({ name: 'power_failure_mode', lookup: {last_state: 0x00, off: 0x01, on: 0x02, blink: 0x03}, cluster: 'manuSpecificYokisSubSystem', @@ -1617,7 +1603,7 @@ const yokisLightControlExtend: ModernExtend[] = [ // }), // PrevState - binary({ + m.binary({ name: 'prev_state', cluster: 'manuSpecificYokisLightControl', attribute: 'prevState', @@ -1641,7 +1627,7 @@ const yokisLightControlExtend: ModernExtend[] = [ // valueOff: ['OFF', 0x00], // entityCategory: 'config', // }), - numeric({ + m.numeric({ name: 'on_timer', cluster: 'manuSpecificYokisLightControl', attribute: 'onTimer', @@ -1654,7 +1640,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // preOnDelay - binary({ + m.binary({ name: 'enable_pre_on_delay', cluster: 'manuSpecificYokisLightControl', attribute: 'ePreOnDelay', @@ -1663,7 +1649,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueOff: ['OFF', 0x00], entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'pre_on_delay', cluster: 'manuSpecificYokisLightControl', attribute: 'preOnDelay', @@ -1676,7 +1662,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // preOffDelay - binary({ + m.binary({ name: 'enable_pre_off_delay', cluster: 'manuSpecificYokisLightControl', attribute: 'ePreOffDelay', @@ -1685,7 +1671,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueOff: ['OFF', 0x00], entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'pre_off_delay', cluster: 'manuSpecificYokisLightControl', attribute: 'preOffDelay', @@ -1698,7 +1684,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // Pulseduration - numeric({ + m.numeric({ name: 'pulse_duration', cluster: 'manuSpecificYokisLightControl', attribute: 'pulseDuration', @@ -1711,7 +1697,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // TimeType - enumLookup({ + m.enumLookup({ name: 'time_type', lookup: {seconds: 0x00, minutes: 0x01}, cluster: 'manuSpecificYokisLightControl', @@ -1723,7 +1709,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // LongOnDuration - numeric({ + m.numeric({ name: 'long_on_duration', cluster: 'manuSpecificYokisLightControl', attribute: 'longOnDuration', @@ -1736,7 +1722,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // OperatingMode - enumLookup({ + m.enumLookup({ name: 'operating_mode', lookup: {timer: 0x00, staircase: 0x01, pulse: 0x02}, cluster: 'manuSpecificYokisLightControl', @@ -1749,7 +1735,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // stopAnnounce - binary({ + m.binary({ name: 'enable_stop_announce', cluster: 'manuSpecificYokisLightControl', attribute: 'eStopAnnounce', @@ -1758,7 +1744,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueOff: ['OFF', 0x00], entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'stop_announce_time', cluster: 'manuSpecificYokisLightControl', attribute: 'stopAnnounceTime', @@ -1771,7 +1757,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // eDeaf - binary({ + m.binary({ name: 'enable_deaf', cluster: 'manuSpecificYokisLightControl', attribute: 'eDeaf', @@ -1780,7 +1766,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueOff: ['OFF', 0x00], entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'deaf_blink_amount', cluster: 'manuSpecificYokisLightControl', attribute: 'deafBlinkAmount', @@ -1790,7 +1776,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueStep: 1, entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'deaf_blink_time', cluster: 'manuSpecificYokisLightControl', attribute: 'deafBlinkTime', @@ -1802,7 +1788,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // Blink - binary({ + m.binary({ name: 'enable_blink', cluster: 'manuSpecificYokisLightControl', attribute: 'eBlink', @@ -1811,7 +1797,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueOff: ['OFF', 0x00], entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'blink_amount', cluster: 'manuSpecificYokisLightControl', attribute: 'blinkAmount', @@ -1821,7 +1807,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueStep: 1, entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'blink_on_time', cluster: 'manuSpecificYokisLightControl', attribute: 'blinkOnTime', @@ -1831,7 +1817,7 @@ const yokisLightControlExtend: ModernExtend[] = [ valueStep: 1, entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'blink_off_time', cluster: 'manuSpecificYokisLightControl', attribute: 'blinkOffTime', @@ -1843,7 +1829,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // StateAfterBlink - enumLookup({ + m.enumLookup({ name: 'state_after_blink', lookup: stateAfterBlinkEnum, cluster: 'manuSpecificYokisLightControl', @@ -1857,7 +1843,7 @@ const yokisLightControlExtend: ModernExtend[] = [ }), // eNcCommand - binary({ + m.binary({ name: 'enable_nc_command', cluster: 'manuSpecificYokisLightControl', attribute: 'eNcCommand', @@ -1876,7 +1862,7 @@ const yokisLightControlExtend: ModernExtend[] = [ const YokisDimmerExtend: ModernExtend[] = [ // currentPosition - numeric({ + m.numeric({ name: 'current_position', cluster: 'manuSpecificYokisDimmer', attribute: 'currentPosition', @@ -1886,7 +1872,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // memoryPosition - numeric({ + m.numeric({ name: 'memory_position', cluster: 'manuSpecificYokisDimmer', attribute: 'memoryPosition', @@ -1896,7 +1882,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // RampUp - binary({ + m.binary({ name: 'enable_ramp_up', cluster: 'manuSpecificYokisDimmer', attribute: 'eRampUp', @@ -1905,7 +1891,7 @@ const YokisDimmerExtend: ModernExtend[] = [ valueOff: ['OFF', 0x00], entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'ramp_up', cluster: 'manuSpecificYokisDimmer', attribute: 'rampUp', @@ -1917,7 +1903,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // RampDown - binary({ + m.binary({ name: 'enable_ramp_down', cluster: 'manuSpecificYokisDimmer', attribute: 'eRampDown', @@ -1926,7 +1912,7 @@ const YokisDimmerExtend: ModernExtend[] = [ valueOff: ['OFF', 0x00], entityCategory: 'config', }), - numeric({ + m.numeric({ name: 'ramp_down', cluster: 'manuSpecificYokisDimmer', attribute: 'rampDown', @@ -1938,7 +1924,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // rampContinuousTime - numeric({ + m.numeric({ name: 'ramp_continuous_time', cluster: 'manuSpecificYokisDimmer', attribute: 'rampContinuousTime', @@ -1950,7 +1936,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // stepUp - numeric({ + m.numeric({ name: 'step_up', cluster: 'manuSpecificYokisDimmer', attribute: 'stepUp', @@ -1962,7 +1948,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // lowDimLimit - numeric({ + m.numeric({ name: 'low_dim_limit', cluster: 'manuSpecificYokisDimmer', attribute: 'lowDimLimit', @@ -1975,7 +1961,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // highDimLimit - numeric({ + m.numeric({ name: 'high_dim_limit', cluster: 'manuSpecificYokisDimmer', attribute: 'highDimLimit', @@ -1988,7 +1974,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // nightLightStartingDelay - numeric({ + m.numeric({ name: 'nightlight_starting_delay', cluster: 'manuSpecificYokisDimmer', attribute: 'nightLightStartingDelay', @@ -2000,7 +1986,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // nightLightStartingBrightness - numeric({ + m.numeric({ name: 'nightlight_starting_brightness', cluster: 'manuSpecificYokisDimmer', attribute: 'nightLightStartingBrightness', @@ -2012,7 +1998,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // nightLightEndingBrightness - numeric({ + m.numeric({ name: 'nightlight_ending_brightness', cluster: 'manuSpecificYokisDimmer', attribute: 'nightLightEndingBrightness', @@ -2025,7 +2011,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // nightLightRampTime - numeric({ + m.numeric({ name: 'nightlight_ramp_time', cluster: 'manuSpecificYokisDimmer', attribute: 'nightLightRampTime', @@ -2038,7 +2024,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // nightLightOnTime - numeric({ + m.numeric({ name: 'nightlight_on_time', cluster: 'manuSpecificYokisDimmer', attribute: 'nightLightOnTime', @@ -2051,7 +2037,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // favoritePosition1 - numeric({ + m.numeric({ name: 'favorite_position_1', cluster: 'manuSpecificYokisDimmer', attribute: 'favoritePosition1', @@ -2063,7 +2049,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // favoritePosition2 - numeric({ + m.numeric({ name: 'favorite_position_2', cluster: 'manuSpecificYokisDimmer', attribute: 'favoritePosition2', @@ -2075,7 +2061,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // favoritePosition3 - numeric({ + m.numeric({ name: 'favorite_position_3', cluster: 'manuSpecificYokisDimmer', attribute: 'favoritePosition3', @@ -2087,7 +2073,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // stepControllerMode - binary({ + m.binary({ name: 'step_controller_mode', cluster: 'manuSpecificYokisDimmer', attribute: 'stepControllerMode', @@ -2099,7 +2085,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // memoryPositionMode - binary({ + m.binary({ name: 'memory_position_mode', cluster: 'manuSpecificYokisDimmer', attribute: 'memoryPositionMode', @@ -2110,7 +2096,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // stepDown - numeric({ + m.numeric({ name: 'step_down', cluster: 'manuSpecificYokisDimmer', attribute: 'stepDown', @@ -2122,7 +2108,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // stepContinuous - numeric({ + m.numeric({ name: 'step_continuous', cluster: 'manuSpecificYokisDimmer', attribute: 'stepContinuous', @@ -2134,7 +2120,7 @@ const YokisDimmerExtend: ModernExtend[] = [ }), // stepNightLigth - numeric({ + m.numeric({ name: 'step_nightlight', cluster: 'manuSpecificYokisDimmer', attribute: 'stepNightLight', @@ -2303,15 +2289,15 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Remote power switch with timer 500W', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), - deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), - deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation - onOff({powerOnBehavior: false}), // StartupOnOff is not supported - identify(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), + m.deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), + m.deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation + m.onOff({powerOnBehavior: false}), // StartupOnOff is not supported + m.identify(), ...YokisSubSystemExtend, ...yokisLightControlExtend, ...YokisDeviceExtend, @@ -2328,15 +2314,15 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Remote power switch with timer 1300W', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), - deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), - deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation - onOff({powerOnBehavior: false}), // StartupOnOff is not supported - identify(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), + m.deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), + m.deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation + m.onOff({powerOnBehavior: false}), // StartupOnOff is not supported + m.identify(), ...YokisSubSystemExtend, ...yokisLightControlExtend, ...YokisDeviceExtend, @@ -2353,15 +2339,15 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Remote power switch with timer 2000W', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), - deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), - deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation - onOff({powerOnBehavior: false}), // StartupOnOff is not supported - identify(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), + m.deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), + m.deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation + m.onOff({powerOnBehavior: false}), // StartupOnOff is not supported + m.identify(), ...YokisSubSystemExtend, ...yokisLightControlExtend, ...YokisDeviceExtend, @@ -2378,16 +2364,16 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Remote dimmer with timer 300W', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), - deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), - deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation - light({configureReporting: true, powerOnBehavior: false}), // StartupOnOff is not supported, TODO: review dimmer cluster instead - identify(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), + m.deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), + m.deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation + m.light({configureReporting: true, powerOnBehavior: false}), // StartupOnOff is not supported, TODO: review dimmer cluster instead + m.identify(), ...yokisLightControlExtend, ...YokisSubSystemExtend, ...YokisDimmerExtend, @@ -2405,16 +2391,16 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Roller shutter module 500W', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), - deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), - deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), - deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation - identify(), - windowCovering({controls: ['lift']}), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisEntryConfigurator', YokisClustersDefinition['manuSpecificYokisEntryConfigurator']), + m.deviceAddCustomCluster('manuSpecificYokisSubSystem', YokisClustersDefinition['manuSpecificYokisSubSystem']), + m.deviceAddCustomCluster('manuSpecificYokisLoadManager', YokisClustersDefinition['manuSpecificYokisLoadManager']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), + m.deviceAddCustomCluster('manuSpecificYokisStats', YokisClustersDefinition['manuSpecificYokisStats']), // Pending implementation + m.identify(), + m.windowCovering({controls: ['lift']}), + m.commandsWindowCovering(), ...YokisSubSystemExtend, ...YokisWindowCoveringExtend, ...YokisDeviceExtend, @@ -2431,18 +2417,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Flush-mounted independent 2-channel transmitter', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2456,18 +2442,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Flush-mounted independent 4-channel transmitter', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2481,18 +2467,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Tabletop Design series 1-button remote control', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2506,18 +2492,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Keyring Design series 2-button remote control', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2531,18 +2517,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Keyring Design series 4-button remote control', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2556,18 +2542,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Keyring Design series 8-button remote control', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2581,18 +2567,18 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Wall-mounted 1-button transmitter', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2606,19 +2592,19 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Wall-mounted 2-button transmitter', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2632,19 +2618,19 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: 'Wall-mounted 4-button transmitter', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, @@ -2658,19 +2644,19 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'YOKIS', description: '4-button remote control', extend: [ - deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), - deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), - deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), - deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), - deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), - deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation - deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation - deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), - identify(), - commandsOnOff(), - commandsLevelCtrl(), - commandsWindowCovering(), + m.deviceAddCustomCluster('manuSpecificYokisDevice', YokisClustersDefinition['manuSpecificYokisDevice']), + m.deviceAddCustomCluster('manuSpecificYokisInput', YokisClustersDefinition['manuSpecificYokisInput']), + m.deviceAddCustomCluster('manuSpecificYokisLightControl', YokisClustersDefinition['manuSpecificYokisLightControl']), + m.deviceAddCustomCluster('manuSpecificYokisDimmer', YokisClustersDefinition['manuSpecificYokisDimmer']), + m.deviceAddCustomCluster('manuSpecificYokisWindowCovering', YokisClustersDefinition['manuSpecificYokisWindowCovering']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisChannel', YokisClustersDefinition['manuSpecificYokisChannel']), + m.deviceAddCustomCluster('manuSpecificYokisPilotWire', YokisClustersDefinition['manuSpecificYokisPilotWire']), // Pending implementation + m.deviceAddCustomCluster('manuSpecificYokisTemperatureMeasurement', YokisClustersDefinition['manuSpecificYokisTemperatureMeasurement']), // Pending implementation + m.deviceEndpoints({endpoints: {'1': 1, '2': 2, '3': 3, '4': 4}}), + m.identify(), + m.commandsOnOff(), + m.commandsLevelCtrl(), + m.commandsWindowCovering(), // ...YokisDeviceExtend, // ...YokisInputExtend, // ...YokisChannelExtend, diff --git a/src/devices/zemismart.ts b/src/devices/zemismart.ts index 6fcc8846ef57e..c180ba8e3dc04 100644 --- a/src/devices/zemismart.ts +++ b/src/devices/zemismart.ts @@ -2,7 +2,7 @@ import fz from '../converters/fromZigbee'; import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import * as legacy from '../lib/legacy'; -import {deviceEndpoints, forcePowerSource, identify, light, onOff} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as tuya from '../lib/tuya'; import {DefinitionWithExtend} from '../lib/types'; @@ -51,14 +51,14 @@ const definitions: DefinitionWithExtend[] = [ model: 'LXZB-12A', vendor: 'Zemismart', description: 'RGB LED downlight', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['LXT56-LS27LX1.6'], model: 'HGZB-DLC4-N15B', vendor: 'Zemismart', description: 'RGB LED downlight', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, { zigbeeModel: ['TS0302'], @@ -77,10 +77,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0003', manufacturerName: '_TZ3000_vjhcenzo'}, - {modelID: 'TS0003', manufacturerName: '_TZ3000_f09j9qjb'}, - ], + fingerprint: tuya.fingerprint('TS0003', ['_TZ3000_vjhcenzo', '_TZ3000_f09j9qjb']), model: 'TB25', vendor: 'Zemismart', description: 'Smart light switch and socket - 2 gang with neutral wire', @@ -103,10 +100,10 @@ const definitions: DefinitionWithExtend[] = [ model: 'LXN56-SS27LX1.1', vendor: 'Zemismart', description: 'Smart light switch - 2 gang with neutral wire', - extend: [onOff()], + extend: [m.onOff()], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_zqtiam4u'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_zqtiam4u']), model: 'ZM-RM02', vendor: 'Zemismart', description: 'Smart 6 key scene switch', @@ -251,10 +248,7 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_gubdgai2'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_vdiuwbkq'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_gubdgai2', '_TZE200_vdiuwbkq']), model: 'M515EGBZTN', vendor: 'Zemismart', description: 'Roller shade driver', @@ -267,21 +261,17 @@ const definitions: DefinitionWithExtend[] = [ ], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_fzo2pocs'}], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_fzo2pocs']), model: 'ZM25TQ', vendor: 'Zemismart', description: 'Tubular motor', fromZigbee: [legacy.fz.tuya_cover, fz.ignore_basic_report], toZigbee: [legacy.tz.tuya_cover_control, legacy.tz.tuya_cover_options, legacy.tz.tuya_data_point_test], exposes: [e.cover_position().setAccess('position', ea.STATE_SET)], - extend: [forcePowerSource({powerSource: 'Mains (single phase)'})], + extend: [m.forcePowerSource({powerSource: 'Mains (single phase)'})], }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_1n2kyphz'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_shkxsgis'}, - {modelID: 'TS0601', manufacturerName: '_TZE204_shkxsgis'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_1n2kyphz', '_TZE200_shkxsgis', '_TZE204_shkxsgis']), model: 'TB26-4', vendor: 'Zemismart', description: '4-gang smart wall switch', @@ -307,10 +297,7 @@ const definitions: DefinitionWithExtend[] = [ }, }, { - fingerprint: [ - {modelID: 'TS0601', manufacturerName: '_TZE200_9mahtqtg'}, - {modelID: 'TS0601', manufacturerName: '_TZE200_r731zlxk'}, - ], + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_9mahtqtg', '_TZE200_r731zlxk']), model: 'TB26-6', vendor: 'Zemismart', description: '6-gang smart wall switch', @@ -346,8 +333,8 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Zemismart', description: 'Smart 2 poles outlet (20A + 10A)', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2}}), - identify(), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2}}), + m.identify(), tuya.modernExtend.tuyaOnOff({indicatorMode: true, onOffCountdown: true, childLock: true, endpoints: ['l1', 'l2']}), ], }, @@ -357,7 +344,7 @@ const definitions: DefinitionWithExtend[] = [ vendor: 'Zemismart', description: 'Smart 2 gangs switch with outlet', extend: [ - deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), + m.deviceEndpoints({endpoints: {l1: 1, l2: 2, l3: 3}}), tuya.modernExtend.tuyaOnOff({powerOutageMemory: true, indicatorMode: true, onOffCountdown: true, endpoints: ['l1', 'l2', 'l3']}), ], configure: tuya.configureMagicPacket, @@ -367,7 +354,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'ZMO-606-20A', vendor: 'Zemismart', description: 'Smart 20A outlet', - extend: [identify(), tuya.modernExtend.tuyaOnOff({indicatorMode: true, onOffCountdown: true, childLock: true})], + extend: [m.identify(), tuya.modernExtend.tuyaOnOff({indicatorMode: true, onOffCountdown: true, childLock: true})], }, ]; diff --git a/src/devices/zigbeetlc.ts b/src/devices/zigbeetlc.ts index 2ecb3eab007bb..b8aac8f2dc762 100644 --- a/src/devices/zigbeetlc.ts +++ b/src/devices/zigbeetlc.ts @@ -1,9 +1,9 @@ import {Zcl} from 'zigbee-herdsman'; -import {battery, binary, enumLookup, humidity, numeric, temperature} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; const extend = { - comfortDisplay: binary({ + comfortDisplay: m.binary({ name: 'comfort_display', valueOn: ['show', 0], valueOff: ['hide', 1], @@ -11,7 +11,7 @@ const extend = { attribute: {ID: 0x0002, type: Zcl.DataType.ENUM8}, description: 'Whether to show a comfort indicator on the device screen.', }), - comfortHumidityMax: numeric({ + comfortHumidityMax: m.numeric({ name: 'comfort_humidity_max', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -21,7 +21,7 @@ const extend = { scale: 100, description: 'Comfort parameters/Humidity maximum, in 1% steps, default 60.00%.', }), - comfortHumidityMin: numeric({ + comfortHumidityMin: m.numeric({ name: 'comfort_humidity_min', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -31,7 +31,7 @@ const extend = { scale: 100, description: 'Comfort parameters/Humidity minimum, in 1% steps, default 40.00%', }), - comfortTemperatureMin: numeric({ + comfortTemperatureMin: m.numeric({ name: 'comfort_temperature_min', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -42,7 +42,7 @@ const extend = { scale: 100, description: 'Comfort parameters/Temperature minimum, in 0.01°C steps, default 20.00°C.', }), - comfortTemperatureMax: numeric({ + comfortTemperatureMax: m.numeric({ name: 'comfort_temperature_max', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -53,7 +53,7 @@ const extend = { scale: 100, description: 'Comfort parameters/Temperature maximum, in 0.01°C steps, default 25.00°C.', }), - display: binary({ + display: m.binary({ name: 'display', valueOn: ['on', 0], valueOff: ['off', 1], @@ -61,7 +61,7 @@ const extend = { attribute: {ID: 0x0106, type: Zcl.DataType.ENUM8}, description: 'Whether to enable the device display.', }), - humidityCalibration: numeric({ + humidityCalibration: m.numeric({ name: 'humidity_calibration', unit: '%', cluster: 'hvacUserInterfaceCfg', @@ -72,7 +72,7 @@ const extend = { scale: 100, description: 'Humidity calibration, in 0.01% steps, default 0%.', }), - measurementInterval: numeric({ + measurementInterval: m.numeric({ name: 'measurement_interval', unit: 's', cluster: 'hvacUserInterfaceCfg', @@ -81,7 +81,7 @@ const extend = { valueMax: 255, description: 'Measurement interval, default 10 seconds.', }), - tempCalibration: numeric({ + tempCalibration: m.numeric({ name: 'temperature_calibration', unit: '°C', cluster: 'hvacUserInterfaceCfg', @@ -92,7 +92,7 @@ const extend = { scale: 100, description: 'Temperature calibration, in 0.01° steps, default 0 °C.', }), - tempDisplayMode: enumLookup({ + tempDisplayMode: m.enumLookup({ name: 'temperature_display_mode', lookup: {celsius: 0, fahrenheit: 1}, cluster: 'hvacUserInterfaceCfg', @@ -125,8 +125,8 @@ const definitions = [ vendor: 'Xiaomi', description: 'Temp & RH Monitor Lite (pvxx/ZigbeeTLc)', extend: [ - temperature({reporting: {min: 10, max: 300, change: 10}}), - humidity({reporting: {min: 10, max: 300, change: 50}}), + m.temperature({reporting: {min: 10, max: 300, change: 10}}), + m.humidity({reporting: {min: 10, max: 300, change: 50}}), extend.display, extend.tempDisplayMode, extend.comfortDisplay, @@ -137,7 +137,7 @@ const definitions = [ extend.tempCalibration, extend.humidityCalibration, extend.measurementInterval, - battery(), + m.battery(), ], ota: true, }, @@ -157,14 +157,14 @@ const definitions = [ vendor: 'Qingping', description: 'Temp & RH Monitor Lite (pvxx/ZigbeeTLc)', extend: [ - temperature({reporting: {min: 10, max: 300, change: 10}}), - humidity({reporting: {min: 10, max: 300, change: 50}}), + m.temperature({reporting: {min: 10, max: 300, change: 10}}), + m.humidity({reporting: {min: 10, max: 300, change: 50}}), extend.display, extend.tempDisplayMode, extend.tempCalibration, extend.humidityCalibration, extend.measurementInterval, - battery(), + m.battery(), ], ota: true, }, @@ -189,12 +189,12 @@ const definitions = [ vendor: 'Tuya', description: 'Temperature & Humidity Sensor (pvxx/ZigbeeTLc)', extend: [ - temperature({reporting: {min: 10, max: 300, change: 10}}), - humidity({reporting: {min: 10, max: 300, change: 50}}), + m.temperature({reporting: {min: 10, max: 300, change: 10}}), + m.humidity({reporting: {min: 10, max: 300, change: 50}}), extend.tempCalibration, extend.humidityCalibration, extend.measurementInterval, - battery(), + m.battery(), ], ota: true, }, diff --git a/src/devices/zipato.ts b/src/devices/zipato.ts index 645f419b3df32..7d8a2b02c359d 100644 --- a/src/devices/zipato.ts +++ b/src/devices/zipato.ts @@ -1,4 +1,4 @@ -import {light} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import {DefinitionWithExtend} from '../lib/types'; const definitions: DefinitionWithExtend[] = [ @@ -7,7 +7,7 @@ const definitions: DefinitionWithExtend[] = [ model: 'rgbw2.zbee27', vendor: 'Zipato', description: 'RGBW LED bulb with dimmer', - extend: [light({colorTemp: {range: undefined}, color: true})], + extend: [m.light({colorTemp: {range: undefined}, color: true})], }, ]; diff --git a/src/index.ts b/src/index.ts index 03cc7f569fc43..1c2f519289670 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,3 @@ -import type {Binary, Climate, Composite, Cover, Enum, Fan, Feature, Light, List, Lock, Numeric, Switch, Text} from './lib/exposes'; - import assert from 'assert'; import {Zcl} from 'zigbee-herdsman'; @@ -7,8 +5,24 @@ import {Zcl} from 'zigbee-herdsman'; import fromZigbee from './converters/fromZigbee'; import toZigbee from './converters/toZigbee'; import * as configureKey from './lib/configureKey'; +import { + access, + Binary, + Climate, + Composite, + Cover, + Enum, + Enum as EnumClass, + Fan, + Feature, + Light, + List, + Lock, + Numeric, + Switch, + Text, +} from './lib/exposes'; import * as exposesLib from './lib/exposes'; -import {Enum as EnumClass} from './lib/exposes'; import {generateDefinition} from './lib/generateDefinition'; import {logger} from './lib/logger'; import { @@ -41,6 +55,7 @@ const MODELS_INDEX = modelsIndexJson as unknown as Record; export type {Ota} from './lib/types'; export { IndexedDefinition as IndexedDefinition, + access as access, Definition as Definition, OnEventType as OnEventType, Feature as Feature, @@ -414,12 +429,10 @@ function prepareDefinition(definition: IndexedDefinition): Definition { toZigbee.zcl_command, ); - if (finalDefinition.exposes && Array.isArray(finalDefinition.exposes) && !finalDefinition.exposes.find((e) => e.name === 'linkquality')) { - finalDefinition.exposes = finalDefinition.exposes.concat([exposesLib.presets.linkquality()]); + if (definition.externalConverterName) { + validateDefinition(finalDefinition); } - validateDefinition(finalDefinition); - // Add all the options if (!finalDefinition.options) { finalDefinition.options = []; diff --git a/src/lib/exposes.ts b/src/lib/exposes.ts index 809726df637ef..e37e97c0a5586 100644 --- a/src/lib/exposes.ts +++ b/src/lib/exposes.ts @@ -789,6 +789,7 @@ export const options = { new Binary(`invert_cover`, access.SET, true, false).withDescription( `Inverts the cover position, false: open=100,close=0, true: open=0,close=100 (default false).`, ), + illuminance_raw: () => new Binary(`illuminance_raw`, access.SET, true, false).withDescription(`Expose the raw illuminance value.`), color_sync: () => new Binary(`color_sync`, access.SET, true, false).withDescription( `When enabled colors will be synced, e.g. if the light supports both color x/y and color temperature a conversion from color x/y to color temperature will be done when setting the x/y color (default true).`, @@ -1020,6 +1021,7 @@ export const presets = { new Numeric('holiday_temperature', access.STATE_SET).withUnit('°C').withDescription('Holiday temperature').withValueMin(0).withValueMax(30), humidity: () => new Numeric('humidity', access.STATE).withUnit('%').withDescription('Measured relative humidity'), illuminance: () => new Numeric('illuminance', access.STATE).withDescription('Measured illuminance').withUnit('lx'), + illuminance_raw: () => new Numeric('illuminance_raw', access.STATE).withDescription('Raw measured illuminance'), brightness_state: () => new Enum('brightness_state', access.STATE, ['low', 'middle', 'high', 'strong']).withDescription('Brightness state'), keypad_lockout: () => new Enum('keypad_lockout', access.ALL, ['unlock', 'lock1', 'lock2']).withDescription('Enables/disables physical input on the device'), @@ -1055,13 +1057,6 @@ export const presets = { ), ) .withCategory('config'), - linkquality: () => - new Numeric('linkquality', access.STATE) - .withUnit('lqi') - .withDescription('Link quality (signal strength)') - .withValueMin(0) - .withValueMax(255) - .withCategory('diagnostic'), local_temperature: () => new Numeric('local_temperature', access.STATE_GET).withUnit('°C').withDescription('Current temperature measured on the device'), lock: () => new Lock().withState('state', 'LOCK', 'UNLOCK', 'State of the lock').withLockState('lock_state', 'Actual state of the lock'), diff --git a/src/lib/generateDefinition.ts b/src/lib/generateDefinition.ts index a5af1ca32f33a..3f5f000cc0fad 100644 --- a/src/lib/generateDefinition.ts +++ b/src/lib/generateDefinition.ts @@ -57,27 +57,8 @@ function generateSource( resolvedDefinition: ResolvedDefinitionWithExtend, generatedExtend: GeneratedExtend[], ): string { - const imports: {[s: string]: string[]} = {}; - const importsDeduplication = new Set(); - - generatedExtend.forEach((e) => { - const lib = e.lib ?? 'modernExtend'; - - if (!(lib in imports)) { - imports[lib] = []; - } - - const importName = e.getSource().split('(')[0]; - - if (!importsDeduplication.has(importName)) { - importsDeduplication.add(importName); - imports[lib].push(importName); - } - }); - - const importsStr = Object.entries(imports) - .map((e) => `const {${e[1].join(', ')}} = require('zigbee-herdsman-converters/lib/${e[0]}');`) - .join('\n'); + const imports = [...new Set(generatedExtend.map((e) => e.lib ?? 'modernExtend'))]; + const importsStr = imports.map((e) => `const ${e == 'modernExtend' ? 'm' : e} = require('zigbee-herdsman-converters/lib/${e}');`).join('\n'); return `${importsStr} @@ -86,7 +67,7 @@ const definition = { model: '${definition.model}', vendor: '${definition.vendor}', description: 'Automatically generated definition', - extend: [${generatedExtend.map((e) => e.getSource()).join(', ')}], + extend: [${generatedExtend.map((e) => `${e.lib ?? 'm'}.${e.getSource()}`).join(', ')}], meta: ${JSON.stringify(resolvedDefinition.meta || {})}, }; diff --git a/src/lib/ikea.ts b/src/lib/ikea.ts index 16add94db2f61..68e48924eca3b 100644 --- a/src/lib/ikea.ts +++ b/src/lib/ikea.ts @@ -5,17 +5,7 @@ import {Zcl} from 'zigbee-herdsman'; import tz from '../converters/toZigbee'; import * as constants from '../lib/constants'; import {access, options, presets} from '../lib/exposes'; -import { - deviceAddCustomCluster, - LightArgs, - light as lightDontUse, - numeric, - NumericArgs, - ReportingConfigWithoutAttribute, - setupConfigureForBinding, - setupConfigureForReporting, - TIME_LOOKUP, -} from '../lib/modernExtend'; +import * as m from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; import * as globalStore from '../lib/store'; import {Configure, Expose, Fz, KeyValue, KeyValueAny, ModernExtend, OnEvent, Range, Tz} from '../lib/types'; @@ -31,6 +21,9 @@ import { precisionRound, replaceToZigbeeConvertersInArray, } from '../lib/utils'; +import {logger} from './logger'; + +const NS = 'zhc:ikea'; export const manufacturerOptions = {manufacturerCode: Zcl.ManufacturerCode.IKEA_OF_SWEDEN}; @@ -85,12 +78,12 @@ const bulbOnEvent: OnEvent = async (type, data, device, options, state: KeyValue } }; -export function ikeaLight(args?: Omit & {colorTemp?: true | {range: Range; viaColor: true}}) { +export function ikeaLight(args?: Omit & {colorTemp?: true | {range: Range; viaColor: true}}) { const colorTemp: {range: Range} = args?.colorTemp ? (args.colorTemp === true ? {range: [250, 454]} : args.colorTemp) : undefined; const levelConfig: {disabledFeatures?: string[]} = args?.levelConfig ? args.levelConfig : {disabledFeatures: ['on_off_transition_time', 'on_transition_time', 'off_transition_time', 'on_level']}; - const result = lightDontUse({...args, colorTemp, levelConfig}); + const result = m.light({...args, colorTemp, levelConfig}); result.ota = true; result.onEvent = bulbOnEvent; if (isObject(args?.colorTemp) && args.colorTemp.viaColor) { @@ -171,10 +164,10 @@ export function ikeaBattery(): ModernExtend { }, ]; - const defaultReporting: ReportingConfigWithoutAttribute = {min: '1_HOUR', max: 'MAX', change: 10}; + const defaultReporting: m.ReportingConfigWithoutAttribute = {min: '1_HOUR', max: 'MAX', change: 10}; const configure: Configure[] = [ - setupConfigureForReporting('genPowerCfg', 'batteryPercentageRemaining', defaultReporting, access.STATE_GET), + m.setupConfigureForReporting('genPowerCfg', 'batteryPercentageRemaining', defaultReporting, access.STATE_GET), configureSetPowerSourceWhenUnknown('Battery'), ]; @@ -198,16 +191,20 @@ export function ikeaConfigureStyrbar(): ModernExtend { export function ikeaConfigureRemote(): ModernExtend { const configure: Configure[] = [ async (device, coordinatorEndpoint, definition) => { - // Firmware 2.3.075 >= only supports binding to endpoint, before only to group - // - https://github.com/Koenkk/zigbee2mqtt/issues/2772#issuecomment-577389281 - // - https://github.com/Koenkk/zigbee2mqtt/issues/7716 - const endpoint = device.getEndpoint(1); - const version = device.softwareBuildID.split('.').map((n) => Number(n)); - const bindTarget = - version[0] > 2 || (version[0] == 2 && version[1] > 3) || (version[0] == 2 && version[1] == 3 && version[2] >= 75) - ? coordinatorEndpoint - : constants.defaultBindGroup; - await endpoint.bind('genOnOff', bindTarget); + if (device.softwareBuildID) { + // Firmware 2.3.075 >= only supports binding to endpoint, before only to group + // - https://github.com/Koenkk/zigbee2mqtt/issues/2772#issuecomment-577389281 + // - https://github.com/Koenkk/zigbee2mqtt/issues/7716 + const endpoint = device.getEndpoint(1); + const version = device.softwareBuildID.split('.').map((n) => Number(n)); + const bindTarget = + version[0] > 2 || (version[0] == 2 && version[1] > 3) || (version[0] == 2 && version[1] == 3 && version[2] >= 75) + ? coordinatorEndpoint + : constants.defaultBindGroup; + await endpoint.bind('genOnOff', bindTarget); + } else { + logger.warning(`Could not correctly configure '${device.softwareBuildID}' since softwareBuildID is missing, try re-pairing it`, NS); + } }, ]; @@ -418,8 +415,8 @@ export function ikeaAirPurifier(): ModernExtend { [ { attribute: 'particulateMatter25Measurement', - minimumReportInterval: TIME_LOOKUP['1_MINUTE'], - maximumReportInterval: TIME_LOOKUP['1_HOUR'], + minimumReportInterval: m.TIME_LOOKUP['1_MINUTE'], + maximumReportInterval: m.TIME_LOOKUP['1_HOUR'], reportableChange: 1, }, ], @@ -430,8 +427,8 @@ export function ikeaAirPurifier(): ModernExtend { [ { attribute: 'filterRunTime', - minimumReportInterval: TIME_LOOKUP['1_HOUR'], - maximumReportInterval: TIME_LOOKUP['1_HOUR'], + minimumReportInterval: m.TIME_LOOKUP['1_HOUR'], + maximumReportInterval: m.TIME_LOOKUP['1_HOUR'], reportableChange: 0, }, ], @@ -439,12 +436,12 @@ export function ikeaAirPurifier(): ModernExtend { ); await endpoint.configureReporting( 'manuSpecificIkeaAirPurifier', - [{attribute: 'fanMode', minimumReportInterval: 0, maximumReportInterval: TIME_LOOKUP['1_HOUR'], reportableChange: 1}], + [{attribute: 'fanMode', minimumReportInterval: 0, maximumReportInterval: m.TIME_LOOKUP['1_HOUR'], reportableChange: 1}], manufacturerOptions, ); await endpoint.configureReporting( 'manuSpecificIkeaAirPurifier', - [{attribute: 'fanSpeed', minimumReportInterval: 0, maximumReportInterval: TIME_LOOKUP['1_HOUR'], reportableChange: 1}], + [{attribute: 'fanSpeed', minimumReportInterval: 0, maximumReportInterval: m.TIME_LOOKUP['1_HOUR'], reportableChange: 1}], manufacturerOptions, ); @@ -455,8 +452,8 @@ export function ikeaAirPurifier(): ModernExtend { return {exposes, fromZigbee, toZigbee, configure, isModernExtend: true}; } -export function ikeaVoc(args?: Partial) { - return numeric({ +export function ikeaVoc(args?: Partial) { + return m.numeric({ name: 'voc_index', label: 'VOC index', cluster: 'manuSpecificIkeaVocIndexMeasurement', @@ -675,7 +672,7 @@ export function ikeaDotsClick(args: {actionLookup?: KeyValue; dotsPrefix?: boole }, ]; - const configure: Configure[] = [setupConfigureForBinding('tradfriButton', 'output', args.endpointNames)]; + const configure: Configure[] = [m.setupConfigureForBinding('tradfriButton', 'output', args.endpointNames)]; return {exposes, fromZigbee, configure, isModernExtend: true}; } @@ -725,7 +722,7 @@ export function ikeaArrowClick(args?: {styrbar?: boolean; bind?: boolean}): Mode const result: ModernExtend = {exposes, fromZigbee, isModernExtend: true}; - if (args.bind) result.configure = [setupConfigureForBinding('genScenes', 'output')]; + if (args.bind) result.configure = [m.setupConfigureForBinding('genScenes', 'output')]; return result; } @@ -764,13 +761,13 @@ export function ikeaMediaCommands(): ModernExtend { }, ]; - const configure: Configure[] = [setupConfigureForBinding('genLevelCtrl', 'output')]; + const configure: Configure[] = [m.setupConfigureForBinding('genLevelCtrl', 'output')]; return {exposes, fromZigbee, configure, isModernExtend: true}; } export function addCustomClusterManuSpecificIkeaAirPurifier(): ModernExtend { - return deviceAddCustomCluster('manuSpecificIkeaAirPurifier', { + return m.deviceAddCustomCluster('manuSpecificIkeaAirPurifier', { ID: 0xfc7d, manufacturerCode: Zcl.ManufacturerCode.IKEA_OF_SWEDEN, attributes: { @@ -790,7 +787,7 @@ export function addCustomClusterManuSpecificIkeaAirPurifier(): ModernExtend { } export function addCustomClusterManuSpecificIkeaVocIndexMeasurement(): ModernExtend { - return deviceAddCustomCluster('manuSpecificIkeaVocIndexMeasurement', { + return m.deviceAddCustomCluster('manuSpecificIkeaVocIndexMeasurement', { ID: 0xfc7e, manufacturerCode: Zcl.ManufacturerCode.IKEA_OF_SWEDEN, attributes: { @@ -807,7 +804,7 @@ export function addCustomClusterManuSpecificIkeaVocIndexMeasurement(): ModernExt // Also observed on some older devices that had a post DIRIGERA release fw update. // No attributes known. export function addCustomClusterManuSpecificIkeaUnknown(): ModernExtend { - return deviceAddCustomCluster('manuSpecificIkeaUnknown', { + return m.deviceAddCustomCluster('manuSpecificIkeaUnknown', { ID: 0xfc7c, manufacturerCode: Zcl.ManufacturerCode.IKEA_OF_SWEDEN, attributes: {}, diff --git a/src/lib/lumi.ts b/src/lib/lumi.ts index 93a5e26a37e1e..0c10ff69674a7 100644 --- a/src/lib/lumi.ts +++ b/src/lib/lumi.ts @@ -1906,6 +1906,7 @@ export const lumiModernExtend = { access: 'ALL', entityCategory: 'config', zigbeeCommandOptions: {manufacturerCode}, + reporting: false, ...args, }), lumiButtonLock: (args?: Partial) => @@ -1932,6 +1933,7 @@ export const lumiModernExtend = { access: 'ALL', entityCategory: 'config', zigbeeCommandOptions: {manufacturerCode}, + reporting: false, ...args, }), lumiPreventReset: (): ModernExtend => { @@ -2744,7 +2746,7 @@ export const fromZigbee = { result['window_open'] = getFromLookup(value, {1: true, 0: false}); break; case 0x0275: - result['valve_alarm'] = getFromLookup(value, {1: true, 0: false}); + result['valve_alarm'] = getFromLookup(value, {1: true, 0: false, 4: true}); break; case 247: { // @ts-expect-error ignore @@ -2848,10 +2850,10 @@ export const fromZigbee = { type: ['attributeReport', 'readResponse'], convert: (model, msg, publish, options, meta) => { if (msg.data['65328']) { - const data = msg.data['65328']; - const state = data.substr(2, 2); - const action = data.substr(4, 2); - const keynum = data.substr(6, 2); + const data = `0x${msg.data['65328'].toString(16)}`; + const state = Number(data.substring(2, 4)); + const action = Number(data.substring(4, 6)); + const keynum = Number(data.substring(6, 8)); if (state == 11) { if (action == 1) { // unknown key @@ -3893,7 +3895,7 @@ export const toZigbee = { await entity.write( 'manuSpecificLumi', { - 0x0277: {value: getFromLookup(value, {false: 0, true: 1}, undefined, true), type: 0x20}, + 0x0277: {value: getFromLookup(value, {UNLOCK: 0, LOCK: 1}), type: 0x20}, }, {manufacturerCode: manufacturerCode}, ); diff --git a/src/lib/modernExtend.ts b/src/lib/modernExtend.ts index 762694b138085..5ed6bb0362f38 100644 --- a/src/lib/modernExtend.ts +++ b/src/lib/modernExtend.ts @@ -12,6 +12,7 @@ import { BatteryLinearVoltage, BatteryNonLinearVoltage, Configure, + DefinitionExposes, DefinitionExposesFunction, DefinitionMeta, Expose, @@ -651,7 +652,7 @@ export function illuminance(args?: Partial): ModernExtend { return result; }; - return numeric({ + const result = numeric({ name: 'illuminance', cluster: 'msIlluminanceMeasurement', attribute: 'measuredValue', @@ -662,6 +663,24 @@ export function illuminance(args?: Partial): ModernExtend { access: 'STATE_GET', ...args, }); + + const fzIlluminanceRaw = { + cluster: 'msIlluminanceMeasurement', + type: ['attributeReport', 'readResponse'], + options: [opt.illuminance_raw()], + convert: (model, msg, publish, options, meta) => { + if (options.illuminance_raw) { + return {illuminance_raw: msg.data['measuredValue']}; + } + }, + } satisfies Fz.Converter; + result.fromZigbee.push(fzIlluminanceRaw); + const exposeIlluminanceRaw: DefinitionExposes = (device, options) => { + return options?.illuminance_raw ? [e.illuminance_raw()] : []; + }; + result.exposes.push(exposeIlluminanceRaw); + + return result; } export function temperature(args?: Partial) { @@ -922,15 +941,18 @@ export function occupancy(args?: OccupancyArgs): ModernExtend { } export function co2(args?: Partial) { + const fractionOf1: ScaleFunction = (value: number, type: 'from' | 'to') => { + return 1 / value; + }; return numeric({ name: 'co2', cluster: 'msCO2', label: 'CO2', attribute: 'measuredValue', - reporting: {min: '10_SECONDS', max: '1_HOUR', change: 0.00005}, // 50 ppm change + reporting: {min: '10_SECONDS', max: '1_HOUR', change: fractionOf1(50 /*ppm*/, 'to')}, description: 'Measured value', unit: 'ppm', - scale: 0.000001, + scale: fractionOf1, access: 'STATE_GET', ...args, }); @@ -2082,7 +2104,7 @@ export interface NumericArgs { access?: 'STATE' | 'STATE_GET' | 'STATE_SET' | 'SET' | 'ALL'; unit?: string; endpointNames?: string[]; - reporting?: ReportingConfigWithoutAttribute; + reporting?: false | ReportingConfigWithoutAttribute; valueMin?: number; valueMax?: number; valueStep?: number; @@ -2196,7 +2218,10 @@ export function numeric(args: NumericArgs): ModernExtend { }, ]; - const configure: Configure[] = [setupConfigureForReporting(cluster, attribute, reporting, access, endpoints)]; + const configure: Configure[] = []; + if (reporting) { + configure.push(setupConfigureForReporting(cluster, attribute, reporting, access, endpoints)); + } return {exposes, fromZigbee, toZigbee, configure, isModernExtend: true}; } @@ -2210,7 +2235,7 @@ export interface BinaryArgs { description: string; zigbeeCommandOptions?: {manufacturerCode: number}; endpointName?: string; - reporting?: ReportingConfig; + reporting?: false | ReportingConfig; access?: 'STATE' | 'STATE_GET' | 'STATE_SET' | 'SET' | 'ALL'; entityCategory?: 'config' | 'diagnostic'; } @@ -2258,7 +2283,10 @@ export function binary(args: BinaryArgs): ModernExtend { }, ]; - const configure: Configure[] = [setupConfigureForReporting(cluster, attribute, reporting, access)]; + const configure: Configure[] = []; + if (reporting) { + configure.push(setupConfigureForReporting(cluster, attribute, reporting, access)); + } return {exposes: [expose], fromZigbee, toZigbee, configure, isModernExtend: true}; } diff --git a/src/lib/tuya.ts b/src/lib/tuya.ts index d5683dbb45fd6..9979d4c8a676d 100644 --- a/src/lib/tuya.ts +++ b/src/lib/tuya.ts @@ -1854,6 +1854,7 @@ const tuyaFz = { cluster: 'manuSpecificTuya', type: ['commandDataResponse', 'commandDataReport', 'commandActiveStatusReport', 'commandActiveStatusReportAlt'], convert: (model, msg, publish, options, meta) => { + if (utils.hasAlreadyProcessedMessage(msg, model, msg.data.seq)) return; const result: KeyValue = {}; if (!model.meta || !model.meta.tuyaDatapoints) throw new Error('No datapoints map defined'); const datapoints = model.meta.tuyaDatapoints; diff --git a/test/generateDefinition.test.ts b/test/generateDefinition.test.ts index 288e40fe437e6..a3b42419fe6eb 100644 --- a/test/generateDefinition.test.ts +++ b/test/generateDefinition.test.ts @@ -25,7 +25,7 @@ describe('GenerateDefinition', () => { meta: undefined, fromZigbee: [], toZigbee: [], - exposes: ['linkquality'], + exposes: [], bind: [], read: [], configureReporting: [], @@ -38,7 +38,7 @@ describe('GenerateDefinition', () => { meta: undefined, fromZigbee: [expect.objectContaining({cluster: 'msTemperatureMeasurement'})], toZigbee: ['temperature'], - exposes: ['linkquality', 'temperature'], + exposes: ['temperature'], bind: {1: ['msTemperatureMeasurement']}, read: {1: [['msTemperatureMeasurement', ['measuredValue']]]}, configureReporting: { @@ -53,7 +53,7 @@ describe('GenerateDefinition', () => { meta: undefined, fromZigbee: [expect.objectContaining({cluster: 'msPressureMeasurement'})], toZigbee: ['pressure'], - exposes: ['linkquality', 'pressure'], + exposes: ['pressure'], bind: {1: ['msPressureMeasurement']}, read: {1: [['msPressureMeasurement', ['measuredValue']]]}, configureReporting: { @@ -68,7 +68,7 @@ describe('GenerateDefinition', () => { meta: undefined, fromZigbee: [expect.objectContaining({cluster: 'msRelativeHumidity'})], toZigbee: ['humidity'], - exposes: ['humidity', 'linkquality'], + exposes: ['humidity'], bind: {1: ['msRelativeHumidity']}, read: {1: [['msRelativeHumidity', ['measuredValue']]]}, configureReporting: { @@ -87,7 +87,7 @@ describe('GenerateDefinition', () => { meta: undefined, fromZigbee: [expect.objectContaining({cluster: 'msTemperatureMeasurement'}), fz.on_off], toZigbee: ['temperature', 'state', 'on_time', 'off_wait_time'], - exposes: ['linkquality', 'switch(state)', 'temperature'], + exposes: ['switch(state)', 'temperature'], bind: {1: ['msTemperatureMeasurement', 'genOnOff']}, read: { 1: [ @@ -102,14 +102,14 @@ describe('GenerateDefinition', () => { ], }, externalDefintionSource: ` -const {temperature, onOff} = require('zigbee-herdsman-converters/lib/modernExtend'); +const m = require('zigbee-herdsman-converters/lib/modernExtend'); const definition = { zigbeeModel: ['combo'], model: 'combo', vendor: 'vendor', description: 'Automatically generated definition', - extend: [temperature(), onOff({"powerOnBehavior":false})], + extend: [m.temperature(), m.onOff({"powerOnBehavior":false})], meta: {}, }; @@ -128,7 +128,7 @@ module.exports = definition; meta: undefined, fromZigbee: [expect.objectContaining({cluster: 'msTemperatureMeasurement'}), fz.on_off], toZigbee: ['temperature', 'state', 'on_time', 'off_wait_time'], - exposes: ['linkquality', 'switch(state)', 'temperature'], + exposes: ['switch(state)', 'temperature'], bind: {2: ['msTemperatureMeasurement', 'genOnOff']}, read: { 2: [ @@ -143,14 +143,14 @@ module.exports = definition; ], }, externalDefintionSource: ` -const {temperature, onOff} = require('zigbee-herdsman-converters/lib/modernExtend'); +const m = require('zigbee-herdsman-converters/lib/modernExtend'); const definition = { zigbeeModel: ['combo'], model: 'combo', vendor: 'vendor', description: 'Automatically generated definition', - extend: [temperature(), onOff({"powerOnBehavior":false})], + extend: [m.temperature(), m.onOff({"powerOnBehavior":false})], meta: {}, }; @@ -172,7 +172,7 @@ module.exports = definition; endpoints: {'1': 1, '2': 2}, fromZigbee: [expect.objectContaining({cluster: 'msTemperatureMeasurement'}), fz.on_off], toZigbee: ['temperature', 'state', 'on_time', 'off_wait_time'], - exposes: ['linkquality', 'switch(state)', 'temperature', 'temperature'], + exposes: ['switch(state)', 'temperature', 'temperature'], bind: {1: ['msTemperatureMeasurement', 'genOnOff'], 2: ['msTemperatureMeasurement']}, read: { 1: [ @@ -189,14 +189,14 @@ module.exports = definition; 2: [['msTemperatureMeasurement', [reportingItem('measuredValue', 10, repInterval.HOUR, 100)]]], }, externalDefintionSource: ` -const {deviceEndpoints, temperature, onOff} = require('zigbee-herdsman-converters/lib/modernExtend'); +const m = require('zigbee-herdsman-converters/lib/modernExtend'); const definition = { zigbeeModel: ['combo'], model: 'combo', vendor: '', description: 'Automatically generated definition', - extend: [deviceEndpoints({"endpoints":{"1":1,"2":2}}), temperature({"endpointNames":["1","2"]}), onOff({"powerOnBehavior":false})], + extend: [m.deviceEndpoints({"endpoints":{"1":1,"2":2}}), m.temperature({"endpointNames":["1","2"]}), m.onOff({"powerOnBehavior":false})], meta: {"multiEndpoint":true}, }; @@ -222,8 +222,6 @@ module.exports = definition; 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -249,7 +247,7 @@ module.exports = definition; 'flash', 'power_on_behavior', ], - exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy)', 'linkquality', 'power_on_behavior'], + exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy)', 'power_on_behavior'], bind: {}, read: { 1: [ @@ -259,14 +257,14 @@ module.exports = definition; }, configureReporting: {}, externalDefintionSource: ` -const {light} = require('zigbee-herdsman-converters/lib/modernExtend'); +const m = require('zigbee-herdsman-converters/lib/modernExtend'); const definition = { zigbeeModel: ['combo'], model: 'combo', vendor: '', description: 'Automatically generated definition', - extend: [light({"colorTemp":{"range":[100,500]},"color":{"enhancedHue":true}})], + extend: [m.light({"colorTemp":{"range":[100,500]},"color":{"enhancedHue":true}})], meta: {}, }; @@ -292,8 +290,6 @@ module.exports = definition; 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -319,7 +315,7 @@ module.exports = definition; 'flash', 'power_on_behavior', ], - exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy)', 'linkquality', 'power_on_behavior'], + exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy)', 'power_on_behavior'], bind: {}, read: { 1: [ @@ -329,14 +325,14 @@ module.exports = definition; }, configureReporting: {}, externalDefintionSource: ` -const {light} = require('zigbee-herdsman-converters/lib/modernExtend'); +const m = require('zigbee-herdsman-converters/lib/modernExtend'); const definition = { zigbeeModel: ['combo'], model: 'combo', vendor: '', description: 'Automatically generated definition', - extend: [light({"colorTemp":{"range":[100,500]},"color":{"enhancedHue":true}})], + extend: [m.light({"colorTemp":{"range":[100,500]},"color":{"enhancedHue":true}})], meta: {}, }; @@ -366,8 +362,6 @@ module.exports = definition; 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -395,7 +389,7 @@ module.exports = definition; 'hue_power_on_color', 'effect', ], - exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy,color_hs)', 'linkquality', 'power_on_behavior'], + exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy,color_hs)', 'power_on_behavior'], bind: {}, read: { 1: [ @@ -405,14 +399,14 @@ module.exports = definition; }, configureReporting: [], externalDefintionSource: ` -const {philipsLight} = require('zigbee-herdsman-converters/lib/philips'); +const philips = require('zigbee-herdsman-converters/lib/philips'); const definition = { zigbeeModel: ['combo'], model: 'combo', vendor: '', description: 'Automatically generated definition', - extend: [philipsLight({"colorTemp":{"range":[100,500]},"color":{"enhancedHue":true}})], + extend: [philips.philipsLight({"colorTemp":{"range":[100,500]},"color":{"enhancedHue":true}})], meta: {}, }; @@ -456,7 +450,7 @@ module.exports = definition; 'ac_frequency', 'power_factor', ], - exposes: ['current', 'energy', 'linkquality', 'power', 'switch(state)', 'voltage'], + exposes: ['current', 'energy', 'power', 'switch(state)', 'voltage'], bind: {1: ['genOnOff', 'haElectricalMeasurement', 'seMetering']}, read: { 1: [ @@ -484,14 +478,14 @@ module.exports = definition; ], }, externalDefintionSource: ` -const {onOff, electricityMeter} = require('zigbee-herdsman-converters/lib/modernExtend'); +const m = require('zigbee-herdsman-converters/lib/modernExtend'); const definition = { zigbeeModel: ['combo'], model: 'combo', vendor: '', description: 'Automatically generated definition', - extend: [onOff({"powerOnBehavior":false}), electricityMeter()], + extend: [m.onOff({"powerOnBehavior":false}), m.electricityMeter()], meta: {}, }; diff --git a/test/index.test.js b/test/index.test.js index 0cdf0b0eae560..4a0c2e6f32a71 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -100,7 +100,7 @@ describe('index.js', () => { expect(definition.extend).toBeUndefined(); expect(definition.fromZigbee).toHaveLength(0); expect(definition.toZigbee).toHaveLength(11); - expect(definition.exposes).toHaveLength(1); + expect(definition.exposes).toHaveLength(0); expect(definition.options).toHaveLength(0); }); @@ -567,14 +567,6 @@ describe('index.js', () => { }); }); - it('Function exposes should have linkquality sensor', () => { - definitions.forEach((definition) => { - if (typeof definition.exposes == 'function') { - expect(definition.exposes().find((e) => e.property === 'linkquality')).not.toBeUndefined(); - } - }); - }); - it('Verify options filter', () => { const ZNCLDJ12LM = definitions.find((d) => d.model == 'ZNCLDJ12LM'); expect(ZNCLDJ12LM.options.length).toBe(1); @@ -632,16 +624,7 @@ describe('index.js', () => { it('Should allow definition with both modern extend and exposes as function', () => { const MOSZB140 = findByModel('MOSZB-140'); const exposes = MOSZB140.exposes(); - expect(exposes.map((e) => e.name)).toStrictEqual([ - 'occupancy', - 'tamper', - 'battery_low', - 'linkquality', - 'temperature', - 'illuminance', - 'battery', - 'voltage', - ]); + expect(exposes.map((e) => e.name)).toStrictEqual(['occupancy', 'tamper', 'battery_low', 'temperature', 'illuminance', 'battery', 'voltage']); }); it('Check getFromLookup', () => { diff --git a/test/modernExtend.test.ts b/test/modernExtend.test.ts index 3395c9f524c1f..080948217bc2b 100644 --- a/test/modernExtend.test.ts +++ b/test/modernExtend.test.ts @@ -15,8 +15,6 @@ describe('ModernExtend', () => { 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -29,7 +27,7 @@ describe('ModernExtend', () => { 'flash', 'power_on_behavior', ], - exposes: ['effect', 'light(state,brightness)', 'linkquality', 'power_on_behavior'], + exposes: ['effect', 'light(state,brightness)', 'power_on_behavior'], bind: [], read: [], configureReporting: [], @@ -45,8 +43,6 @@ describe('ModernExtend', () => { 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -67,7 +63,7 @@ describe('ModernExtend', () => { 'flash', 'power_on_behavior', ], - exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup)', 'linkquality', 'power_on_behavior'], + exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup)', 'power_on_behavior'], bind: [], read: { 1: [ @@ -88,8 +84,6 @@ describe('ModernExtend', () => { 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -114,7 +108,7 @@ describe('ModernExtend', () => { 'flash', 'power_on_behavior', ], - exposes: ['effect', 'light(state,brightness,color_temp,color_xy,color_hs)', 'linkquality', 'power_on_behavior'], + exposes: ['effect', 'light(state,brightness,color_temp,color_xy,color_hs)', 'power_on_behavior'], bind: [], read: { 1: [ @@ -135,8 +129,6 @@ describe('ModernExtend', () => { 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -162,7 +154,7 @@ describe('ModernExtend', () => { 'flash', 'power_on_behavior', ], - exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy)', 'linkquality', 'power_on_behavior'], + exposes: ['effect', 'light(state,brightness,color_temp,color_temp_startup,color_xy)', 'power_on_behavior'], bind: [], read: { 1: [ @@ -191,7 +183,7 @@ describe('ModernExtend', () => { 'ac_frequency', 'power_factor', ], - exposes: ['current', 'energy', 'linkquality', 'power', 'switch(state)', 'voltage'], + exposes: ['current', 'energy', 'power', 'switch(state)', 'voltage'], bind: {1: ['genOnOff', 'haElectricalMeasurement', 'seMetering']}, read: { 1: [ @@ -237,8 +229,6 @@ describe('ModernExtend', () => { 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -273,7 +263,7 @@ describe('ModernExtend', () => { 'gradient', 'gradient_scene', 'light(state,brightness,color_temp,color_temp_startup,color_xy,color_hs)', - 'linkquality', + 'power_on_behavior', ], bind: {1: ['manuSpecificPhilips2']}, @@ -304,8 +294,6 @@ describe('ModernExtend', () => { 'state', 'brightness', 'brightness_percent', - 'on_time', - 'off_wait_time', 'transition', 'level_config', 'rate', @@ -329,7 +317,6 @@ describe('ModernExtend', () => { 'light_l1(state,brightness)', 'light_l2(state,brightness)', 'light_s1(state,brightness)', - 'linkquality', ], bind: { 10: ['genOnOff', 'genLevelCtrl'], @@ -380,7 +367,7 @@ describe('ModernExtend', () => { meta: {multiEndpoint: true}, fromZigbee: [fz.on_off], toZigbee: ['state', 'on_time', 'off_wait_time'], - exposes: ['linkquality', 'switch_bottom(state)', 'switch_top(state)'], + exposes: ['switch_bottom(state)', 'switch_top(state)'], bind: { 1: ['genOnOff'], 2: ['genOnOff'], @@ -412,7 +399,7 @@ describe('ModernExtend', () => { expect.objectContaining({cluster: 'manuSpecificLumi'}), ], toZigbee: ['air_quality', 'voc', 'temperature', 'humidity', 'display_unit'], - exposes: ['air_quality', 'battery', 'device_temperature', 'display_unit', 'humidity', 'linkquality', 'temperature', 'voc', 'voltage'], + exposes: ['air_quality', 'battery', 'device_temperature', 'display_unit', 'humidity', 'temperature', 'voc', 'voltage'], bind: { 1: ['genPowerCfg', 'genAnalogInput', 'msTemperatureMeasurement', 'msRelativeHumidity'], },