zigbee-herdsman-converters 21.9.0 → 21.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/converters/fromZigbee.d.ts +2036 -0
- package/converters/fromZigbee.d.ts.map +1 -0
- package/converters/fromZigbee.js +5343 -0
- package/converters/fromZigbee.js.map +1 -0
- package/converters/toZigbee.d.ts +1578 -0
- package/converters/toZigbee.d.ts.map +1 -0
- package/converters/toZigbee.js +4422 -0
- package/converters/toZigbee.js.map +1 -0
- package/devices/ITCommander.d.ts +4 -0
- package/devices/ITCommander.d.ts.map +1 -0
- package/devices/ITCommander.js +77 -0
- package/devices/ITCommander.js.map +1 -0
- package/devices/acova.d.ts +4 -0
- package/devices/acova.d.ts.map +1 -0
- package/devices/acova.js +127 -0
- package/devices/acova.js.map +1 -0
- package/devices/acuity_brands_lighting.d.ts +4 -0
- package/devices/acuity_brands_lighting.d.ts.map +1 -0
- package/devices/acuity_brands_lighting.js +29 -0
- package/devices/acuity_brands_lighting.js.map +1 -0
- package/devices/adeo.d.ts +4 -0
- package/devices/adeo.d.ts.map +1 -0
- package/devices/adeo.js +486 -0
- package/devices/adeo.js.map +1 -0
- package/devices/adurosmart.d.ts +4 -0
- package/devices/adurosmart.d.ts.map +1 -0
- package/devices/adurosmart.js +183 -0
- package/devices/adurosmart.js.map +1 -0
- package/devices/aeotec.d.ts +4 -0
- package/devices/aeotec.d.ts.map +1 -0
- package/devices/aeotec.js +66 -0
- package/devices/aeotec.js.map +1 -0
- package/devices/airam.d.ts +4 -0
- package/devices/airam.d.ts.map +1 -0
- package/devices/airam.js +106 -0
- package/devices/airam.js.map +1 -0
- package/devices/airzone_aidoo.d.ts +4 -0
- package/devices/airzone_aidoo.d.ts.map +1 -0
- package/devices/airzone_aidoo.js +81 -0
- package/devices/airzone_aidoo.js.map +1 -0
- package/devices/ajax_online.d.ts +4 -0
- package/devices/ajax_online.d.ts.map +1 -0
- package/devices/ajax_online.js +84 -0
- package/devices/ajax_online.js.map +1 -0
- package/devices/akuvox.d.ts +4 -0
- package/devices/akuvox.d.ts.map +1 -0
- package/devices/akuvox.js +68 -0
- package/devices/akuvox.js.map +1 -0
- package/devices/alchemy.d.ts +4 -0
- package/devices/alchemy.d.ts.map +1 -0
- package/devices/alchemy.js +22 -0
- package/devices/alchemy.js.map +1 -0
- package/devices/aldi.d.ts +4 -0
- package/devices/aldi.d.ts.map +1 -0
- package/devices/aldi.js +57 -0
- package/devices/aldi.js.map +1 -0
- package/devices/alecto.d.ts +4 -0
- package/devices/alecto.d.ts.map +1 -0
- package/devices/alecto.js +101 -0
- package/devices/alecto.js.map +1 -0
- package/devices/amina.d.ts +4 -0
- package/devices/amina.d.ts.map +1 -0
- package/devices/amina.js +370 -0
- package/devices/amina.js.map +1 -0
- package/devices/anchor.d.ts +4 -0
- package/devices/anchor.d.ts.map +1 -0
- package/devices/anchor.js +15 -0
- package/devices/anchor.js.map +1 -0
- package/devices/atlantic.d.ts +4 -0
- package/devices/atlantic.d.ts.map +1 -0
- package/devices/atlantic.js +146 -0
- package/devices/atlantic.js.map +1 -0
- package/devices/atsmart.d.ts +4 -0
- package/devices/atsmart.d.ts.map +1 -0
- package/devices/atsmart.js +15 -0
- package/devices/atsmart.js.map +1 -0
- package/devices/aubess.d.ts +4 -0
- package/devices/aubess.d.ts.map +1 -0
- package/devices/aubess.js +60 -0
- package/devices/aubess.js.map +1 -0
- package/devices/aurora_lighting.d.ts +4 -0
- package/devices/aurora_lighting.d.ts.map +1 -0
- package/devices/aurora_lighting.js +338 -0
- package/devices/aurora_lighting.js.map +1 -0
- package/devices/automaton.d.ts +4 -0
- package/devices/automaton.d.ts.map +1 -0
- package/devices/automaton.js +65 -0
- package/devices/automaton.js.map +1 -0
- package/devices/avatto.d.ts +4 -0
- package/devices/avatto.d.ts.map +1 -0
- package/devices/avatto.js +67 -0
- package/devices/avatto.js.map +1 -0
- package/devices/awox.d.ts +4 -0
- package/devices/awox.d.ts.map +1 -0
- package/devices/awox.js +240 -0
- package/devices/awox.js.map +1 -0
- package/devices/axis.d.ts +4 -0
- package/devices/axis.d.ts.map +1 -0
- package/devices/axis.js +63 -0
- package/devices/axis.js.map +1 -0
- package/devices/bankamp.d.ts +4 -0
- package/devices/bankamp.d.ts.map +1 -0
- package/devices/bankamp.js +15 -0
- package/devices/bankamp.js.map +1 -0
- package/devices/bega.d.ts +4 -0
- package/devices/bega.d.ts.map +1 -0
- package/devices/bega.js +29 -0
- package/devices/bega.js.map +1 -0
- package/devices/belkin.d.ts +4 -0
- package/devices/belkin.d.ts.map +1 -0
- package/devices/belkin.js +15 -0
- package/devices/belkin.js.map +1 -0
- package/devices/bitron.d.ts +4 -0
- package/devices/bitron.d.ts.map +1 -0
- package/devices/bitron.js +359 -0
- package/devices/bitron.js.map +1 -0
- package/devices/bituo_technik.d.ts +4 -0
- package/devices/bituo_technik.d.ts.map +1 -0
- package/devices/bituo_technik.js +121 -0
- package/devices/bituo_technik.js.map +1 -0
- package/devices/blaupunkt.d.ts +4 -0
- package/devices/blaupunkt.d.ts.map +1 -0
- package/devices/blaupunkt.js +68 -0
- package/devices/blaupunkt.js.map +1 -0
- package/devices/blitzwolf.d.ts +4 -0
- package/devices/blitzwolf.d.ts.map +1 -0
- package/devices/blitzwolf.js +73 -0
- package/devices/blitzwolf.js.map +1 -0
- package/devices/bosch.d.ts +4 -0
- package/devices/bosch.d.ts.map +1 -0
- package/devices/bosch.js +2048 -0
- package/devices/bosch.js.map +1 -0
- package/devices/bouffalo_lab.d.ts +4 -0
- package/devices/bouffalo_lab.d.ts.map +1 -0
- package/devices/bouffalo_lab.js +15 -0
- package/devices/bouffalo_lab.js.map +1 -0
- package/devices/brimate.d.ts +4 -0
- package/devices/brimate.d.ts.map +1 -0
- package/devices/brimate.js +55 -0
- package/devices/brimate.js.map +1 -0
- package/devices/bseed.d.ts +4 -0
- package/devices/bseed.d.ts.map +1 -0
- package/devices/bseed.js +57 -0
- package/devices/bseed.js.map +1 -0
- package/devices/bticino.d.ts +4 -0
- package/devices/bticino.d.ts.map +1 -0
- package/devices/bticino.js +113 -0
- package/devices/bticino.js.map +1 -0
- package/devices/busch_jaeger.d.ts +4 -0
- package/devices/busch_jaeger.d.ts.map +1 -0
- package/devices/busch_jaeger.js +186 -0
- package/devices/busch_jaeger.js.map +1 -0
- package/devices/byun.d.ts +4 -0
- package/devices/byun.d.ts.map +1 -0
- package/devices/byun.js +64 -0
- package/devices/byun.js.map +1 -0
- package/devices/calex.d.ts +4 -0
- package/devices/calex.d.ts.map +1 -0
- package/devices/calex.js +91 -0
- package/devices/calex.js.map +1 -0
- package/devices/candeo.d.ts +4 -0
- package/devices/candeo.d.ts.map +1 -0
- package/devices/candeo.js +185 -0
- package/devices/candeo.js.map +1 -0
- package/devices/casaia.d.ts +4 -0
- package/devices/casaia.d.ts.map +1 -0
- package/devices/casaia.js +99 -0
- package/devices/casaia.js.map +1 -0
- package/devices/cel.d.ts +4 -0
- package/devices/cel.d.ts.map +1 -0
- package/devices/cel.js +20 -0
- package/devices/cel.js.map +1 -0
- package/devices/centralite.d.ts +4 -0
- package/devices/centralite.d.ts.map +1 -0
- package/devices/centralite.js +444 -0
- package/devices/centralite.js.map +1 -0
- package/devices/chacon.d.ts +4 -0
- package/devices/chacon.d.ts.map +1 -0
- package/devices/chacon.js +18 -0
- package/devices/chacon.js.map +1 -0
- package/devices/cleode.d.ts +4 -0
- package/devices/cleode.d.ts.map +1 -0
- package/devices/cleode.js +15 -0
- package/devices/cleode.js.map +1 -0
- package/devices/cleverio.d.ts +4 -0
- package/devices/cleverio.d.ts.map +1 -0
- package/devices/cleverio.js +77 -0
- package/devices/cleverio.js.map +1 -0
- package/devices/climax.d.ts +4 -0
- package/devices/climax.d.ts.map +1 -0
- package/devices/climax.js +181 -0
- package/devices/climax.js.map +1 -0
- package/devices/commercial_electric.d.ts +4 -0
- package/devices/commercial_electric.d.ts.map +1 -0
- package/devices/commercial_electric.js +15 -0
- package/devices/commercial_electric.js.map +1 -0
- package/devices/cree.d.ts +4 -0
- package/devices/cree.d.ts.map +1 -0
- package/devices/cree.js +15 -0
- package/devices/cree.js.map +1 -0
- package/devices/ctm.d.ts +4 -0
- package/devices/ctm.d.ts.map +1 -0
- package/devices/ctm.js +1383 -0
- package/devices/ctm.js.map +1 -0
- package/devices/current_products_corp.d.ts +4 -0
- package/devices/current_products_corp.d.ts.map +1 -0
- package/devices/current_products_corp.js +64 -0
- package/devices/current_products_corp.js.map +1 -0
- package/devices/custom_devices_diy.d.ts +4 -0
- package/devices/custom_devices_diy.d.ts.map +1 -0
- package/devices/custom_devices_diy.js +1206 -0
- package/devices/custom_devices_diy.js.map +1 -0
- package/devices/cy_lighting.d.ts +4 -0
- package/devices/cy_lighting.d.ts.map +1 -0
- package/devices/cy_lighting.js +15 -0
- package/devices/cy_lighting.js.map +1 -0
- package/devices/danalock.d.ts +4 -0
- package/devices/danalock.d.ts.map +1 -0
- package/devices/danalock.js +65 -0
- package/devices/danalock.js.map +1 -0
- package/devices/danfoss.d.ts +4 -0
- package/devices/danfoss.d.ts.map +1 -0
- package/devices/danfoss.js +743 -0
- package/devices/danfoss.js.map +1 -0
- package/devices/databyte.d.ts +4 -0
- package/devices/databyte.d.ts.map +1 -0
- package/devices/databyte.js +95 -0
- package/devices/databyte.js.map +1 -0
- package/devices/datek.d.ts +4 -0
- package/devices/datek.d.ts.map +1 -0
- package/devices/datek.js +298 -0
- package/devices/datek.js.map +1 -0
- package/devices/dawon_dns.d.ts +4 -0
- package/devices/dawon_dns.d.ts.map +1 -0
- package/devices/dawon_dns.js +318 -0
- package/devices/dawon_dns.js.map +1 -0
- package/devices/develco.d.ts +4 -0
- package/devices/develco.d.ts.map +1 -0
- package/devices/develco.js +1037 -0
- package/devices/develco.js.map +1 -0
- package/devices/digi.d.ts +4 -0
- package/devices/digi.d.ts.map +1 -0
- package/devices/digi.js +25 -0
- package/devices/digi.js.map +1 -0
- package/devices/diyruz.d.ts +4 -0
- package/devices/diyruz.d.ts.map +1 -0
- package/devices/diyruz.js +403 -0
- package/devices/diyruz.js.map +1 -0
- package/devices/dlink.d.ts +4 -0
- package/devices/dlink.d.ts.map +1 -0
- package/devices/dlink.js +76 -0
- package/devices/dlink.js.map +1 -0
- package/devices/dnake.d.ts +4 -0
- package/devices/dnake.d.ts.map +1 -0
- package/devices/dnake.js +15 -0
- package/devices/dnake.js.map +1 -0
- package/devices/dowsing_reynolds.d.ts +4 -0
- package/devices/dowsing_reynolds.d.ts.map +1 -0
- package/devices/dowsing_reynolds.js +15 -0
- package/devices/dowsing_reynolds.js.map +1 -0
- package/devices/dresden_elektronik.d.ts +4 -0
- package/devices/dresden_elektronik.d.ts.map +1 -0
- package/devices/dresden_elektronik.js +50 -0
- package/devices/dresden_elektronik.js.map +1 -0
- package/devices/easyaccess.d.ts +4 -0
- package/devices/easyaccess.d.ts.map +1 -0
- package/devices/easyaccess.js +71 -0
- package/devices/easyaccess.js.map +1 -0
- package/devices/easyiot.d.ts +4 -0
- package/devices/easyiot.d.ts.map +1 -0
- package/devices/easyiot.js +358 -0
- package/devices/easyiot.js.map +1 -0
- package/devices/eatonhalo_led.d.ts +4 -0
- package/devices/eatonhalo_led.d.ts.map +1 -0
- package/devices/eatonhalo_led.js +15 -0
- package/devices/eatonhalo_led.js.map +1 -0
- package/devices/echostar.d.ts +4 -0
- package/devices/echostar.d.ts.map +1 -0
- package/devices/echostar.js +65 -0
- package/devices/echostar.js.map +1 -0
- package/devices/ecodim.d.ts +4 -0
- package/devices/ecodim.d.ts.map +1 -0
- package/devices/ecodim.js +270 -0
- package/devices/ecodim.js.map +1 -0
- package/devices/ecolink.d.ts +4 -0
- package/devices/ecolink.d.ts.map +1 -0
- package/devices/ecolink.js +61 -0
- package/devices/ecolink.js.map +1 -0
- package/devices/ecosmart.d.ts +4 -0
- package/devices/ecosmart.d.ts.map +1 -0
- package/devices/ecosmart.js +83 -0
- package/devices/ecosmart.js.map +1 -0
- package/devices/ecozy.d.ts +4 -0
- package/devices/ecozy.d.ts.map +1 -0
- package/devices/ecozy.js +89 -0
- package/devices/ecozy.js.map +1 -0
- package/devices/edp.d.ts +4 -0
- package/devices/edp.d.ts.map +1 -0
- package/devices/edp.js +74 -0
- package/devices/edp.js.map +1 -0
- package/devices/efekta.d.ts +4 -0
- package/devices/efekta.d.ts.map +1 -0
- package/devices/efekta.js +754 -0
- package/devices/efekta.js.map +1 -0
- package/devices/eglo.d.ts +4 -0
- package/devices/eglo.d.ts.map +1 -0
- package/devices/eglo.js +132 -0
- package/devices/eglo.js.map +1 -0
- package/devices/elko.d.ts +4 -0
- package/devices/elko.d.ts.map +1 -0
- package/devices/elko.js +240 -0
- package/devices/elko.js.map +1 -0
- package/devices/enbrighten.d.ts +4 -0
- package/devices/enbrighten.d.ts.map +1 -0
- package/devices/enbrighten.js +97 -0
- package/devices/enbrighten.js.map +1 -0
- package/devices/enocean.d.ts +4 -0
- package/devices/enocean.d.ts.map +1 -0
- package/devices/enocean.js +153 -0
- package/devices/enocean.js.map +1 -0
- package/devices/envilar.d.ts +4 -0
- package/devices/envilar.d.ts.map +1 -0
- package/devices/envilar.js +100 -0
- package/devices/envilar.js.map +1 -0
- package/devices/essentialb.d.ts +4 -0
- package/devices/essentialb.d.ts.map +1 -0
- package/devices/essentialb.js +137 -0
- package/devices/essentialb.js.map +1 -0
- package/devices/essentials.d.ts +4 -0
- package/devices/essentials.d.ts.map +1 -0
- package/devices/essentials.js +151 -0
- package/devices/essentials.js.map +1 -0
- package/devices/eucontrols.d.ts +4 -0
- package/devices/eucontrols.d.ts.map +1 -0
- package/devices/eucontrols.js +15 -0
- package/devices/eucontrols.js.map +1 -0
- package/devices/eurotronic.d.ts +4 -0
- package/devices/eurotronic.d.ts.map +1 -0
- package/devices/eurotronic.js +128 -0
- package/devices/eurotronic.js.map +1 -0
- package/devices/evanell.d.ts +4 -0
- package/devices/evanell.d.ts.map +1 -0
- package/devices/evanell.js +75 -0
- package/devices/evanell.js.map +1 -0
- package/devices/evn.d.ts +4 -0
- package/devices/evn.d.ts.map +1 -0
- package/devices/evn.js +94 -0
- package/devices/evn.js.map +1 -0
- package/devices/evology.d.ts +4 -0
- package/devices/evology.d.ts.map +1 -0
- package/devices/evology.js +64 -0
- package/devices/evology.js.map +1 -0
- package/devices/evvr.d.ts +4 -0
- package/devices/evvr.d.ts.map +1 -0
- package/devices/evvr.js +15 -0
- package/devices/evvr.js.map +1 -0
- package/devices/ewelink.d.ts +4 -0
- package/devices/ewelink.d.ts.map +1 -0
- package/devices/ewelink.js +343 -0
- package/devices/ewelink.js.map +1 -0
- package/devices/ezex.d.ts +4 -0
- package/devices/ezex.d.ts.map +1 -0
- package/devices/ezex.js +15 -0
- package/devices/ezex.js.map +1 -0
- package/devices/fantem.d.ts +4 -0
- package/devices/fantem.d.ts.map +1 -0
- package/devices/fantem.js +118 -0
- package/devices/fantem.js.map +1 -0
- package/devices/feibit.d.ts +4 -0
- package/devices/feibit.d.ts.map +1 -0
- package/devices/feibit.js +334 -0
- package/devices/feibit.js.map +1 -0
- package/devices/fireangel.d.ts +4 -0
- package/devices/fireangel.d.ts.map +1 -0
- package/devices/fireangel.js +55 -0
- package/devices/fireangel.js.map +1 -0
- package/devices/frankever.d.ts +4 -0
- package/devices/frankever.d.ts.map +1 -0
- package/devices/frankever.js +71 -0
- package/devices/frankever.js.map +1 -0
- package/devices/frient.d.ts +4 -0
- package/devices/frient.d.ts.map +1 -0
- package/devices/frient.js +42 -0
- package/devices/frient.js.map +1 -0
- package/devices/futurehome.d.ts +4 -0
- package/devices/futurehome.d.ts.map +1 -0
- package/devices/futurehome.js +124 -0
- package/devices/futurehome.js.map +1 -0
- package/devices/ge.d.ts +4 -0
- package/devices/ge.d.ts.map +1 -0
- package/devices/ge.js +134 -0
- package/devices/ge.js.map +1 -0
- package/devices/gewiss.d.ts +4 -0
- package/devices/gewiss.d.ts.map +1 -0
- package/devices/gewiss.js +78 -0
- package/devices/gewiss.js.map +1 -0
- package/devices/gidealed.d.ts +4 -0
- package/devices/gidealed.d.ts.map +1 -0
- package/devices/gidealed.js +15 -0
- package/devices/gidealed.js.map +1 -0
- package/devices/giderwel.d.ts +4 -0
- package/devices/giderwel.d.ts.map +1 -0
- package/devices/giderwel.js +15 -0
- package/devices/giderwel.js.map +1 -0
- package/devices/giex.d.ts +4 -0
- package/devices/giex.d.ts.map +1 -0
- package/devices/giex.js +121 -0
- package/devices/giex.js.map +1 -0
- package/devices/girier.d.ts +4 -0
- package/devices/girier.d.ts.map +1 -0
- package/devices/girier.js +56 -0
- package/devices/girier.js.map +1 -0
- package/devices/gledopto.d.ts +4 -0
- package/devices/gledopto.d.ts.map +1 -0
- package/devices/gledopto.js +1046 -0
- package/devices/gledopto.js.map +1 -0
- package/devices/gmmts.d.ts +4 -0
- package/devices/gmmts.d.ts.map +1 -0
- package/devices/gmmts.js +2287 -0
- package/devices/gmmts.js.map +1 -0
- package/devices/gmy.d.ts +4 -0
- package/devices/gmy.d.ts.map +1 -0
- package/devices/gmy.js +15 -0
- package/devices/gmy.js.map +1 -0
- package/devices/gs.d.ts +4 -0
- package/devices/gs.d.ts.map +1 -0
- package/devices/gs.js +89 -0
- package/devices/gs.js.map +1 -0
- package/devices/gumax.d.ts +4 -0
- package/devices/gumax.d.ts.map +1 -0
- package/devices/gumax.js +15 -0
- package/devices/gumax.js.map +1 -0
- package/devices/halemeier.d.ts +4 -0
- package/devices/halemeier.d.ts.map +1 -0
- package/devices/halemeier.js +129 -0
- package/devices/halemeier.js.map +1 -0
- package/devices/hampton_bay.d.ts +4 -0
- package/devices/hampton_bay.d.ts.map +1 -0
- package/devices/hampton_bay.js +72 -0
- package/devices/hampton_bay.js.map +1 -0
- package/devices/heatit.d.ts +4 -0
- package/devices/heatit.d.ts.map +1 -0
- package/devices/heatit.js +15 -0
- package/devices/heatit.js.map +1 -0
- package/devices/heiman.d.ts +4 -0
- package/devices/heiman.d.ts.map +1 -0
- package/devices/heiman.js +807 -0
- package/devices/heiman.js.map +1 -0
- package/devices/heimgard_technologies.d.ts +4 -0
- package/devices/heimgard_technologies.d.ts.map +1 -0
- package/devices/heimgard_technologies.js +193 -0
- package/devices/heimgard_technologies.js.map +1 -0
- package/devices/hej.d.ts +4 -0
- package/devices/hej.d.ts.map +1 -0
- package/devices/hej.js +73 -0
- package/devices/hej.js.map +1 -0
- package/devices/hfh.d.ts +4 -0
- package/devices/hfh.d.ts.map +1 -0
- package/devices/hfh.js +15 -0
- package/devices/hfh.js.map +1 -0
- package/devices/hilux.d.ts +4 -0
- package/devices/hilux.d.ts.map +1 -0
- package/devices/hilux.js +22 -0
- package/devices/hilux.js.map +1 -0
- package/devices/hive.d.ts +4 -0
- package/devices/hive.d.ts.map +1 -0
- package/devices/hive.js +766 -0
- package/devices/hive.js.map +1 -0
- package/devices/hommyn.d.ts +4 -0
- package/devices/hommyn.d.ts.map +1 -0
- package/devices/hommyn.js +64 -0
- package/devices/hommyn.js.map +1 -0
- package/devices/honyar.d.ts +4 -0
- package/devices/honyar.d.ts.map +1 -0
- package/devices/honyar.js +171 -0
- package/devices/honyar.js.map +1 -0
- package/devices/hornbach.d.ts +4 -0
- package/devices/hornbach.d.ts.map +1 -0
- package/devices/hornbach.js +99 -0
- package/devices/hornbach.js.map +1 -0
- package/devices/hzc_electric.d.ts +4 -0
- package/devices/hzc_electric.d.ts.map +1 -0
- package/devices/hzc_electric.js +94 -0
- package/devices/hzc_electric.js.map +1 -0
- package/devices/icasa.d.ts +4 -0
- package/devices/icasa.d.ts.map +1 -0
- package/devices/icasa.js +167 -0
- package/devices/icasa.js.map +1 -0
- package/devices/idinio.d.ts +4 -0
- package/devices/idinio.d.ts.map +1 -0
- package/devices/idinio.js +15 -0
- package/devices/idinio.js.map +1 -0
- package/devices/ihorn.d.ts +4 -0
- package/devices/ihorn.d.ts.map +1 -0
- package/devices/ihorn.js +109 -0
- package/devices/ihorn.js.map +1 -0
- package/devices/ikea.d.ts +4 -0
- package/devices/ikea.d.ts.map +1 -0
- package/devices/ikea.js +927 -0
- package/devices/ikea.js.map +1 -0
- package/devices/ilightsin.d.ts +4 -0
- package/devices/ilightsin.d.ts.map +1 -0
- package/devices/ilightsin.js +15 -0
- package/devices/ilightsin.js.map +1 -0
- package/devices/iluminize.d.ts +4 -0
- package/devices/iluminize.d.ts.map +1 -0
- package/devices/iluminize.js +376 -0
- package/devices/iluminize.js.map +1 -0
- package/devices/ilux.d.ts +4 -0
- package/devices/ilux.d.ts.map +1 -0
- package/devices/ilux.js +15 -0
- package/devices/ilux.js.map +1 -0
- package/devices/imhotepcreation.d.ts +4 -0
- package/devices/imhotepcreation.d.ts.map +1 -0
- package/devices/imhotepcreation.js +251 -0
- package/devices/imhotepcreation.js.map +1 -0
- package/devices/immax.d.ts +4 -0
- package/devices/immax.d.ts.map +1 -0
- package/devices/immax.js +304 -0
- package/devices/immax.js.map +1 -0
- package/devices/imou.d.ts +4 -0
- package/devices/imou.d.ts.map +1 -0
- package/devices/imou.js +28 -0
- package/devices/imou.js.map +1 -0
- package/devices/index.d.ts +13 -0
- package/devices/index.d.ts.map +1 -0
- package/devices/index.js +642 -0
- package/devices/index.js.map +1 -0
- package/devices/innr.d.ts +4 -0
- package/devices/innr.d.ts.map +1 -0
- package/devices/innr.js +878 -0
- package/devices/innr.js.map +1 -0
- package/devices/inovelli.d.ts +4 -0
- package/devices/inovelli.d.ts.map +1 -0
- package/devices/inovelli.js +1977 -0
- package/devices/inovelli.js.map +1 -0
- package/devices/insta.d.ts +4 -0
- package/devices/insta.d.ts.map +1 -0
- package/devices/insta.js +186 -0
- package/devices/insta.js.map +1 -0
- package/devices/iolloi.d.ts +4 -0
- package/devices/iolloi.d.ts.map +1 -0
- package/devices/iolloi.js +16 -0
- package/devices/iolloi.js.map +1 -0
- package/devices/iotperfect.d.ts +4 -0
- package/devices/iotperfect.d.ts.map +1 -0
- package/devices/iotperfect.js +62 -0
- package/devices/iotperfect.js.map +1 -0
- package/devices/iris.d.ts +4 -0
- package/devices/iris.d.ts.map +1 -0
- package/devices/iris.js +211 -0
- package/devices/iris.js.map +1 -0
- package/devices/istar.d.ts +4 -0
- package/devices/istar.d.ts.map +1 -0
- package/devices/istar.js +22 -0
- package/devices/istar.js.map +1 -0
- package/devices/jasco.d.ts +4 -0
- package/devices/jasco.d.ts.map +1 -0
- package/devices/jasco.js +34 -0
- package/devices/jasco.js.map +1 -0
- package/devices/javis.d.ts +4 -0
- package/devices/javis.d.ts.map +1 -0
- package/devices/javis.js +84 -0
- package/devices/javis.js.map +1 -0
- package/devices/jethome.d.ts +4 -0
- package/devices/jethome.d.ts.map +1 -0
- package/devices/jethome.js +124 -0
- package/devices/jethome.js.map +1 -0
- package/devices/jiawen.d.ts +4 -0
- package/devices/jiawen.d.ts.map +1 -0
- package/devices/jiawen.js +22 -0
- package/devices/jiawen.js.map +1 -0
- package/devices/jumitech.d.ts +4 -0
- package/devices/jumitech.d.ts.map +1 -0
- package/devices/jumitech.js +15 -0
- package/devices/jumitech.js.map +1 -0
- package/devices/jxuan.d.ts +4 -0
- package/devices/jxuan.d.ts.map +1 -0
- package/devices/jxuan.js +89 -0
- package/devices/jxuan.js.map +1 -0
- package/devices/kami.d.ts +4 -0
- package/devices/kami.d.ts.map +1 -0
- package/devices/kami.js +55 -0
- package/devices/kami.js.map +1 -0
- package/devices/keen_home.d.ts +4 -0
- package/devices/keen_home.d.ts.map +1 -0
- package/devices/keen_home.js +160 -0
- package/devices/keen_home.js.map +1 -0
- package/devices/klikaanklikuit.d.ts +4 -0
- package/devices/klikaanklikuit.d.ts.map +1 -0
- package/devices/klikaanklikuit.js +22 -0
- package/devices/klikaanklikuit.js.map +1 -0
- package/devices/kmpcil.d.ts +4 -0
- package/devices/kmpcil.d.ts.map +1 -0
- package/devices/kmpcil.js +219 -0
- package/devices/kmpcil.js.map +1 -0
- package/devices/konke.d.ts +4 -0
- package/devices/konke.d.ts.map +1 -0
- package/devices/konke.js +210 -0
- package/devices/konke.js.map +1 -0
- package/devices/ksentry.d.ts +4 -0
- package/devices/ksentry.d.ts.map +1 -0
- package/devices/ksentry.js +15 -0
- package/devices/ksentry.js.map +1 -0
- package/devices/kurvia.d.ts +4 -0
- package/devices/kurvia.d.ts.map +1 -0
- package/devices/kurvia.js +20 -0
- package/devices/kurvia.js.map +1 -0
- package/devices/kwikset.d.ts +4 -0
- package/devices/kwikset.d.ts.map +1 -0
- package/devices/kwikset.js +157 -0
- package/devices/kwikset.js.map +1 -0
- package/devices/lanesto.d.ts +4 -0
- package/devices/lanesto.d.ts.map +1 -0
- package/devices/lanesto.js +15 -0
- package/devices/lanesto.js.map +1 -0
- package/devices/lds.d.ts +4 -0
- package/devices/lds.d.ts.map +1 -0
- package/devices/lds.js +15 -0
- package/devices/lds.js.map +1 -0
- package/devices/led_trading.d.ts +4 -0
- package/devices/led_trading.d.ts.map +1 -0
- package/devices/led_trading.js +112 -0
- package/devices/led_trading.js.map +1 -0
- package/devices/ledvance.d.ts +4 -0
- package/devices/ledvance.d.ts.map +1 -0
- package/devices/ledvance.js +337 -0
- package/devices/ledvance.js.map +1 -0
- package/devices/leedarson.d.ts +4 -0
- package/devices/leedarson.d.ts.map +1 -0
- package/devices/leedarson.js +182 -0
- package/devices/leedarson.js.map +1 -0
- package/devices/legrand.d.ts +4 -0
- package/devices/legrand.d.ts.map +1 -0
- package/devices/legrand.js +740 -0
- package/devices/legrand.js.map +1 -0
- package/devices/lellki.d.ts +4 -0
- package/devices/lellki.d.ts.map +1 -0
- package/devices/lellki.js +169 -0
- package/devices/lellki.js.map +1 -0
- package/devices/letsled.d.ts +4 -0
- package/devices/letsled.d.ts.map +1 -0
- package/devices/letsled.js +15 -0
- package/devices/letsled.js.map +1 -0
- package/devices/letv.d.ts +4 -0
- package/devices/letv.d.ts.map +1 -0
- package/devices/letv.js +90 -0
- package/devices/letv.js.map +1 -0
- package/devices/leviton.d.ts +4 -0
- package/devices/leviton.d.ts.map +1 -0
- package/devices/leviton.js +164 -0
- package/devices/leviton.js.map +1 -0
- package/devices/lg.d.ts +4 -0
- package/devices/lg.d.ts.map +1 -0
- package/devices/lg.js +29 -0
- package/devices/lg.js.map +1 -0
- package/devices/lidl.d.ts +4 -0
- package/devices/lidl.d.ts.map +1 -0
- package/devices/lidl.js +674 -0
- package/devices/lidl.js.map +1 -0
- package/devices/lifecontrol.d.ts +4 -0
- package/devices/lifecontrol.d.ts.map +1 -0
- package/devices/lifecontrol.js +149 -0
- package/devices/lifecontrol.js.map +1 -0
- package/devices/lightsolutions.d.ts +4 -0
- package/devices/lightsolutions.d.ts.map +1 -0
- package/devices/lightsolutions.js +36 -0
- package/devices/lightsolutions.js.map +1 -0
- package/devices/linkind.d.ts +4 -0
- package/devices/linkind.d.ts.map +1 -0
- package/devices/linkind.js +275 -0
- package/devices/linkind.js.map +1 -0
- package/devices/linptech.d.ts +4 -0
- package/devices/linptech.d.ts.map +1 -0
- package/devices/linptech.js +159 -0
- package/devices/linptech.js.map +1 -0
- package/devices/livingwise.d.ts +4 -0
- package/devices/livingwise.d.ts.map +1 -0
- package/devices/livingwise.js +119 -0
- package/devices/livingwise.js.map +1 -0
- package/devices/livolo.d.ts +4 -0
- package/devices/livolo.d.ts.map +1 -0
- package/devices/livolo.js +422 -0
- package/devices/livolo.js.map +1 -0
- package/devices/lixee.d.ts +4 -0
- package/devices/lixee.d.ts.map +1 -0
- package/devices/lixee.js +1926 -0
- package/devices/lixee.js.map +1 -0
- package/devices/lonsonho.d.ts +4 -0
- package/devices/lonsonho.d.ts.map +1 -0
- package/devices/lonsonho.js +303 -0
- package/devices/lonsonho.js.map +1 -0
- package/devices/ls.d.ts +4 -0
- package/devices/ls.d.ts.map +1 -0
- package/devices/ls.js +68 -0
- package/devices/ls.js.map +1 -0
- package/devices/lubeez.d.ts +4 -0
- package/devices/lubeez.d.ts.map +1 -0
- package/devices/lubeez.js +15 -0
- package/devices/lubeez.js.map +1 -0
- package/devices/lumi.d.ts +4 -0
- package/devices/lumi.d.ts.map +1 -0
- package/devices/lumi.js +4387 -0
- package/devices/lumi.js.map +1 -0
- package/devices/lupus.d.ts +4 -0
- package/devices/lupus.d.ts.map +1 -0
- package/devices/lupus.js +98 -0
- package/devices/lupus.js.map +1 -0
- package/devices/lutron.d.ts +4 -0
- package/devices/lutron.d.ts.map +1 -0
- package/devices/lutron.js +71 -0
- package/devices/lutron.js.map +1 -0
- package/devices/lux.d.ts +4 -0
- package/devices/lux.d.ts.map +1 -0
- package/devices/lux.js +91 -0
- package/devices/lux.js.map +1 -0
- package/devices/lytko.d.ts +4 -0
- package/devices/lytko.d.ts.map +1 -0
- package/devices/lytko.js +788 -0
- package/devices/lytko.js.map +1 -0
- package/devices/m_elec.d.ts +4 -0
- package/devices/m_elec.d.ts.map +1 -0
- package/devices/m_elec.js +36 -0
- package/devices/m_elec.js.map +1 -0
- package/devices/makegood.d.ts +4 -0
- package/devices/makegood.d.ts.map +1 -0
- package/devices/makegood.js +66 -0
- package/devices/makegood.js.map +1 -0
- package/devices/matcall_bv.d.ts +4 -0
- package/devices/matcall_bv.d.ts.map +1 -0
- package/devices/matcall_bv.js +22 -0
- package/devices/matcall_bv.js.map +1 -0
- package/devices/mazda.d.ts +4 -0
- package/devices/mazda.d.ts.map +1 -0
- package/devices/mazda.js +174 -0
- package/devices/mazda.js.map +1 -0
- package/devices/meazon.d.ts +4 -0
- package/devices/meazon.d.ts.map +1 -0
- package/devices/meazon.js +99 -0
- package/devices/meazon.js.map +1 -0
- package/devices/mercator.d.ts +4 -0
- package/devices/mercator.d.ts.map +1 -0
- package/devices/mercator.js +256 -0
- package/devices/mercator.js.map +1 -0
- package/devices/miboxer.d.ts +4 -0
- package/devices/miboxer.d.ts.map +1 -0
- package/devices/miboxer.js +93 -0
- package/devices/miboxer.js.map +1 -0
- package/devices/micromatic.d.ts +4 -0
- package/devices/micromatic.d.ts.map +1 -0
- package/devices/micromatic.js +15 -0
- package/devices/micromatic.js.map +1 -0
- package/devices/modular.d.ts +4 -0
- package/devices/modular.d.ts.map +1 -0
- package/devices/modular.js +15 -0
- package/devices/modular.js.map +1 -0
- package/devices/moes.d.ts +4 -0
- package/devices/moes.d.ts.map +1 -0
- package/devices/moes.js +654 -0
- package/devices/moes.js.map +1 -0
- package/devices/muller_licht.d.ts +4 -0
- package/devices/muller_licht.d.ts.map +1 -0
- package/devices/muller_licht.js +341 -0
- package/devices/muller_licht.js.map +1 -0
- package/devices/multiterm.d.ts +4 -0
- package/devices/multiterm.d.ts.map +1 -0
- package/devices/multiterm.js +123 -0
- package/devices/multiterm.js.map +1 -0
- package/devices/namron.d.ts +4 -0
- package/devices/namron.d.ts.map +1 -0
- package/devices/namron.js +1464 -0
- package/devices/namron.js.map +1 -0
- package/devices/nanoleaf.d.ts +4 -0
- package/devices/nanoleaf.d.ts.map +1 -0
- package/devices/nanoleaf.js +15 -0
- package/devices/nanoleaf.js.map +1 -0
- package/devices/nedis.d.ts +4 -0
- package/devices/nedis.d.ts.map +1 -0
- package/devices/nedis.js +88 -0
- package/devices/nedis.js.map +1 -0
- package/devices/neo.d.ts +4 -0
- package/devices/neo.d.ts.map +1 -0
- package/devices/neo.js +558 -0
- package/devices/neo.js.map +1 -0
- package/devices/net2grid.d.ts +4 -0
- package/devices/net2grid.d.ts.map +1 -0
- package/devices/net2grid.js +68 -0
- package/devices/net2grid.js.map +1 -0
- package/devices/netvox.d.ts +4 -0
- package/devices/netvox.d.ts.map +1 -0
- package/devices/netvox.js +75 -0
- package/devices/netvox.js.map +1 -0
- package/devices/nexelec.d.ts +4 -0
- package/devices/nexelec.d.ts.map +1 -0
- package/devices/nexelec.js +15 -0
- package/devices/nexelec.js.map +1 -0
- package/devices/niko.d.ts +4 -0
- package/devices/niko.d.ts.map +1 -0
- package/devices/niko.js +495 -0
- package/devices/niko.js.map +1 -0
- package/devices/ninja_blocks.d.ts +4 -0
- package/devices/ninja_blocks.d.ts.map +1 -0
- package/devices/ninja_blocks.js +64 -0
- package/devices/ninja_blocks.js.map +1 -0
- package/devices/niviss.d.ts +4 -0
- package/devices/niviss.d.ts.map +1 -0
- package/devices/niviss.js +15 -0
- package/devices/niviss.js.map +1 -0
- package/devices/nodon.d.ts +4 -0
- package/devices/nodon.d.ts.map +1 -0
- package/devices/nodon.js +386 -0
- package/devices/nodon.js.map +1 -0
- package/devices/nordtronic.d.ts +4 -0
- package/devices/nordtronic.d.ts.map +1 -0
- package/devices/nordtronic.js +41 -0
- package/devices/nordtronic.js.map +1 -0
- package/devices/nous.d.ts +4 -0
- package/devices/nous.d.ts.map +1 -0
- package/devices/nous.js +151 -0
- package/devices/nous.js.map +1 -0
- package/devices/novo.d.ts +4 -0
- package/devices/novo.d.ts.map +1 -0
- package/devices/novo.js +57 -0
- package/devices/novo.js.map +1 -0
- package/devices/nue_3a.d.ts +4 -0
- package/devices/nue_3a.d.ts.map +1 -0
- package/devices/nue_3a.js +361 -0
- package/devices/nue_3a.js.map +1 -0
- package/devices/nyce.d.ts +4 -0
- package/devices/nyce.d.ts.map +1 -0
- package/devices/nyce.js +134 -0
- package/devices/nyce.js.map +1 -0
- package/devices/onenuo.d.ts +4 -0
- package/devices/onenuo.d.ts.map +1 -0
- package/devices/onenuo.js +86 -0
- package/devices/onenuo.js.map +1 -0
- package/devices/onesti.d.ts +4 -0
- package/devices/onesti.d.ts.map +1 -0
- package/devices/onesti.js +208 -0
- package/devices/onesti.js.map +1 -0
- package/devices/openlumi.d.ts +4 -0
- package/devices/openlumi.d.ts.map +1 -0
- package/devices/openlumi.js +62 -0
- package/devices/openlumi.js.map +1 -0
- package/devices/orvibo.d.ts +4 -0
- package/devices/orvibo.d.ts.map +1 -0
- package/devices/orvibo.js +391 -0
- package/devices/orvibo.js.map +1 -0
- package/devices/osram.d.ts +4 -0
- package/devices/osram.d.ts.map +1 -0
- package/devices/osram.js +516 -0
- package/devices/osram.js.map +1 -0
- package/devices/oujiabao.d.ts +4 -0
- package/devices/oujiabao.d.ts.map +1 -0
- package/devices/oujiabao.js +55 -0
- package/devices/oujiabao.js.map +1 -0
- package/devices/owon.d.ts +4 -0
- package/devices/owon.d.ts.map +1 -0
- package/devices/owon.js +478 -0
- package/devices/owon.js.map +1 -0
- package/devices/ozsmartthings.d.ts +4 -0
- package/devices/ozsmartthings.d.ts.map +1 -0
- package/devices/ozsmartthings.js +48 -0
- package/devices/ozsmartthings.js.map +1 -0
- package/devices/paul_neuhaus.d.ts +4 -0
- package/devices/paul_neuhaus.d.ts.map +1 -0
- package/devices/paul_neuhaus.js +194 -0
- package/devices/paul_neuhaus.js.map +1 -0
- package/devices/paulmann.d.ts +4 -0
- package/devices/paulmann.d.ts.map +1 -0
- package/devices/paulmann.js +330 -0
- package/devices/paulmann.js.map +1 -0
- package/devices/peq.d.ts +4 -0
- package/devices/peq.d.ts.map +1 -0
- package/devices/peq.js +64 -0
- package/devices/peq.js.map +1 -0
- package/devices/perenio.d.ts +4 -0
- package/devices/perenio.d.ts.map +1 -0
- package/devices/perenio.js +468 -0
- package/devices/perenio.js.map +1 -0
- package/devices/philio.d.ts +4 -0
- package/devices/philio.d.ts.map +1 -0
- package/devices/philio.js +16 -0
- package/devices/philio.js.map +1 -0
- package/devices/philips.d.ts +4 -0
- package/devices/philips.d.ts.map +1 -0
- package/devices/philips.js +4051 -0
- package/devices/philips.js.map +1 -0
- package/devices/plaid.d.ts +4 -0
- package/devices/plaid.d.ts.map +1 -0
- package/devices/plaid.js +65 -0
- package/devices/plaid.js.map +1 -0
- package/devices/plugwise.d.ts +4 -0
- package/devices/plugwise.d.ts.map +1 -0
- package/devices/plugwise.js +210 -0
- package/devices/plugwise.js.map +1 -0
- package/devices/profalux.d.ts +4 -0
- package/devices/profalux.d.ts.map +1 -0
- package/devices/profalux.js +191 -0
- package/devices/profalux.js.map +1 -0
- package/devices/prolight.d.ts +4 -0
- package/devices/prolight.d.ts.map +1 -0
- package/devices/prolight.js +115 -0
- package/devices/prolight.js.map +1 -0
- package/devices/pushok.d.ts +4 -0
- package/devices/pushok.d.ts.map +1 -0
- package/devices/pushok.js +300 -0
- package/devices/pushok.js.map +1 -0
- package/devices/qa.d.ts +4 -0
- package/devices/qa.d.ts.map +1 -0
- package/devices/qa.js +295 -0
- package/devices/qa.js.map +1 -0
- package/devices/qmotion.d.ts +4 -0
- package/devices/qmotion.d.ts.map +1 -0
- package/devices/qmotion.js +73 -0
- package/devices/qmotion.js.map +1 -0
- package/devices/qoto.d.ts +4 -0
- package/devices/qoto.d.ts.map +1 -0
- package/devices/qoto.js +87 -0
- package/devices/qoto.js.map +1 -0
- package/devices/quotra.d.ts +4 -0
- package/devices/quotra.d.ts.map +1 -0
- package/devices/quotra.js +22 -0
- package/devices/quotra.js.map +1 -0
- package/devices/rademacher.d.ts +4 -0
- package/devices/rademacher.d.ts.map +1 -0
- package/devices/rademacher.js +29 -0
- package/devices/rademacher.js.map +1 -0
- package/devices/radium.d.ts +4 -0
- package/devices/radium.d.ts.map +1 -0
- package/devices/radium.js +15 -0
- package/devices/radium.js.map +1 -0
- package/devices/raex.d.ts +4 -0
- package/devices/raex.d.ts.map +1 -0
- package/devices/raex.js +15 -0
- package/devices/raex.js.map +1 -0
- package/devices/rgb_genie.d.ts +4 -0
- package/devices/rgb_genie.d.ts.map +1 -0
- package/devices/rgb_genie.js +279 -0
- package/devices/rgb_genie.js.map +1 -0
- package/devices/robb.d.ts +4 -0
- package/devices/robb.d.ts.map +1 -0
- package/devices/robb.js +449 -0
- package/devices/robb.js.map +1 -0
- package/devices/roome.d.ts +4 -0
- package/devices/roome.d.ts.map +1 -0
- package/devices/roome.js +55 -0
- package/devices/roome.js.map +1 -0
- package/devices/rtx.d.ts +4 -0
- package/devices/rtx.d.ts.map +1 -0
- package/devices/rtx.js +151 -0
- package/devices/rtx.js.map +1 -0
- package/devices/salus_controls.d.ts +4 -0
- package/devices/salus_controls.d.ts.map +1 -0
- package/devices/salus_controls.js +136 -0
- package/devices/salus_controls.js.map +1 -0
- package/devices/samotech.d.ts +4 -0
- package/devices/samotech.d.ts.map +1 -0
- package/devices/samotech.js +75 -0
- package/devices/samotech.js.map +1 -0
- package/devices/saswell.d.ts +4 -0
- package/devices/saswell.d.ts.map +1 -0
- package/devices/saswell.js +125 -0
- package/devices/saswell.js.map +1 -0
- package/devices/sber.d.ts +4 -0
- package/devices/sber.d.ts.map +1 -0
- package/devices/sber.js +66 -0
- package/devices/sber.js.map +1 -0
- package/devices/scanproducts.d.ts +4 -0
- package/devices/scanproducts.d.ts.map +1 -0
- package/devices/scanproducts.js +22 -0
- package/devices/scanproducts.js.map +1 -0
- package/devices/schlage.d.ts +4 -0
- package/devices/schlage.d.ts.map +1 -0
- package/devices/schlage.js +64 -0
- package/devices/schlage.js.map +1 -0
- package/devices/schneider_electric.d.ts +4 -0
- package/devices/schneider_electric.d.ts.map +1 -0
- package/devices/schneider_electric.js +2187 -0
- package/devices/schneider_electric.js.map +1 -0
- package/devices/schwaiger.d.ts +4 -0
- package/devices/schwaiger.d.ts.map +1 -0
- package/devices/schwaiger.js +109 -0
- package/devices/schwaiger.js.map +1 -0
- package/devices/seastar_intelligence.d.ts +4 -0
- package/devices/seastar_intelligence.d.ts.map +1 -0
- package/devices/seastar_intelligence.js +20 -0
- package/devices/seastar_intelligence.js.map +1 -0
- package/devices/securifi.d.ts +4 -0
- package/devices/securifi.d.ts.map +1 -0
- package/devices/securifi.js +83 -0
- package/devices/securifi.js.map +1 -0
- package/devices/sengled.d.ts +7 -0
- package/devices/sengled.d.ts.map +1 -0
- package/devices/sengled.js +358 -0
- package/devices/sengled.js.map +1 -0
- package/devices/sercomm.d.ts +4 -0
- package/devices/sercomm.d.ts.map +1 -0
- package/devices/sercomm.js +189 -0
- package/devices/sercomm.js.map +1 -0
- package/devices/shade_control.d.ts +4 -0
- package/devices/shade_control.d.ts.map +1 -0
- package/devices/shade_control.js +65 -0
- package/devices/shade_control.js.map +1 -0
- package/devices/shenzhen_homa.d.ts +4 -0
- package/devices/shenzhen_homa.d.ts.map +1 -0
- package/devices/shenzhen_homa.js +111 -0
- package/devices/shenzhen_homa.js.map +1 -0
- package/devices/shinasystem.d.ts +4 -0
- package/devices/shinasystem.d.ts.map +1 -0
- package/devices/shinasystem.js +961 -0
- package/devices/shinasystem.js.map +1 -0
- package/devices/shyugj.d.ts +4 -0
- package/devices/shyugj.d.ts.map +1 -0
- package/devices/shyugj.js +21 -0
- package/devices/shyugj.js.map +1 -0
- package/devices/siglis.d.ts +4 -0
- package/devices/siglis.d.ts.map +1 -0
- package/devices/siglis.js +457 -0
- package/devices/siglis.js.map +1 -0
- package/devices/sikom.d.ts +4 -0
- package/devices/sikom.d.ts.map +1 -0
- package/devices/sikom.js +68 -0
- package/devices/sikom.js.map +1 -0
- package/devices/sinope.d.ts +4 -0
- package/devices/sinope.d.ts.map +1 -0
- package/devices/sinope.js +1755 -0
- package/devices/sinope.js.map +1 -0
- package/devices/siterwell.d.ts +4 -0
- package/devices/siterwell.d.ts.map +1 -0
- package/devices/siterwell.js +111 -0
- package/devices/siterwell.js.map +1 -0
- package/devices/skydance.d.ts +4 -0
- package/devices/skydance.d.ts.map +1 -0
- package/devices/skydance.js +156 -0
- package/devices/skydance.js.map +1 -0
- package/devices/slv.d.ts +4 -0
- package/devices/slv.d.ts.map +1 -0
- package/devices/slv.js +38 -0
- package/devices/slv.js.map +1 -0
- package/devices/smart9.d.ts +4 -0
- package/devices/smart9.d.ts.map +1 -0
- package/devices/smart9.js +67 -0
- package/devices/smart9.js.map +1 -0
- package/devices/smart_home_pty.d.ts +4 -0
- package/devices/smart_home_pty.d.ts.map +1 -0
- package/devices/smart_home_pty.js +22 -0
- package/devices/smart_home_pty.js.map +1 -0
- package/devices/smartenit.d.ts +4 -0
- package/devices/smartenit.d.ts.map +1 -0
- package/devices/smartenit.js +81 -0
- package/devices/smartenit.js.map +1 -0
- package/devices/smartthings.d.ts +4 -0
- package/devices/smartthings.d.ts.map +1 -0
- package/devices/smartthings.js +527 -0
- package/devices/smartthings.js.map +1 -0
- package/devices/smartwings.d.ts +4 -0
- package/devices/smartwings.d.ts.map +1 -0
- package/devices/smartwings.js +64 -0
- package/devices/smartwings.js.map +1 -0
- package/devices/smlight.d.ts +4 -0
- package/devices/smlight.d.ts.map +1 -0
- package/devices/smlight.js +22 -0
- package/devices/smlight.js.map +1 -0
- package/devices/sohan_electric.d.ts +4 -0
- package/devices/sohan_electric.d.ts.map +1 -0
- package/devices/sohan_electric.js +20 -0
- package/devices/sohan_electric.js.map +1 -0
- package/devices/solaredge.d.ts +4 -0
- package/devices/solaredge.d.ts.map +1 -0
- package/devices/solaredge.js +15 -0
- package/devices/solaredge.js.map +1 -0
- package/devices/soma.d.ts +4 -0
- package/devices/soma.d.ts.map +1 -0
- package/devices/soma.js +15 -0
- package/devices/soma.js.map +1 -0
- package/devices/somfy.d.ts +4 -0
- package/devices/somfy.d.ts.map +1 -0
- package/devices/somfy.js +88 -0
- package/devices/somfy.js.map +1 -0
- package/devices/somgoms.d.ts +4 -0
- package/devices/somgoms.d.ts.map +1 -0
- package/devices/somgoms.js +84 -0
- package/devices/somgoms.js.map +1 -0
- package/devices/sonoff.d.ts +4 -0
- package/devices/sonoff.d.ts.map +1 -0
- package/devices/sonoff.js +1452 -0
- package/devices/sonoff.js.map +1 -0
- package/devices/sowilo.d.ts +4 -0
- package/devices/sowilo.d.ts.map +1 -0
- package/devices/sowilo.js +15 -0
- package/devices/sowilo.js.map +1 -0
- package/devices/spotmau.d.ts +4 -0
- package/devices/spotmau.d.ts.map +1 -0
- package/devices/spotmau.js +42 -0
- package/devices/spotmau.js.map +1 -0
- package/devices/stelpro.d.ts +4 -0
- package/devices/stelpro.d.ts.map +1 -0
- package/devices/stelpro.js +366 -0
- package/devices/stelpro.js.map +1 -0
- package/devices/sunricher.d.ts +4 -0
- package/devices/sunricher.d.ts.map +1 -0
- package/devices/sunricher.js +1308 -0
- package/devices/sunricher.js.map +1 -0
- package/devices/swann.d.ts +4 -0
- package/devices/swann.d.ts.map +1 -0
- package/devices/swann.js +73 -0
- package/devices/swann.js.map +1 -0
- package/devices/sylvania.d.ts +4 -0
- package/devices/sylvania.d.ts.map +1 -0
- package/devices/sylvania.js +226 -0
- package/devices/sylvania.js.map +1 -0
- package/devices/tapestry.d.ts +4 -0
- package/devices/tapestry.d.ts.map +1 -0
- package/devices/tapestry.js +56 -0
- package/devices/tapestry.js.map +1 -0
- package/devices/tci.d.ts +4 -0
- package/devices/tci.d.ts.map +1 -0
- package/devices/tci.js +29 -0
- package/devices/tci.js.map +1 -0
- package/devices/tech.d.ts +4 -0
- package/devices/tech.d.ts.map +1 -0
- package/devices/tech.js +131 -0
- package/devices/tech.js.map +1 -0
- package/devices/technicolor.d.ts +4 -0
- package/devices/technicolor.d.ts.map +1 -0
- package/devices/technicolor.js +102 -0
- package/devices/technicolor.js.map +1 -0
- package/devices/terncy.d.ts +4 -0
- package/devices/terncy.d.ts.map +1 -0
- package/devices/terncy.js +116 -0
- package/devices/terncy.js.map +1 -0
- package/devices/the_light_group.d.ts +4 -0
- package/devices/the_light_group.d.ts.map +1 -0
- package/devices/the_light_group.js +130 -0
- package/devices/the_light_group.js.map +1 -0
- package/devices/third_reality.d.ts +4 -0
- package/devices/third_reality.d.ts.map +1 -0
- package/devices/third_reality.js +569 -0
- package/devices/third_reality.js.map +1 -0
- package/devices/titan_products.d.ts +4 -0
- package/devices/titan_products.d.ts.map +1 -0
- package/devices/titan_products.js +62 -0
- package/devices/titan_products.js.map +1 -0
- package/devices/tlwglobal.d.ts +4 -0
- package/devices/tlwglobal.d.ts.map +1 -0
- package/devices/tlwglobal.js +32 -0
- package/devices/tlwglobal.js.map +1 -0
- package/devices/tplink.d.ts +4 -0
- package/devices/tplink.d.ts.map +1 -0
- package/devices/tplink.js +82 -0
- package/devices/tplink.js.map +1 -0
- package/devices/trust.d.ts +4 -0
- package/devices/trust.d.ts.map +1 -0
- package/devices/trust.js +183 -0
- package/devices/trust.js.map +1 -0
- package/devices/tubeszb.d.ts +4 -0
- package/devices/tubeszb.d.ts.map +1 -0
- package/devices/tubeszb.js +60 -0
- package/devices/tubeszb.js.map +1 -0
- package/devices/tuya.d.ts +4 -0
- package/devices/tuya.d.ts.map +1 -0
- package/devices/tuya.js +13607 -0
- package/devices/tuya.js.map +1 -0
- package/devices/ubisys.d.ts +4 -0
- package/devices/ubisys.d.ts.map +1 -0
- package/devices/ubisys.js +1300 -0
- package/devices/ubisys.js.map +1 -0
- package/devices/uhome.d.ts +4 -0
- package/devices/uhome.d.ts.map +1 -0
- package/devices/uhome.js +64 -0
- package/devices/uhome.js.map +1 -0
- package/devices/universal_electronics_inc.d.ts +4 -0
- package/devices/universal_electronics_inc.d.ts.map +1 -0
- package/devices/universal_electronics_inc.js +186 -0
- package/devices/universal_electronics_inc.js.map +1 -0
- package/devices/vbled.d.ts +4 -0
- package/devices/vbled.d.ts.map +1 -0
- package/devices/vbled.js +15 -0
- package/devices/vbled.js.map +1 -0
- package/devices/vesternet.d.ts +4 -0
- package/devices/vesternet.d.ts.map +1 -0
- package/devices/vesternet.js +330 -0
- package/devices/vesternet.js.map +1 -0
- package/devices/viessmann.d.ts +4 -0
- package/devices/viessmann.d.ts.map +1 -0
- package/devices/viessmann.js +115 -0
- package/devices/viessmann.js.map +1 -0
- package/devices/villeroy_boch.d.ts +4 -0
- package/devices/villeroy_boch.d.ts.map +1 -0
- package/devices/villeroy_boch.js +22 -0
- package/devices/villeroy_boch.js.map +1 -0
- package/devices/vimar.d.ts +4 -0
- package/devices/vimar.d.ts.map +1 -0
- package/devices/vimar.js +137 -0
- package/devices/vimar.js.map +1 -0
- package/devices/visonic.d.ts +4 -0
- package/devices/visonic.d.ts.map +1 -0
- package/devices/visonic.js +138 -0
- package/devices/visonic.js.map +1 -0
- package/devices/vrey.d.ts +4 -0
- package/devices/vrey.d.ts.map +1 -0
- package/devices/vrey.js +18 -0
- package/devices/vrey.js.map +1 -0
- package/devices/wally.d.ts +4 -0
- package/devices/wally.d.ts.map +1 -0
- package/devices/wally.js +64 -0
- package/devices/wally.js.map +1 -0
- package/devices/waxman.d.ts +4 -0
- package/devices/waxman.d.ts.map +1 -0
- package/devices/waxman.js +85 -0
- package/devices/waxman.js.map +1 -0
- package/devices/weiser.d.ts +4 -0
- package/devices/weiser.d.ts.map +1 -0
- package/devices/weiser.js +103 -0
- package/devices/weiser.js.map +1 -0
- package/devices/weten.d.ts +4 -0
- package/devices/weten.d.ts.map +1 -0
- package/devices/weten.js +89 -0
- package/devices/weten.js.map +1 -0
- package/devices/wirenboard.d.ts +4 -0
- package/devices/wirenboard.d.ts.map +1 -0
- package/devices/wirenboard.js +626 -0
- package/devices/wirenboard.js.map +1 -0
- package/devices/wisdom.d.ts +4 -0
- package/devices/wisdom.d.ts.map +1 -0
- package/devices/wisdom.js +15 -0
- package/devices/wisdom.js.map +1 -0
- package/devices/woolley.d.ts +4 -0
- package/devices/woolley.d.ts.map +1 -0
- package/devices/woolley.js +88 -0
- package/devices/woolley.js.map +1 -0
- package/devices/woox.d.ts +4 -0
- package/devices/woox.d.ts.map +1 -0
- package/devices/woox.js +137 -0
- package/devices/woox.js.map +1 -0
- package/devices/wyze.d.ts +4 -0
- package/devices/wyze.d.ts.map +1 -0
- package/devices/wyze.js +63 -0
- package/devices/wyze.js.map +1 -0
- package/devices/xinghuoyuan.d.ts +4 -0
- package/devices/xinghuoyuan.d.ts.map +1 -0
- package/devices/xinghuoyuan.js +15 -0
- package/devices/xinghuoyuan.js.map +1 -0
- package/devices/xyzroe.d.ts +4 -0
- package/devices/xyzroe.d.ts.map +1 -0
- package/devices/xyzroe.js +519 -0
- package/devices/xyzroe.js.map +1 -0
- package/devices/yale.d.ts +4 -0
- package/devices/yale.d.ts.map +1 -0
- package/devices/yale.js +503 -0
- package/devices/yale.js.map +1 -0
- package/devices/yandex.d.ts +4 -0
- package/devices/yandex.d.ts.map +1 -0
- package/devices/yandex.js +410 -0
- package/devices/yandex.js.map +1 -0
- package/devices/ynoa.d.ts +4 -0
- package/devices/ynoa.d.ts.map +1 -0
- package/devices/ynoa.js +113 -0
- package/devices/ynoa.js.map +1 -0
- package/devices/yookee.d.ts +4 -0
- package/devices/yookee.d.ts.map +1 -0
- package/devices/yookee.js +63 -0
- package/devices/yookee.js.map +1 -0
- package/devices/ysrsai.d.ts +4 -0
- package/devices/ysrsai.d.ts.map +1 -0
- package/devices/ysrsai.js +66 -0
- package/devices/ysrsai.js.map +1 -0
- package/devices/zemismart.d.ts +4 -0
- package/devices/zemismart.d.ts.map +1 -0
- package/devices/zemismart.js +405 -0
- package/devices/zemismart.js.map +1 -0
- package/devices/zen.d.ts +4 -0
- package/devices/zen.d.ts.map +1 -0
- package/devices/zen.js +96 -0
- package/devices/zen.js.map +1 -0
- package/devices/zigbeetlc.d.ts +13 -0
- package/devices/zigbeetlc.d.ts.map +1 -0
- package/devices/zigbeetlc.js +201 -0
- package/devices/zigbeetlc.js.map +1 -0
- package/devices/zipato.d.ts +4 -0
- package/devices/zipato.d.ts.map +1 -0
- package/devices/zipato.js +15 -0
- package/devices/zipato.js.map +1 -0
- package/index.d.ts +21 -0
- package/index.d.ts.map +1 -0
- package/index.js +488 -0
- package/index.js.map +1 -0
- package/lib/color.d.ts +272 -0
- package/lib/color.d.ts.map +1 -0
- package/lib/color.js +765 -0
- package/lib/color.js.map +1 -0
- package/lib/configureKey.d.ts +3 -0
- package/lib/configureKey.d.ts.map +1 -0
- package/lib/configureKey.js +939 -0
- package/lib/configureKey.js.map +1 -0
- package/lib/constants.d.ts +68 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +293 -0
- package/lib/constants.js.map +1 -0
- package/lib/develco.d.ts +15 -0
- package/lib/develco.d.ts.map +1 -0
- package/lib/develco.js +183 -0
- package/lib/develco.js.map +1 -0
- package/lib/ewelink.d.ts +30 -0
- package/lib/ewelink.d.ts.map +1 -0
- package/lib/ewelink.js +718 -0
- package/lib/ewelink.js.map +1 -0
- package/lib/exposes.d.ts +344 -0
- package/lib/exposes.d.ts.map +1 -0
- package/lib/exposes.js +1065 -0
- package/lib/exposes.js.map +1 -0
- package/lib/generateDefinition.d.ts +6 -0
- package/lib/generateDefinition.d.ts.map +1 -0
- package/lib/generateDefinition.js +356 -0
- package/lib/generateDefinition.js.map +1 -0
- package/lib/ikea.d.ts +39 -0
- package/lib/ikea.d.ts.map +1 -0
- package/lib/ikea.js +776 -0
- package/lib/ikea.js.map +1 -0
- package/lib/kelvinToXy.d.ts +8 -0
- package/lib/kelvinToXy.d.ts.map +1 -0
- package/lib/kelvinToXy.js +1914 -0
- package/lib/kelvinToXy.js.map +1 -0
- package/lib/ledvance.d.ts +20 -0
- package/lib/ledvance.d.ts.map +1 -0
- package/lib/ledvance.js +103 -0
- package/lib/ledvance.js.map +1 -0
- package/lib/legacy.d.ts +5128 -0
- package/lib/legacy.d.ts.map +1 -0
- package/lib/legacy.js +6603 -0
- package/lib/legacy.js.map +1 -0
- package/lib/legrand.d.ts +69 -0
- package/lib/legrand.d.ts.map +1 -0
- package/lib/legrand.js +282 -0
- package/lib/legrand.js.map +1 -0
- package/lib/light.d.ts +6 -0
- package/lib/light.d.ts.map +1 -0
- package/lib/light.js +146 -0
- package/lib/light.js.map +1 -0
- package/lib/logger.d.ts +4 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +14 -0
- package/lib/logger.js.map +1 -0
- package/lib/lumi.d.ts +953 -0
- package/lib/lumi.d.ts.map +1 -0
- package/lib/lumi.js +4973 -0
- package/lib/lumi.js.map +1 -0
- package/lib/modernExtend.d.ts +325 -0
- package/lib/modernExtend.d.ts.map +1 -0
- package/lib/modernExtend.js +1995 -0
- package/lib/modernExtend.js.map +1 -0
- package/lib/ota.d.ts +71 -0
- package/lib/ota.d.ts.map +1 -0
- package/lib/ota.js +663 -0
- package/lib/ota.js.map +1 -0
- package/lib/philips.d.ts +84 -0
- package/lib/philips.d.ts.map +1 -0
- package/lib/philips.js +657 -0
- package/lib/philips.js.map +1 -0
- package/lib/reporting.d.ts +58 -0
- package/lib/reporting.d.ts.map +1 -0
- package/lib/reporting.js +336 -0
- package/lib/reporting.js.map +1 -0
- package/lib/store.d.ts +7 -0
- package/lib/store.d.ts.map +1 -0
- package/lib/store.js +56 -0
- package/lib/store.js.map +1 -0
- package/lib/sunricher.d.ts +13 -0
- package/lib/sunricher.d.ts.map +1 -0
- package/lib/sunricher.js +14 -0
- package/lib/sunricher.js.map +1 -0
- package/lib/tuya.d.ts +764 -0
- package/lib/tuya.d.ts.map +1 -0
- package/lib/tuya.js +2425 -0
- package/lib/tuya.js.map +1 -0
- package/lib/types.d.ts +433 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +4 -0
- package/lib/types.js.map +1 -0
- package/lib/ubisys.d.ts +19 -0
- package/lib/ubisys.d.ts.map +1 -0
- package/lib/ubisys.js +293 -0
- package/lib/ubisys.js.map +1 -0
- package/lib/utils.d.ts +93 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +790 -0
- package/lib/utils.js.map +1 -0
- package/lib/zosung.d.ts +52 -0
- package/lib/zosung.d.ts.map +1 -0
- package/lib/zosung.js +256 -0
- package/lib/zosung.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,1995 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TIME_LOOKUP = void 0;
|
|
40
|
+
exports.setupAttributes = setupAttributes;
|
|
41
|
+
exports.setupConfigureForReporting = setupConfigureForReporting;
|
|
42
|
+
exports.setupConfigureForBinding = setupConfigureForBinding;
|
|
43
|
+
exports.setupConfigureForReading = setupConfigureForReading;
|
|
44
|
+
exports.determineEndpoint = determineEndpoint;
|
|
45
|
+
exports.forceDeviceType = forceDeviceType;
|
|
46
|
+
exports.forcePowerSource = forcePowerSource;
|
|
47
|
+
exports.linkQuality = linkQuality;
|
|
48
|
+
exports.battery = battery;
|
|
49
|
+
exports.deviceTemperature = deviceTemperature;
|
|
50
|
+
exports.identify = identify;
|
|
51
|
+
exports.onOff = onOff;
|
|
52
|
+
exports.commandsOnOff = commandsOnOff;
|
|
53
|
+
exports.customTimeResponse = customTimeResponse;
|
|
54
|
+
exports.illuminance = illuminance;
|
|
55
|
+
exports.temperature = temperature;
|
|
56
|
+
exports.pressure = pressure;
|
|
57
|
+
exports.flow = flow;
|
|
58
|
+
exports.humidity = humidity;
|
|
59
|
+
exports.soilMoisture = soilMoisture;
|
|
60
|
+
exports.occupancy = occupancy;
|
|
61
|
+
exports.co2 = co2;
|
|
62
|
+
exports.pm25 = pm25;
|
|
63
|
+
exports.light = light;
|
|
64
|
+
exports.commandsLevelCtrl = commandsLevelCtrl;
|
|
65
|
+
exports.commandsColorCtrl = commandsColorCtrl;
|
|
66
|
+
exports.lightingBallast = lightingBallast;
|
|
67
|
+
exports.lock = lock;
|
|
68
|
+
exports.windowCovering = windowCovering;
|
|
69
|
+
exports.commandsWindowCovering = commandsWindowCovering;
|
|
70
|
+
exports.iasZoneAlarm = iasZoneAlarm;
|
|
71
|
+
exports.iasWarning = iasWarning;
|
|
72
|
+
exports.electricityMeter = electricityMeter;
|
|
73
|
+
exports.commandsScenes = commandsScenes;
|
|
74
|
+
exports.enumLookup = enumLookup;
|
|
75
|
+
exports.numeric = numeric;
|
|
76
|
+
exports.binary = binary;
|
|
77
|
+
exports.text = text;
|
|
78
|
+
exports.actionEnumLookup = actionEnumLookup;
|
|
79
|
+
exports.quirkAddEndpointCluster = quirkAddEndpointCluster;
|
|
80
|
+
exports.quirkCheckinInterval = quirkCheckinInterval;
|
|
81
|
+
exports.reconfigureReportingsOnDeviceAnnounce = reconfigureReportingsOnDeviceAnnounce;
|
|
82
|
+
exports.deviceEndpoints = deviceEndpoints;
|
|
83
|
+
exports.deviceAddCustomCluster = deviceAddCustomCluster;
|
|
84
|
+
exports.ignoreClusterReport = ignoreClusterReport;
|
|
85
|
+
exports.bindCluster = bindCluster;
|
|
86
|
+
const zigbee_herdsman_1 = require("zigbee-herdsman");
|
|
87
|
+
const fromZigbee_1 = __importDefault(require("../converters/fromZigbee"));
|
|
88
|
+
const toZigbee_1 = __importDefault(require("../converters/toZigbee"));
|
|
89
|
+
const logger_1 = require("../lib/logger");
|
|
90
|
+
const globalStore = __importStar(require("../lib/store"));
|
|
91
|
+
const exposes_1 = require("./exposes");
|
|
92
|
+
const light_1 = require("./light");
|
|
93
|
+
const utils_1 = require("./utils");
|
|
94
|
+
function getEndpointsWithCluster(device, cluster, type) {
|
|
95
|
+
if (!device.endpoints) {
|
|
96
|
+
throw new Error(device.ieeeAddr + ' ' + device.endpoints);
|
|
97
|
+
}
|
|
98
|
+
const endpoints = type === 'input'
|
|
99
|
+
? device.endpoints.filter((ep) => ep.getInputClusters().find((c) => ((0, utils_1.isNumber)(cluster) ? c.ID === cluster : c.name === cluster)))
|
|
100
|
+
: device.endpoints.filter((ep) => ep.getOutputClusters().find((c) => ((0, utils_1.isNumber)(cluster) ? c.ID === cluster : c.name === cluster)));
|
|
101
|
+
if (endpoints.length === 0) {
|
|
102
|
+
throw new Error(`Device ${device.ieeeAddr} has no ${type} cluster ${cluster}`);
|
|
103
|
+
}
|
|
104
|
+
return endpoints;
|
|
105
|
+
}
|
|
106
|
+
const IAS_EXPOSE_LOOKUP = {
|
|
107
|
+
occupancy: exposes_1.presets.binary('occupancy', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device detected occupancy'),
|
|
108
|
+
contact: exposes_1.presets.binary('contact', exposes_1.access.STATE, false, true).withDescription('Indicates whether the device is opened or closed'),
|
|
109
|
+
smoke: exposes_1.presets.binary('smoke', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device detected smoke'),
|
|
110
|
+
water_leak: exposes_1.presets.binary('water_leak', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device detected a water leak'),
|
|
111
|
+
carbon_monoxide: exposes_1.presets.binary('carbon_monoxide', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device detected carbon monoxide'),
|
|
112
|
+
sos: exposes_1.presets.binary('sos', exposes_1.access.STATE, true, false).withLabel('SOS').withDescription('Indicates whether the SOS alarm is triggered'),
|
|
113
|
+
vibration: exposes_1.presets.binary('vibration', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device detected vibration'),
|
|
114
|
+
alarm: exposes_1.presets.binary('alarm', exposes_1.access.STATE, true, false).withDescription('Indicates whether the alarm is triggered'),
|
|
115
|
+
gas: exposes_1.presets.binary('gas', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device detected gas'),
|
|
116
|
+
alarm_1: exposes_1.presets.binary('alarm_1', exposes_1.access.STATE, true, false).withDescription('Indicates whether IAS Zone alarm 1 is active'),
|
|
117
|
+
alarm_2: exposes_1.presets.binary('alarm_2', exposes_1.access.STATE, true, false).withDescription('Indicates whether IAS Zone alarm 2 is active'),
|
|
118
|
+
tamper: exposes_1.presets.binary('tamper', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device is tampered').withCategory('diagnostic'),
|
|
119
|
+
rain: exposes_1.presets.binary('rain', exposes_1.access.STATE, true, false).withDescription('Indicates whether the device detected rainfall'),
|
|
120
|
+
battery_low: exposes_1.presets
|
|
121
|
+
.binary('battery_low', exposes_1.access.STATE, true, false)
|
|
122
|
+
.withDescription('Indicates whether the battery of the device is almost empty')
|
|
123
|
+
.withCategory('diagnostic'),
|
|
124
|
+
supervision_reports: exposes_1.presets
|
|
125
|
+
.binary('supervision_reports', exposes_1.access.STATE, true, false)
|
|
126
|
+
.withDescription('Indicates whether the device issues reports on zone operational status')
|
|
127
|
+
.withCategory('diagnostic'),
|
|
128
|
+
restore_reports: exposes_1.presets
|
|
129
|
+
.binary('restore_reports', exposes_1.access.STATE, true, false)
|
|
130
|
+
.withDescription('Indicates whether the device issues reports on alarm no longer being present')
|
|
131
|
+
.withCategory('diagnostic'),
|
|
132
|
+
ac_status: exposes_1.presets
|
|
133
|
+
.binary('ac_status', exposes_1.access.STATE, true, false)
|
|
134
|
+
.withDescription('Indicates whether the device mains voltage supply is at fault')
|
|
135
|
+
.withCategory('diagnostic'),
|
|
136
|
+
test: exposes_1.presets
|
|
137
|
+
.binary('test', exposes_1.access.STATE, true, false)
|
|
138
|
+
.withDescription('Indicates whether the device is currently performing a test')
|
|
139
|
+
.withCategory('diagnostic'),
|
|
140
|
+
trouble: exposes_1.presets
|
|
141
|
+
.binary('trouble', exposes_1.access.STATE, true, false)
|
|
142
|
+
.withDescription('Indicates whether the device is currently havin trouble')
|
|
143
|
+
.withCategory('diagnostic'),
|
|
144
|
+
battery_defect: exposes_1.presets
|
|
145
|
+
.binary('battery_defect', exposes_1.access.STATE, true, false)
|
|
146
|
+
.withDescription('Indicates whether the device battery is defective')
|
|
147
|
+
.withCategory('diagnostic'),
|
|
148
|
+
};
|
|
149
|
+
exports.TIME_LOOKUP = {
|
|
150
|
+
MAX: 65000,
|
|
151
|
+
'4_HOURS': 14400,
|
|
152
|
+
'1_HOUR': 3600,
|
|
153
|
+
'30_MINUTES': 1800,
|
|
154
|
+
'5_MINUTES': 300,
|
|
155
|
+
'2_MINUTES': 120,
|
|
156
|
+
'1_MINUTE': 60,
|
|
157
|
+
'10_SECONDS': 10,
|
|
158
|
+
'5_SECONDS': 5,
|
|
159
|
+
'1_SECOND': 1,
|
|
160
|
+
MIN: 0,
|
|
161
|
+
};
|
|
162
|
+
function convertReportingConfigTime(time) {
|
|
163
|
+
if ((0, utils_1.isString)(time)) {
|
|
164
|
+
if (!(time in exports.TIME_LOOKUP))
|
|
165
|
+
throw new Error(`Reporting time '${time}' is unknown`);
|
|
166
|
+
return exports.TIME_LOOKUP[time];
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return time;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async function setupAttributes(entity, coordinatorEndpoint, cluster, config, configureReporting = true, read = true) {
|
|
173
|
+
const endpoints = (0, utils_1.isEndpoint)(entity) ? [entity] : getEndpointsWithCluster(entity, cluster, 'input');
|
|
174
|
+
const ieeeAddr = (0, utils_1.isEndpoint)(entity) ? entity.deviceIeeeAddress : entity.ieeeAddr;
|
|
175
|
+
for (const endpoint of endpoints) {
|
|
176
|
+
logger_1.logger.debug(`Configure reporting: ${configureReporting}, read: ${read} for ${ieeeAddr}/${endpoint.ID} ${cluster} ${JSON.stringify(config)}`, 'zhc:setupattribute');
|
|
177
|
+
// Split into chunks of 4 to prevent to message becoming too big.
|
|
178
|
+
const chunks = (0, utils_1.splitArrayIntoChunks)(config, 4);
|
|
179
|
+
if (configureReporting) {
|
|
180
|
+
await endpoint.bind(cluster, coordinatorEndpoint);
|
|
181
|
+
for (const chunk of chunks) {
|
|
182
|
+
await endpoint.configureReporting(cluster, chunk.map((a) => ({
|
|
183
|
+
minimumReportInterval: convertReportingConfigTime(a.min),
|
|
184
|
+
maximumReportInterval: convertReportingConfigTime(a.max),
|
|
185
|
+
reportableChange: a.change,
|
|
186
|
+
attribute: a.attribute,
|
|
187
|
+
})));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (read) {
|
|
191
|
+
for (const chunk of chunks) {
|
|
192
|
+
try {
|
|
193
|
+
// Don't fail configuration if reading this attribute fails
|
|
194
|
+
// https://github.com/Koenkk/zigbee-herdsman-converters/pull/7074
|
|
195
|
+
await endpoint.read(cluster, chunk.map((a) => ((0, utils_1.isString)(a) ? a : (0, utils_1.isObject)(a.attribute) ? a.attribute.ID : a.attribute)));
|
|
196
|
+
}
|
|
197
|
+
catch (e) {
|
|
198
|
+
logger_1.logger.debug(`Reading attribute failed: ${e}`, 'zhc:setupattribute');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function setupConfigureForReporting(cluster, attribute, config, access, endpointNames) {
|
|
205
|
+
const configureReporting = !!config;
|
|
206
|
+
const read = !!(access & exposes_1.access.GET);
|
|
207
|
+
if (configureReporting || read) {
|
|
208
|
+
const configure = async (device, coordinatorEndpoint, definition) => {
|
|
209
|
+
const reportConfig = config ? { ...config, attribute: attribute } : { attribute, min: -1, max: -1, change: -1 };
|
|
210
|
+
let entities = [device];
|
|
211
|
+
if (endpointNames) {
|
|
212
|
+
const definitionEndpoints = definition.endpoint(device);
|
|
213
|
+
const endpointIds = endpointNames.map((e) => definitionEndpoints[e]);
|
|
214
|
+
entities = device.endpoints.filter((e) => endpointIds.includes(e.ID));
|
|
215
|
+
}
|
|
216
|
+
for (const entity of entities) {
|
|
217
|
+
await setupAttributes(entity, coordinatorEndpoint, cluster, [reportConfig], configureReporting, read);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
return configure;
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function setupConfigureForBinding(cluster, clusterType, endpointNames) {
|
|
227
|
+
const configure = async (device, coordinatorEndpoint, definition) => {
|
|
228
|
+
if (endpointNames) {
|
|
229
|
+
const definitionEndpoints = definition.endpoint(device);
|
|
230
|
+
const endpointIds = endpointNames.map((e) => definitionEndpoints[e]);
|
|
231
|
+
const endpoints = device.endpoints.filter((e) => endpointIds.includes(e.ID));
|
|
232
|
+
for (const endpoint of endpoints) {
|
|
233
|
+
await endpoint.bind(cluster, coordinatorEndpoint);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
const endpoints = getEndpointsWithCluster(device, cluster, clusterType);
|
|
238
|
+
for (const endpoint of endpoints) {
|
|
239
|
+
await endpoint.bind(cluster, coordinatorEndpoint);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
return configure;
|
|
244
|
+
}
|
|
245
|
+
function setupConfigureForReading(cluster, attributes, endpointNames) {
|
|
246
|
+
const configure = async (device, coordinatorEndpoint, definition) => {
|
|
247
|
+
if (endpointNames) {
|
|
248
|
+
const definitionEndpoints = definition.endpoint(device);
|
|
249
|
+
const endpointIds = endpointNames.map((e) => definitionEndpoints[e]);
|
|
250
|
+
const endpoints = device.endpoints.filter((e) => endpointIds.includes(e.ID));
|
|
251
|
+
for (const endpoint of endpoints) {
|
|
252
|
+
await endpoint.read(cluster, attributes);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
const endpoints = getEndpointsWithCluster(device, cluster, 'input');
|
|
257
|
+
for (const endpoint of endpoints) {
|
|
258
|
+
await endpoint.read(cluster, attributes);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
return configure;
|
|
263
|
+
}
|
|
264
|
+
function determineEndpoint(entity, meta, cluster) {
|
|
265
|
+
const { device, endpoint_name } = meta;
|
|
266
|
+
if (endpoint_name !== undefined) {
|
|
267
|
+
// In case an explicit endpoint is given, always send it to that endpoint
|
|
268
|
+
return entity;
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
// In case no endpoint is given, match the first endpoint which support the cluster.
|
|
272
|
+
return device.endpoints.find((e) => e.supportsInputCluster(cluster)) ?? device.endpoints[0];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// #region General
|
|
276
|
+
function forceDeviceType(args) {
|
|
277
|
+
const configure = [
|
|
278
|
+
async (device, coordinatorEndpoint, definition) => {
|
|
279
|
+
device.type = args.type;
|
|
280
|
+
device.save();
|
|
281
|
+
},
|
|
282
|
+
];
|
|
283
|
+
return { configure, isModernExtend: true };
|
|
284
|
+
}
|
|
285
|
+
function forcePowerSource(args) {
|
|
286
|
+
const configure = [
|
|
287
|
+
async (device, coordinatorEndpoint, definition) => {
|
|
288
|
+
device.powerSource = args.powerSource;
|
|
289
|
+
device.save();
|
|
290
|
+
},
|
|
291
|
+
];
|
|
292
|
+
return { configure, isModernExtend: true };
|
|
293
|
+
}
|
|
294
|
+
function linkQuality(args) {
|
|
295
|
+
args = { reporting: false, attribute: 'modelId', reportingConfig: { min: '1_HOUR', max: '4_HOURS', change: 0 }, ...args };
|
|
296
|
+
const exposes = [
|
|
297
|
+
exposes_1.presets
|
|
298
|
+
.numeric('linkquality', exposes_1.access.STATE)
|
|
299
|
+
.withUnit('lqi')
|
|
300
|
+
.withDescription('Link quality (signal strength)')
|
|
301
|
+
.withValueMin(0)
|
|
302
|
+
.withValueMax(255)
|
|
303
|
+
.withCategory('diagnostic'),
|
|
304
|
+
];
|
|
305
|
+
const fromZigbee = [
|
|
306
|
+
{
|
|
307
|
+
cluster: 'genBasic',
|
|
308
|
+
type: ['attributeReport', 'readResponse'],
|
|
309
|
+
convert: (model, msg, publish, options, meta) => {
|
|
310
|
+
return { linkquality: msg.linkquality };
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
];
|
|
314
|
+
const result = { exposes, fromZigbee, isModernExtend: true };
|
|
315
|
+
if (args.reporting) {
|
|
316
|
+
result.configure = [setupConfigureForReporting('genBasic', args.attribute, args.reportingConfig, exposes_1.access.GET)];
|
|
317
|
+
}
|
|
318
|
+
return result;
|
|
319
|
+
}
|
|
320
|
+
function battery(args) {
|
|
321
|
+
args = {
|
|
322
|
+
percentage: true,
|
|
323
|
+
voltage: false,
|
|
324
|
+
lowStatus: false,
|
|
325
|
+
percentageReporting: true,
|
|
326
|
+
voltageReporting: false,
|
|
327
|
+
dontDividePercentage: false,
|
|
328
|
+
percentageReportingConfig: { min: '1_HOUR', max: 'MAX', change: 10 },
|
|
329
|
+
voltageReportingConfig: { min: '1_HOUR', max: 'MAX', change: 10 },
|
|
330
|
+
...args,
|
|
331
|
+
};
|
|
332
|
+
const exposes = [];
|
|
333
|
+
if (args.percentage) {
|
|
334
|
+
exposes.push(exposes_1.presets
|
|
335
|
+
.numeric('battery', exposes_1.access.STATE_GET)
|
|
336
|
+
.withUnit('%')
|
|
337
|
+
.withDescription('Remaining battery in %')
|
|
338
|
+
.withValueMin(0)
|
|
339
|
+
.withValueMax(100)
|
|
340
|
+
.withCategory('diagnostic'));
|
|
341
|
+
}
|
|
342
|
+
if (args.voltage) {
|
|
343
|
+
exposes.push(exposes_1.presets.numeric('voltage', exposes_1.access.STATE_GET).withUnit('mV').withDescription('Reported battery voltage in millivolts').withCategory('diagnostic'));
|
|
344
|
+
}
|
|
345
|
+
if (args.lowStatus) {
|
|
346
|
+
exposes.push(exposes_1.presets.binary('battery_low', exposes_1.access.STATE, true, false).withDescription('Empty battery indicator').withCategory('diagnostic'));
|
|
347
|
+
}
|
|
348
|
+
const fromZigbee = [
|
|
349
|
+
{
|
|
350
|
+
cluster: 'genPowerCfg',
|
|
351
|
+
type: ['attributeReport', 'readResponse'],
|
|
352
|
+
convert: (model, msg, publish, options, meta) => {
|
|
353
|
+
const payload = {};
|
|
354
|
+
if (msg.data.batteryPercentageRemaining !== undefined && msg.data['batteryPercentageRemaining'] < 255) {
|
|
355
|
+
// Some devices do not comply to the ZCL and report a
|
|
356
|
+
// batteryPercentageRemaining of 100 when the battery is full (should be 200).
|
|
357
|
+
const dontDividePercentage = args.dontDividePercentage;
|
|
358
|
+
let percentage = msg.data['batteryPercentageRemaining'];
|
|
359
|
+
percentage = dontDividePercentage ? percentage : percentage / 2;
|
|
360
|
+
if (args.percentage)
|
|
361
|
+
payload.battery = (0, utils_1.precisionRound)(percentage, 2);
|
|
362
|
+
}
|
|
363
|
+
if (msg.data.batteryVoltage !== undefined && msg.data['batteryVoltage'] < 255) {
|
|
364
|
+
// Deprecated: voltage is = mV now but should be V
|
|
365
|
+
if (args.voltage)
|
|
366
|
+
payload.voltage = msg.data['batteryVoltage'] * 100;
|
|
367
|
+
if (args.voltageToPercentage) {
|
|
368
|
+
payload.battery = (0, utils_1.batteryVoltageToPercentage)(payload.voltage, args.voltageToPercentage);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (msg.data.batteryAlarmState !== undefined) {
|
|
372
|
+
const battery1Low = (msg.data.batteryAlarmState & (1 << 0) ||
|
|
373
|
+
msg.data.batteryAlarmState & (1 << 1) ||
|
|
374
|
+
msg.data.batteryAlarmState & (1 << 2) ||
|
|
375
|
+
msg.data.batteryAlarmState & (1 << 3)) > 0;
|
|
376
|
+
const battery2Low = (msg.data.batteryAlarmState & (1 << 10) ||
|
|
377
|
+
msg.data.batteryAlarmState & (1 << 11) ||
|
|
378
|
+
msg.data.batteryAlarmState & (1 << 12) ||
|
|
379
|
+
msg.data.batteryAlarmState & (1 << 13)) > 0;
|
|
380
|
+
const battery3Low = (msg.data.batteryAlarmState & (1 << 20) ||
|
|
381
|
+
msg.data.batteryAlarmState & (1 << 21) ||
|
|
382
|
+
msg.data.batteryAlarmState & (1 << 22) ||
|
|
383
|
+
msg.data.batteryAlarmState & (1 << 23)) > 0;
|
|
384
|
+
if (args.lowStatus)
|
|
385
|
+
payload.battery_low = battery1Low || battery2Low || battery3Low;
|
|
386
|
+
}
|
|
387
|
+
return payload;
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
];
|
|
391
|
+
const toZigbee = [
|
|
392
|
+
{
|
|
393
|
+
key: ['battery', 'voltage'],
|
|
394
|
+
convertGet: async (entity, key, meta) => {
|
|
395
|
+
// Don't fail GET reqest if reading fails
|
|
396
|
+
// Split reading is needed for more clear debug logs
|
|
397
|
+
const ep = determineEndpoint(entity, meta, 'genPowerCfg');
|
|
398
|
+
try {
|
|
399
|
+
await ep.read('genPowerCfg', ['batteryPercentageRemaining']);
|
|
400
|
+
}
|
|
401
|
+
catch (e) {
|
|
402
|
+
logger_1.logger.debug(`Reading batteryPercentageRemaining failed: ${e}, device probably doesn't support it`, 'zhc:setupattribute');
|
|
403
|
+
}
|
|
404
|
+
try {
|
|
405
|
+
await ep.read('genPowerCfg', ['batteryVoltage']);
|
|
406
|
+
}
|
|
407
|
+
catch (e) {
|
|
408
|
+
logger_1.logger.debug(`Reading batteryVoltage failed: ${e}, device probably doesn't support it`, 'zhc:setupattribute');
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
];
|
|
413
|
+
const result = { exposes, fromZigbee, toZigbee, isModernExtend: true };
|
|
414
|
+
if (args.percentageReporting || args.voltageReporting) {
|
|
415
|
+
const configure = [];
|
|
416
|
+
if (args.percentageReporting) {
|
|
417
|
+
configure.push(setupConfigureForReporting('genPowerCfg', 'batteryPercentageRemaining', args.percentageReportingConfig, exposes_1.access.STATE_GET));
|
|
418
|
+
}
|
|
419
|
+
if (args.voltageReporting) {
|
|
420
|
+
configure.push(setupConfigureForReporting('genPowerCfg', 'batteryVoltage', args.voltageReportingConfig, exposes_1.access.STATE_GET));
|
|
421
|
+
}
|
|
422
|
+
configure.push((0, utils_1.configureSetPowerSourceWhenUnknown)('Battery'));
|
|
423
|
+
result.configure = configure;
|
|
424
|
+
}
|
|
425
|
+
if (args.voltageToPercentage || args.dontDividePercentage) {
|
|
426
|
+
const meta = { battery: {} };
|
|
427
|
+
if (args.voltageToPercentage)
|
|
428
|
+
meta.battery.voltageToPercentage = args.voltageToPercentage;
|
|
429
|
+
if (args.dontDividePercentage)
|
|
430
|
+
meta.battery.dontDividePercentage = args.dontDividePercentage;
|
|
431
|
+
result.meta = meta;
|
|
432
|
+
}
|
|
433
|
+
return result;
|
|
434
|
+
}
|
|
435
|
+
function deviceTemperature(args) {
|
|
436
|
+
return numeric({
|
|
437
|
+
name: 'device_temperature',
|
|
438
|
+
cluster: 'genDeviceTempCfg',
|
|
439
|
+
attribute: 'currentTemperature',
|
|
440
|
+
reporting: { min: '5_MINUTES', max: '1_HOUR', change: 1 },
|
|
441
|
+
description: 'Temperature of the device',
|
|
442
|
+
unit: '°C',
|
|
443
|
+
access: 'STATE_GET',
|
|
444
|
+
entityCategory: 'diagnostic',
|
|
445
|
+
...args,
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
function identify(args) {
|
|
449
|
+
args = { isSleepy: false, ...args };
|
|
450
|
+
const normal = exposes_1.presets.enum('identify', exposes_1.access.SET, ['identify']).withDescription('Initiate device identification').withCategory('config');
|
|
451
|
+
const sleepy = exposes_1.presets
|
|
452
|
+
.enum('identify', exposes_1.access.SET, ['identify'])
|
|
453
|
+
.withDescription('Initiate device identification. This device is asleep by default.' +
|
|
454
|
+
'You may need to wake it up first before sending the identify command.')
|
|
455
|
+
.withCategory('config');
|
|
456
|
+
const exposes = args.isSleepy ? [sleepy] : [normal];
|
|
457
|
+
const identifyTimeout = exposes_1.presets
|
|
458
|
+
.numeric('identify_timeout', exposes_1.access.SET)
|
|
459
|
+
.withDescription('Sets the duration of the identification procedure in seconds (i.e., how long the device would flash).' +
|
|
460
|
+
'The value ranges from 1 to 30 seconds (default: 3).')
|
|
461
|
+
.withValueMin(1)
|
|
462
|
+
.withValueMax(30);
|
|
463
|
+
const toZigbee = [
|
|
464
|
+
{
|
|
465
|
+
key: ['identify'],
|
|
466
|
+
options: [identifyTimeout],
|
|
467
|
+
convertSet: async (entity, key, value, meta) => {
|
|
468
|
+
const identifyTimeout = meta.options.identify_timeout ?? 3;
|
|
469
|
+
await entity.command('genIdentify', 'identify', { identifytime: identifyTimeout }, (0, utils_1.getOptions)(meta.mapped, entity));
|
|
470
|
+
},
|
|
471
|
+
},
|
|
472
|
+
];
|
|
473
|
+
return { exposes, toZigbee, isModernExtend: true };
|
|
474
|
+
}
|
|
475
|
+
function onOff(args) {
|
|
476
|
+
args = { powerOnBehavior: true, skipDuplicateTransaction: false, configureReporting: true, ...args };
|
|
477
|
+
const exposes = args.description
|
|
478
|
+
? (0, utils_1.exposeEndpoints)(exposes_1.presets.switch(args.description), args.endpointNames)
|
|
479
|
+
: (0, utils_1.exposeEndpoints)(exposes_1.presets.switch(), args.endpointNames);
|
|
480
|
+
const fromZigbee = [args.skipDuplicateTransaction ? fromZigbee_1.default.on_off_skip_duplicate_transaction : fromZigbee_1.default.on_off];
|
|
481
|
+
const toZigbee = [args?.endpointNames ? { ...toZigbee_1.default.on_off, endpoints: args?.endpointNames } : toZigbee_1.default.on_off];
|
|
482
|
+
if (args.powerOnBehavior) {
|
|
483
|
+
exposes.push(...(0, utils_1.exposeEndpoints)(exposes_1.presets.power_on_behavior(['off', 'on', 'toggle', 'previous']), args.endpointNames));
|
|
484
|
+
fromZigbee.push(fromZigbee_1.default.power_on_behavior);
|
|
485
|
+
toZigbee.push(toZigbee_1.default.power_on_behavior);
|
|
486
|
+
}
|
|
487
|
+
const result = { exposes, fromZigbee, toZigbee, isModernExtend: true };
|
|
488
|
+
if (args.ota)
|
|
489
|
+
result.ota = args.ota;
|
|
490
|
+
if (args.configureReporting) {
|
|
491
|
+
result.configure = [
|
|
492
|
+
async (device, coordinatorEndpoint) => {
|
|
493
|
+
await setupAttributes(device, coordinatorEndpoint, 'genOnOff', [{ attribute: 'onOff', min: 'MIN', max: 'MAX', change: 1 }]);
|
|
494
|
+
if (args.powerOnBehavior) {
|
|
495
|
+
try {
|
|
496
|
+
// Don't fail configure if reading this attribute fails, some devices don't support it.
|
|
497
|
+
await setupAttributes(device, coordinatorEndpoint, 'genOnOff', [{ attribute: 'startUpOnOff', min: 'MIN', max: 'MAX', change: 1 }], false);
|
|
498
|
+
}
|
|
499
|
+
catch (e) {
|
|
500
|
+
if (e.message.includes('UNSUPPORTED_ATTRIBUTE')) {
|
|
501
|
+
logger_1.logger.debug('Reading startUpOnOff failed, this features is unsupported', 'zhc:onoff');
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
throw e;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
(0, utils_1.configureSetPowerSourceWhenUnknown)('Mains (single phase)'),
|
|
510
|
+
];
|
|
511
|
+
}
|
|
512
|
+
return result;
|
|
513
|
+
}
|
|
514
|
+
function commandsOnOff(args) {
|
|
515
|
+
args = { commands: ['on', 'off', 'toggle'], bind: true, ...args };
|
|
516
|
+
let actions = args.commands;
|
|
517
|
+
if (args.endpointNames) {
|
|
518
|
+
actions = args.commands.map((c) => args.endpointNames.map((e) => `${c}_${e}`)).flat();
|
|
519
|
+
}
|
|
520
|
+
const exposes = [exposes_1.presets.enum('action', exposes_1.access.STATE, actions).withDescription('Triggered action (e.g. a button click)')];
|
|
521
|
+
const actionPayloadLookup = {
|
|
522
|
+
commandOn: 'on',
|
|
523
|
+
commandOff: 'off',
|
|
524
|
+
commandOffWithEffect: 'off',
|
|
525
|
+
commandToggle: 'toggle',
|
|
526
|
+
};
|
|
527
|
+
const fromZigbee = [
|
|
528
|
+
{
|
|
529
|
+
cluster: 'genOnOff',
|
|
530
|
+
type: ['commandOn', 'commandOff', 'commandOffWithEffect', 'commandToggle'],
|
|
531
|
+
convert: (model, msg, publish, options, meta) => {
|
|
532
|
+
if ((0, utils_1.hasAlreadyProcessedMessage)(msg, model))
|
|
533
|
+
return;
|
|
534
|
+
const payload = { action: (0, utils_1.postfixWithEndpointName)(actionPayloadLookup[msg.type], msg, model, meta) };
|
|
535
|
+
(0, utils_1.addActionGroup)(payload, msg, model);
|
|
536
|
+
return payload;
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
|
+
];
|
|
540
|
+
const result = { exposes, fromZigbee, isModernExtend: true };
|
|
541
|
+
if (args.bind)
|
|
542
|
+
result.configure = [setupConfigureForBinding('genOnOff', 'output', args.endpointNames)];
|
|
543
|
+
return result;
|
|
544
|
+
}
|
|
545
|
+
function customTimeResponse(start) {
|
|
546
|
+
// The Zigbee Cluster Library specification states that the genTime.time response should be the
|
|
547
|
+
// number of seconds since 1st Jan 2000 00:00:00 UTC. This extend modifies that:
|
|
548
|
+
// 1970_UTC: number of seconds since the Unix Epoch (1st Jan 1970 00:00:00 UTC)
|
|
549
|
+
// 2000_LOCAL: seconds since 1 January in the local time zone.
|
|
550
|
+
// Disable the responses of zigbee-herdsman and respond here instead.
|
|
551
|
+
const onEvent = async (type, data, device, options, state) => {
|
|
552
|
+
if (!device.customReadResponse) {
|
|
553
|
+
device.customReadResponse = (frame, endpoint) => {
|
|
554
|
+
if (frame.isCluster('genTime')) {
|
|
555
|
+
const payload = {};
|
|
556
|
+
if (start === '1970_UTC') {
|
|
557
|
+
const time = Math.round(new Date().getTime() / 1000);
|
|
558
|
+
payload.time = time;
|
|
559
|
+
payload.localTime = time - new Date().getTimezoneOffset() * 60;
|
|
560
|
+
}
|
|
561
|
+
else if (start === '2000_LOCAL') {
|
|
562
|
+
const oneJanuary2000 = new Date('January 01, 2000 00:00:00 UTC+00:00').getTime();
|
|
563
|
+
const secondsUTC = Math.round((new Date().getTime() - oneJanuary2000) / 1000);
|
|
564
|
+
payload.time = secondsUTC - new Date().getTimezoneOffset() * 60;
|
|
565
|
+
}
|
|
566
|
+
endpoint.readResponse('genTime', frame.header.transactionSequenceNumber, payload).catch((e) => {
|
|
567
|
+
logger_1.logger.warning(`Custom time response failed for '${device.ieeeAddr}': ${e}`, 'zhc:customtimeresponse');
|
|
568
|
+
});
|
|
569
|
+
return true;
|
|
570
|
+
}
|
|
571
|
+
return false;
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
return { onEvent, isModernExtend: true };
|
|
576
|
+
}
|
|
577
|
+
// #endregion
|
|
578
|
+
// #region Measurement and Sensing
|
|
579
|
+
function illuminance(args) {
|
|
580
|
+
const luxScale = (value, type) => {
|
|
581
|
+
let result = value;
|
|
582
|
+
if (type === 'from') {
|
|
583
|
+
result = Math.pow(10, (result - 1) / 10000);
|
|
584
|
+
}
|
|
585
|
+
return result;
|
|
586
|
+
};
|
|
587
|
+
return numeric({
|
|
588
|
+
name: 'illuminance',
|
|
589
|
+
cluster: 'msIlluminanceMeasurement',
|
|
590
|
+
attribute: 'measuredValue',
|
|
591
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 5 }, // 5 lux
|
|
592
|
+
description: 'Measured illuminance',
|
|
593
|
+
unit: 'lx',
|
|
594
|
+
scale: luxScale,
|
|
595
|
+
access: 'STATE_GET',
|
|
596
|
+
...args,
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
function temperature(args) {
|
|
600
|
+
return numeric({
|
|
601
|
+
name: 'temperature',
|
|
602
|
+
cluster: 'msTemperatureMeasurement',
|
|
603
|
+
attribute: 'measuredValue',
|
|
604
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 100 },
|
|
605
|
+
description: 'Measured temperature value',
|
|
606
|
+
unit: '°C',
|
|
607
|
+
scale: 100,
|
|
608
|
+
access: 'STATE_GET',
|
|
609
|
+
...args,
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
function pressure(args) {
|
|
613
|
+
return numeric({
|
|
614
|
+
name: 'pressure',
|
|
615
|
+
cluster: 'msPressureMeasurement',
|
|
616
|
+
attribute: 'measuredValue',
|
|
617
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 50 }, // 5 kPa
|
|
618
|
+
description: 'The measured atmospheric pressure',
|
|
619
|
+
unit: 'kPa',
|
|
620
|
+
scale: 10,
|
|
621
|
+
access: 'STATE_GET',
|
|
622
|
+
...args,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
function flow(args) {
|
|
626
|
+
return numeric({
|
|
627
|
+
name: 'flow',
|
|
628
|
+
cluster: 'msFlowMeasurement',
|
|
629
|
+
attribute: 'measuredValue',
|
|
630
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 10 },
|
|
631
|
+
description: 'Measured water flow',
|
|
632
|
+
unit: 'm³/h',
|
|
633
|
+
scale: 10,
|
|
634
|
+
access: 'STATE_GET',
|
|
635
|
+
...args,
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
function humidity(args) {
|
|
639
|
+
return numeric({
|
|
640
|
+
name: 'humidity',
|
|
641
|
+
cluster: 'msRelativeHumidity',
|
|
642
|
+
attribute: 'measuredValue',
|
|
643
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 100 },
|
|
644
|
+
description: 'Measured relative humidity',
|
|
645
|
+
unit: '%',
|
|
646
|
+
scale: 100,
|
|
647
|
+
access: 'STATE_GET',
|
|
648
|
+
...args,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
function soilMoisture(args) {
|
|
652
|
+
return numeric({
|
|
653
|
+
name: 'soil_moisture',
|
|
654
|
+
cluster: 'msSoilMoisture',
|
|
655
|
+
attribute: 'measuredValue',
|
|
656
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 100 },
|
|
657
|
+
description: 'Measured soil moisture value',
|
|
658
|
+
unit: '%',
|
|
659
|
+
scale: 100,
|
|
660
|
+
access: 'STATE_GET',
|
|
661
|
+
...args,
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
function occupancy(args) {
|
|
665
|
+
args = { reporting: true, reportingConfig: { min: '10_SECONDS', max: '1_MINUTE', change: 0 }, ...args };
|
|
666
|
+
const templateExposes = [exposes_1.presets.occupancy().withAccess(exposes_1.access.STATE_GET)];
|
|
667
|
+
const exposes = args.endpointNames
|
|
668
|
+
? templateExposes.map((exp) => args.endpointNames.map((ep) => exp.withEndpoint(ep))).flat()
|
|
669
|
+
: templateExposes;
|
|
670
|
+
const fromZigbee = [
|
|
671
|
+
{
|
|
672
|
+
cluster: 'msOccupancySensing',
|
|
673
|
+
type: ['attributeReport', 'readResponse'],
|
|
674
|
+
options: [exposes_1.options.no_occupancy_since_false()],
|
|
675
|
+
convert: (model, msg, publish, options, meta) => {
|
|
676
|
+
if ('occupancy' in msg.data && (!args.endpointNames || args.endpointNames.includes((0, utils_1.getEndpointName)(msg, model, meta).toString()))) {
|
|
677
|
+
const propertyName = (0, utils_1.postfixWithEndpointName)('occupancy', msg, model, meta);
|
|
678
|
+
const payload = { [propertyName]: (msg.data['occupancy'] & 1) > 0 };
|
|
679
|
+
(0, utils_1.noOccupancySince)(msg.endpoint, options, publish, payload[propertyName] ? 'stop' : 'start');
|
|
680
|
+
return payload;
|
|
681
|
+
}
|
|
682
|
+
},
|
|
683
|
+
},
|
|
684
|
+
];
|
|
685
|
+
const toZigbee = [
|
|
686
|
+
{
|
|
687
|
+
key: ['occupancy'],
|
|
688
|
+
convertGet: async (entity, key, meta) => {
|
|
689
|
+
await determineEndpoint(entity, meta, 'msOccupancySensing').read('msOccupancySensing', ['occupancy']);
|
|
690
|
+
},
|
|
691
|
+
},
|
|
692
|
+
];
|
|
693
|
+
const settingsExtends = [];
|
|
694
|
+
const settingsTemplate = {
|
|
695
|
+
cluster: 'msOccupancySensing',
|
|
696
|
+
description: '',
|
|
697
|
+
endpointNames: args.endpointNames,
|
|
698
|
+
access: 'ALL',
|
|
699
|
+
entityCategory: 'config',
|
|
700
|
+
};
|
|
701
|
+
const attributesForReading = [];
|
|
702
|
+
if (args.pirConfig) {
|
|
703
|
+
if (args.pirConfig.includes('otu_delay')) {
|
|
704
|
+
settingsExtends.push(numeric({
|
|
705
|
+
name: 'occupancy_timeout',
|
|
706
|
+
attribute: 'pirOToUDelay',
|
|
707
|
+
valueMin: 0,
|
|
708
|
+
valueMax: 65534,
|
|
709
|
+
unit: 's',
|
|
710
|
+
...settingsTemplate,
|
|
711
|
+
description: 'Time in seconds before occupancy is cleared after the last detected movement.',
|
|
712
|
+
}));
|
|
713
|
+
attributesForReading.push('pirOToUDelay');
|
|
714
|
+
}
|
|
715
|
+
if (args.pirConfig.includes('uto_delay')) {
|
|
716
|
+
settingsExtends.push(numeric({
|
|
717
|
+
name: 'pir_uto_delay',
|
|
718
|
+
attribute: 'pirUToODelay',
|
|
719
|
+
valueMin: 0,
|
|
720
|
+
valueMax: 65534,
|
|
721
|
+
...settingsTemplate,
|
|
722
|
+
}));
|
|
723
|
+
attributesForReading.push('pirUToODelay');
|
|
724
|
+
}
|
|
725
|
+
if (args.pirConfig.includes('uto_threshold')) {
|
|
726
|
+
settingsExtends.push(numeric({
|
|
727
|
+
name: 'pir_uto_threshold',
|
|
728
|
+
attribute: 'pirUToOThreshold',
|
|
729
|
+
valueMin: 1,
|
|
730
|
+
valueMax: 254,
|
|
731
|
+
...settingsTemplate,
|
|
732
|
+
}));
|
|
733
|
+
attributesForReading.push('pirUToOThreshold');
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
if (args.ultrasonicConfig) {
|
|
737
|
+
if (args.pirConfig.includes('otu_delay')) {
|
|
738
|
+
settingsExtends.push(numeric({
|
|
739
|
+
name: 'ultrasonic_otu_delay',
|
|
740
|
+
attribute: 'ultrasonicOToUDelay',
|
|
741
|
+
valueMin: 0,
|
|
742
|
+
valueMax: 65534,
|
|
743
|
+
...settingsTemplate,
|
|
744
|
+
}));
|
|
745
|
+
attributesForReading.push('ultrasonicOToUDelay');
|
|
746
|
+
}
|
|
747
|
+
if (args.pirConfig.includes('uto_delay')) {
|
|
748
|
+
settingsExtends.push(numeric({
|
|
749
|
+
name: 'ultrasonic_uto_delay',
|
|
750
|
+
attribute: 'ultrasonicUToODelay',
|
|
751
|
+
valueMin: 0,
|
|
752
|
+
valueMax: 65534,
|
|
753
|
+
...settingsTemplate,
|
|
754
|
+
}));
|
|
755
|
+
attributesForReading.push('ultrasonicUToODelay');
|
|
756
|
+
}
|
|
757
|
+
if (args.pirConfig.includes('uto_threshold')) {
|
|
758
|
+
settingsExtends.push(numeric({
|
|
759
|
+
name: 'ultrasonic_uto_threshold',
|
|
760
|
+
attribute: 'ultrasonicUToOThreshold',
|
|
761
|
+
valueMin: 1,
|
|
762
|
+
valueMax: 254,
|
|
763
|
+
...settingsTemplate,
|
|
764
|
+
}));
|
|
765
|
+
attributesForReading.push('ultrasonicUToOThreshold');
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
if (args.contactConfig) {
|
|
769
|
+
if (args.pirConfig.includes('otu_delay')) {
|
|
770
|
+
settingsExtends.push(numeric({
|
|
771
|
+
name: 'contact_otu_delay',
|
|
772
|
+
attribute: 'contactOToUDelay',
|
|
773
|
+
valueMin: 0,
|
|
774
|
+
valueMax: 65534,
|
|
775
|
+
...settingsTemplate,
|
|
776
|
+
}));
|
|
777
|
+
attributesForReading.push('contactOToUDelay');
|
|
778
|
+
}
|
|
779
|
+
if (args.pirConfig.includes('uto_delay')) {
|
|
780
|
+
settingsExtends.push(numeric({
|
|
781
|
+
name: 'contact_uto_delay',
|
|
782
|
+
attribute: 'contactUToODelay',
|
|
783
|
+
valueMin: 0,
|
|
784
|
+
valueMax: 65534,
|
|
785
|
+
...settingsTemplate,
|
|
786
|
+
}));
|
|
787
|
+
attributesForReading.push('contactUToODelay');
|
|
788
|
+
}
|
|
789
|
+
if (args.pirConfig.includes('uto_threshold')) {
|
|
790
|
+
settingsExtends.push(numeric({
|
|
791
|
+
name: 'contact_uto_threshold',
|
|
792
|
+
attribute: 'contactUToOThreshold',
|
|
793
|
+
valueMin: 1,
|
|
794
|
+
valueMax: 254,
|
|
795
|
+
...settingsTemplate,
|
|
796
|
+
}));
|
|
797
|
+
attributesForReading.push('contactUToOThreshold');
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
settingsExtends.map((extend) => exposes.push(...extend.exposes));
|
|
801
|
+
settingsExtends.map((extend) => fromZigbee.push(...extend.fromZigbee));
|
|
802
|
+
settingsExtends.map((extend) => toZigbee.push(...extend.toZigbee));
|
|
803
|
+
const configure = [];
|
|
804
|
+
if (attributesForReading.length > 0)
|
|
805
|
+
configure.push(setupConfigureForReading('msOccupancySensing', attributesForReading, args.endpointNames));
|
|
806
|
+
if (args.reporting) {
|
|
807
|
+
configure.push(setupConfigureForReporting('msOccupancySensing', 'occupancy', args.reportingConfig, exposes_1.access.STATE_GET, args.endpointNames));
|
|
808
|
+
}
|
|
809
|
+
return { exposes, fromZigbee, toZigbee, configure, isModernExtend: true };
|
|
810
|
+
}
|
|
811
|
+
function co2(args) {
|
|
812
|
+
return numeric({
|
|
813
|
+
name: 'co2',
|
|
814
|
+
cluster: 'msCO2',
|
|
815
|
+
label: 'CO2',
|
|
816
|
+
attribute: 'measuredValue',
|
|
817
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 0.00005 }, // 50 ppm change
|
|
818
|
+
description: 'Measured value',
|
|
819
|
+
unit: 'ppm',
|
|
820
|
+
scale: 0.000001,
|
|
821
|
+
access: 'STATE_GET',
|
|
822
|
+
...args,
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
function pm25(args) {
|
|
826
|
+
return numeric({
|
|
827
|
+
name: 'pm25',
|
|
828
|
+
cluster: 'pm25Measurement',
|
|
829
|
+
attribute: 'measuredValue',
|
|
830
|
+
reporting: { min: '10_SECONDS', max: '1_HOUR', change: 1 },
|
|
831
|
+
description: 'Measured PM2.5 (particulate matter) concentration',
|
|
832
|
+
unit: 'µg/m³',
|
|
833
|
+
access: 'STATE_GET',
|
|
834
|
+
...args,
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
function light(args) {
|
|
838
|
+
args = { effect: true, powerOnBehavior: true, configureReporting: false, ...args };
|
|
839
|
+
if (args.colorTemp) {
|
|
840
|
+
args.colorTemp = { startup: true, ...args.colorTemp };
|
|
841
|
+
}
|
|
842
|
+
const argsColor = args.color
|
|
843
|
+
? {
|
|
844
|
+
modes: ['xy'],
|
|
845
|
+
applyRedFix: false,
|
|
846
|
+
enhancedHue: true,
|
|
847
|
+
...((0, utils_1.isObject)(args.color) ? args.color : {}),
|
|
848
|
+
}
|
|
849
|
+
: false;
|
|
850
|
+
const lightExpose = (0, utils_1.exposeEndpoints)(exposes_1.presets.light().withBrightness(), args.endpointNames);
|
|
851
|
+
const fromZigbee = [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.ignore_basic_report, fromZigbee_1.default.level_config];
|
|
852
|
+
const toZigbee = [
|
|
853
|
+
args?.endpointNames ? { ...toZigbee_1.default.light_onoff_brightness, endpoints: args?.endpointNames } : toZigbee_1.default.light_onoff_brightness,
|
|
854
|
+
toZigbee_1.default.ignore_transition,
|
|
855
|
+
toZigbee_1.default.level_config,
|
|
856
|
+
toZigbee_1.default.ignore_rate,
|
|
857
|
+
toZigbee_1.default.light_brightness_move,
|
|
858
|
+
toZigbee_1.default.light_brightness_step,
|
|
859
|
+
];
|
|
860
|
+
const meta = {};
|
|
861
|
+
if (args.colorTemp || argsColor) {
|
|
862
|
+
fromZigbee.push(fromZigbee_1.default.color_colortemp);
|
|
863
|
+
if (args.colorTemp && argsColor)
|
|
864
|
+
toZigbee.push(toZigbee_1.default.light_color_colortemp);
|
|
865
|
+
else if (args.colorTemp)
|
|
866
|
+
toZigbee.push(toZigbee_1.default.light_colortemp);
|
|
867
|
+
else if (argsColor)
|
|
868
|
+
toZigbee.push(toZigbee_1.default.light_color);
|
|
869
|
+
toZigbee.push(toZigbee_1.default.light_color_mode, toZigbee_1.default.light_color_options);
|
|
870
|
+
}
|
|
871
|
+
if (args.colorTemp) {
|
|
872
|
+
lightExpose.forEach((e) => e.withColorTemp(args.colorTemp.range));
|
|
873
|
+
toZigbee.push(toZigbee_1.default.light_colortemp_move, toZigbee_1.default.light_colortemp_step);
|
|
874
|
+
if (args.colorTemp.startup) {
|
|
875
|
+
toZigbee.push(toZigbee_1.default.light_colortemp_startup);
|
|
876
|
+
lightExpose.forEach((e) => e.withColorTempStartup(args.colorTemp.range));
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
if (argsColor) {
|
|
880
|
+
lightExpose.forEach((e) => e.withColor(argsColor.modes));
|
|
881
|
+
toZigbee.push(toZigbee_1.default.light_hue_saturation_move, toZigbee_1.default.light_hue_saturation_step);
|
|
882
|
+
if (argsColor.modes.includes('hs')) {
|
|
883
|
+
meta.supportsHueAndSaturation = true;
|
|
884
|
+
}
|
|
885
|
+
if (argsColor.applyRedFix) {
|
|
886
|
+
meta.applyRedFix = true;
|
|
887
|
+
}
|
|
888
|
+
if (!argsColor.enhancedHue) {
|
|
889
|
+
meta.supportsEnhancedHue = false;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (args.levelConfig) {
|
|
893
|
+
lightExpose.forEach((e) => e.withLevelConfig(args.levelConfig.disabledFeatures ?? []));
|
|
894
|
+
toZigbee.push(toZigbee_1.default.level_config);
|
|
895
|
+
}
|
|
896
|
+
const exposes = lightExpose;
|
|
897
|
+
if (args.effect) {
|
|
898
|
+
const effects = exposes_1.presets.effect();
|
|
899
|
+
if (args.color) {
|
|
900
|
+
effects.values.push('colorloop', 'stop_colorloop');
|
|
901
|
+
}
|
|
902
|
+
exposes.push(...(0, utils_1.exposeEndpoints)(effects, args.endpointNames));
|
|
903
|
+
toZigbee.push(toZigbee_1.default.effect);
|
|
904
|
+
}
|
|
905
|
+
if (args.powerOnBehavior) {
|
|
906
|
+
exposes.push(...(0, utils_1.exposeEndpoints)(exposes_1.presets.power_on_behavior(['off', 'on', 'toggle', 'previous']), args.endpointNames));
|
|
907
|
+
fromZigbee.push(fromZigbee_1.default.power_on_behavior);
|
|
908
|
+
toZigbee.push(toZigbee_1.default.power_on_behavior);
|
|
909
|
+
}
|
|
910
|
+
if (args.turnsOffAtBrightness1 !== undefined) {
|
|
911
|
+
meta.turnsOffAtBrightness1 = args.turnsOffAtBrightness1;
|
|
912
|
+
}
|
|
913
|
+
const configure = [
|
|
914
|
+
async (device, coordinatorEndpoint, definition) => {
|
|
915
|
+
await (0, light_1.configure)(device, coordinatorEndpoint, true);
|
|
916
|
+
if (args.configureReporting) {
|
|
917
|
+
await setupAttributes(device, coordinatorEndpoint, 'genOnOff', [{ attribute: 'onOff', min: 'MIN', max: 'MAX', change: 1 }]);
|
|
918
|
+
await setupAttributes(device, coordinatorEndpoint, 'genLevelCtrl', [
|
|
919
|
+
{ attribute: 'currentLevel', min: '10_SECONDS', max: 'MAX', change: 1 },
|
|
920
|
+
]);
|
|
921
|
+
if (args.colorTemp) {
|
|
922
|
+
await setupAttributes(device, coordinatorEndpoint, 'lightingColorCtrl', [
|
|
923
|
+
{ attribute: 'colorTemperature', min: '10_SECONDS', max: 'MAX', change: 1 },
|
|
924
|
+
]);
|
|
925
|
+
}
|
|
926
|
+
if (argsColor) {
|
|
927
|
+
const attributes = [];
|
|
928
|
+
if (argsColor.modes.includes('xy')) {
|
|
929
|
+
attributes.push({ attribute: 'currentX', min: '10_SECONDS', max: 'MAX', change: 1 }, { attribute: 'currentY', min: '10_SECONDS', max: 'MAX', change: 1 });
|
|
930
|
+
}
|
|
931
|
+
if (argsColor.modes.includes('hs')) {
|
|
932
|
+
attributes.push({ attribute: argsColor.enhancedHue ? 'enhancedCurrentHue' : 'currentHue', min: '10_SECONDS', max: 'MAX', change: 1 }, { attribute: 'currentSaturation', min: '10_SECONDS', max: 'MAX', change: 1 });
|
|
933
|
+
}
|
|
934
|
+
await setupAttributes(device, coordinatorEndpoint, 'lightingColorCtrl', attributes);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
(0, utils_1.configureSetPowerSourceWhenUnknown)('Mains (single phase)'),
|
|
939
|
+
];
|
|
940
|
+
const result = { exposes, fromZigbee, toZigbee, configure, meta, isModernExtend: true };
|
|
941
|
+
if (args.ota)
|
|
942
|
+
result.ota = args.ota;
|
|
943
|
+
return result;
|
|
944
|
+
}
|
|
945
|
+
function commandsLevelCtrl(args) {
|
|
946
|
+
args = {
|
|
947
|
+
commands: [
|
|
948
|
+
'brightness_move_to_level',
|
|
949
|
+
'brightness_move_up',
|
|
950
|
+
'brightness_move_down',
|
|
951
|
+
'brightness_step_up',
|
|
952
|
+
'brightness_step_down',
|
|
953
|
+
'brightness_stop',
|
|
954
|
+
],
|
|
955
|
+
bind: true,
|
|
956
|
+
...args,
|
|
957
|
+
};
|
|
958
|
+
let actions = args.commands;
|
|
959
|
+
if (args.endpointNames) {
|
|
960
|
+
actions = args.commands.map((c) => args.endpointNames.map((e) => `${c}_${e}`)).flat();
|
|
961
|
+
}
|
|
962
|
+
const exposes = [
|
|
963
|
+
exposes_1.presets.enum('action', exposes_1.access.STATE, actions).withDescription('Triggered action (e.g. a button click)').withCategory('diagnostic'),
|
|
964
|
+
];
|
|
965
|
+
const fromZigbee = [fromZigbee_1.default.command_move_to_level, fromZigbee_1.default.command_move, fromZigbee_1.default.command_step, fromZigbee_1.default.command_stop];
|
|
966
|
+
const result = { exposes, fromZigbee, isModernExtend: true };
|
|
967
|
+
if (args.bind)
|
|
968
|
+
result.configure = [setupConfigureForBinding('genLevelCtrl', 'output', args.endpointNames)];
|
|
969
|
+
return result;
|
|
970
|
+
}
|
|
971
|
+
function commandsColorCtrl(args) {
|
|
972
|
+
args = {
|
|
973
|
+
commands: [
|
|
974
|
+
'color_temperature_move_stop',
|
|
975
|
+
'color_temperature_move_up',
|
|
976
|
+
'color_temperature_move_down',
|
|
977
|
+
'color_temperature_step_up',
|
|
978
|
+
'color_temperature_step_down',
|
|
979
|
+
'enhanced_move_to_hue_and_saturation',
|
|
980
|
+
'move_to_hue_and_saturation',
|
|
981
|
+
'color_hue_step_up',
|
|
982
|
+
'color_hue_step_down',
|
|
983
|
+
'color_saturation_step_up',
|
|
984
|
+
'color_saturation_step_down',
|
|
985
|
+
'color_loop_set',
|
|
986
|
+
'color_temperature_move',
|
|
987
|
+
'color_move',
|
|
988
|
+
'hue_move',
|
|
989
|
+
'hue_stop',
|
|
990
|
+
'move_to_saturation',
|
|
991
|
+
'move_to_hue',
|
|
992
|
+
],
|
|
993
|
+
bind: true,
|
|
994
|
+
...args,
|
|
995
|
+
};
|
|
996
|
+
let actions = args.commands;
|
|
997
|
+
if (args.endpointNames) {
|
|
998
|
+
actions = args.commands.map((c) => args.endpointNames.map((e) => `${c}_${e}`)).flat();
|
|
999
|
+
}
|
|
1000
|
+
const exposes = [
|
|
1001
|
+
exposes_1.presets.enum('action', exposes_1.access.STATE, actions).withDescription('Triggered action (e.g. a button click)').withCategory('diagnostic'),
|
|
1002
|
+
];
|
|
1003
|
+
const fromZigbee = [
|
|
1004
|
+
fromZigbee_1.default.command_move_color_temperature,
|
|
1005
|
+
fromZigbee_1.default.command_step_color_temperature,
|
|
1006
|
+
fromZigbee_1.default.command_ehanced_move_to_hue_and_saturation,
|
|
1007
|
+
fromZigbee_1.default.command_move_to_hue_and_saturation,
|
|
1008
|
+
fromZigbee_1.default.command_step_hue,
|
|
1009
|
+
fromZigbee_1.default.command_step_saturation,
|
|
1010
|
+
fromZigbee_1.default.command_color_loop_set,
|
|
1011
|
+
fromZigbee_1.default.command_move_to_color_temp,
|
|
1012
|
+
fromZigbee_1.default.command_move_to_color,
|
|
1013
|
+
fromZigbee_1.default.command_move_hue,
|
|
1014
|
+
fromZigbee_1.default.command_move_to_saturation,
|
|
1015
|
+
fromZigbee_1.default.command_move_to_hue,
|
|
1016
|
+
];
|
|
1017
|
+
const result = { exposes, fromZigbee, isModernExtend: true };
|
|
1018
|
+
if (args.bind)
|
|
1019
|
+
result.configure = [setupConfigureForBinding('lightingColorCtrl', 'output', args.endpointNames)];
|
|
1020
|
+
return result;
|
|
1021
|
+
}
|
|
1022
|
+
function lightingBallast() {
|
|
1023
|
+
const result = {
|
|
1024
|
+
fromZigbee: [fromZigbee_1.default.lighting_ballast_configuration],
|
|
1025
|
+
toZigbee: [toZigbee_1.default.ballast_config],
|
|
1026
|
+
exposes: [
|
|
1027
|
+
new exposes_1.Numeric('ballast_minimum_level', exposes_1.access.ALL)
|
|
1028
|
+
.withValueMin(1)
|
|
1029
|
+
.withValueMax(254)
|
|
1030
|
+
.withDescription('Specifies the minimum light output of the ballast'),
|
|
1031
|
+
new exposes_1.Numeric('ballast_maximum_level', exposes_1.access.ALL)
|
|
1032
|
+
.withValueMin(1)
|
|
1033
|
+
.withValueMax(254)
|
|
1034
|
+
.withDescription('Specifies the maximum light output of the ballast'),
|
|
1035
|
+
],
|
|
1036
|
+
configure: [setupConfigureForReading('lightingBallastCfg', ['minLevel', 'maxLevel'])],
|
|
1037
|
+
isModernExtend: true,
|
|
1038
|
+
};
|
|
1039
|
+
return result;
|
|
1040
|
+
}
|
|
1041
|
+
function lock(args) {
|
|
1042
|
+
args = { ...args };
|
|
1043
|
+
const fromZigbee = [fromZigbee_1.default.lock, fromZigbee_1.default.lock_operation_event, fromZigbee_1.default.lock_programming_event, fromZigbee_1.default.lock_pin_code_response, fromZigbee_1.default.lock_user_status_response];
|
|
1044
|
+
const toZigbee = [
|
|
1045
|
+
{ ...toZigbee_1.default.lock, endpoints: args?.endpointNames },
|
|
1046
|
+
toZigbee_1.default.pincode_lock,
|
|
1047
|
+
toZigbee_1.default.lock_userstatus,
|
|
1048
|
+
toZigbee_1.default.lock_auto_relock_time,
|
|
1049
|
+
toZigbee_1.default.lock_sound_volume,
|
|
1050
|
+
];
|
|
1051
|
+
const exposes = [
|
|
1052
|
+
exposes_1.presets.lock(),
|
|
1053
|
+
exposes_1.presets.pincode(),
|
|
1054
|
+
exposes_1.presets.lock_action(),
|
|
1055
|
+
exposes_1.presets.lock_action_source_name(),
|
|
1056
|
+
exposes_1.presets.lock_action_user(),
|
|
1057
|
+
exposes_1.presets.auto_relock_time().withValueMin(0).withValueMax(3600),
|
|
1058
|
+
exposes_1.presets.sound_volume(),
|
|
1059
|
+
];
|
|
1060
|
+
const configure = [
|
|
1061
|
+
setupConfigureForReporting('closuresDoorLock', 'lockState', { min: 'MIN', max: '1_HOUR', change: 0 }, exposes_1.access.STATE_GET),
|
|
1062
|
+
];
|
|
1063
|
+
const meta = { pinCodeCount: args.pinCodeCount };
|
|
1064
|
+
return { fromZigbee, toZigbee, exposes, configure, meta, isModernExtend: true };
|
|
1065
|
+
}
|
|
1066
|
+
function windowCovering(args) {
|
|
1067
|
+
args = { stateSource: 'lift', configureReporting: true, ...args };
|
|
1068
|
+
let coverExpose = exposes_1.presets.cover();
|
|
1069
|
+
if (args.controls.includes('lift'))
|
|
1070
|
+
coverExpose = coverExpose.withPosition();
|
|
1071
|
+
if (args.controls.includes('tilt'))
|
|
1072
|
+
coverExpose = coverExpose.withTilt();
|
|
1073
|
+
const exposes = [coverExpose];
|
|
1074
|
+
const fromZigbee = [fromZigbee_1.default.cover_position_tilt];
|
|
1075
|
+
const toZigbee = [{ ...toZigbee_1.default.cover_state, endpoints: args?.endpointNames }, toZigbee_1.default.cover_position_tilt];
|
|
1076
|
+
const result = { exposes, fromZigbee, toZigbee, isModernExtend: true };
|
|
1077
|
+
if (args.configureReporting) {
|
|
1078
|
+
const configure = [];
|
|
1079
|
+
if (args.controls.includes('lift')) {
|
|
1080
|
+
configure.push(setupConfigureForReporting('closuresWindowCovering', 'currentPositionLiftPercentage', { min: '1_SECOND', max: 'MAX', change: 1 }, exposes_1.access.STATE_GET));
|
|
1081
|
+
}
|
|
1082
|
+
if (args.controls.includes('tilt')) {
|
|
1083
|
+
configure.push(setupConfigureForReporting('closuresWindowCovering', 'currentPositionTiltPercentage', { min: '1_SECOND', max: 'MAX', change: 1 }, exposes_1.access.STATE_GET));
|
|
1084
|
+
}
|
|
1085
|
+
result.configure = configure;
|
|
1086
|
+
}
|
|
1087
|
+
if (args.coverInverted || args.stateSource === 'tilt') {
|
|
1088
|
+
const meta = {};
|
|
1089
|
+
if (args.coverInverted)
|
|
1090
|
+
meta.coverInverted = true;
|
|
1091
|
+
if (args.stateSource === 'tilt')
|
|
1092
|
+
meta.coverStateFromTilt = true;
|
|
1093
|
+
result.meta = meta;
|
|
1094
|
+
}
|
|
1095
|
+
if (args.coverMode) {
|
|
1096
|
+
result.toZigbee.push(toZigbee_1.default.cover_mode);
|
|
1097
|
+
result.exposes.push(exposes_1.presets.cover_mode());
|
|
1098
|
+
}
|
|
1099
|
+
if (args.endpointNames) {
|
|
1100
|
+
result.exposes = (0, utils_1.flatten)(exposes.map((expose) => args.endpointNames.map((endpoint) => expose.clone().withEndpoint(endpoint))));
|
|
1101
|
+
}
|
|
1102
|
+
return result;
|
|
1103
|
+
}
|
|
1104
|
+
function commandsWindowCovering(args) {
|
|
1105
|
+
args = { commands: ['open', 'close', 'stop'], bind: true, ...args };
|
|
1106
|
+
let actions = args.commands;
|
|
1107
|
+
if (args.endpointNames) {
|
|
1108
|
+
actions = args.commands.map((c) => args.endpointNames.map((e) => `${c}_${e}`)).flat();
|
|
1109
|
+
}
|
|
1110
|
+
const exposes = [
|
|
1111
|
+
exposes_1.presets.enum('action', exposes_1.access.STATE, actions).withDescription('Triggered action (e.g. a button click)').withCategory('diagnostic'),
|
|
1112
|
+
];
|
|
1113
|
+
const actionPayloadLookup = {
|
|
1114
|
+
commandUpOpen: 'open',
|
|
1115
|
+
commandDownClose: 'close',
|
|
1116
|
+
commandStop: 'stop',
|
|
1117
|
+
};
|
|
1118
|
+
const fromZigbee = [
|
|
1119
|
+
{
|
|
1120
|
+
cluster: 'closuresWindowCovering',
|
|
1121
|
+
type: ['commandUpOpen', 'commandDownClose', 'commandStop'],
|
|
1122
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1123
|
+
if ((0, utils_1.hasAlreadyProcessedMessage)(msg, model))
|
|
1124
|
+
return;
|
|
1125
|
+
const payload = { action: (0, utils_1.postfixWithEndpointName)(actionPayloadLookup[msg.type], msg, model, meta) };
|
|
1126
|
+
(0, utils_1.addActionGroup)(payload, msg, model);
|
|
1127
|
+
return payload;
|
|
1128
|
+
},
|
|
1129
|
+
},
|
|
1130
|
+
];
|
|
1131
|
+
const result = { exposes, fromZigbee, isModernExtend: true };
|
|
1132
|
+
if (args.bind)
|
|
1133
|
+
result.configure = [setupConfigureForBinding('closuresWindowCovering', 'output', args.endpointNames)];
|
|
1134
|
+
return result;
|
|
1135
|
+
}
|
|
1136
|
+
function iasZoneAlarm(args) {
|
|
1137
|
+
const exposes = [];
|
|
1138
|
+
const invertAlarmPayload = args.zoneType === 'contact';
|
|
1139
|
+
const bothAlarms = args.zoneAttributes.includes('alarm_1') && args.zoneAttributes.includes('alarm_2');
|
|
1140
|
+
let alarm1Name = 'alarm_1';
|
|
1141
|
+
let alarm2Name = 'alarm_2';
|
|
1142
|
+
if (args.zoneType === 'generic') {
|
|
1143
|
+
args.zoneAttributes.map((attr) => {
|
|
1144
|
+
let expose = IAS_EXPOSE_LOOKUP[attr];
|
|
1145
|
+
if (args.description) {
|
|
1146
|
+
expose = expose.clone().withDescription(args.description);
|
|
1147
|
+
}
|
|
1148
|
+
exposes.push(expose);
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
else {
|
|
1152
|
+
if (bothAlarms) {
|
|
1153
|
+
exposes.push(exposes_1.presets
|
|
1154
|
+
.binary(args.zoneType + '_alarm_1', exposes_1.access.STATE, true, false)
|
|
1155
|
+
.withDescription(IAS_EXPOSE_LOOKUP[args.zoneType].description + ' (alarm_1)'));
|
|
1156
|
+
alarm1Name = args.zoneType + '_alarm_1';
|
|
1157
|
+
exposes.push(exposes_1.presets
|
|
1158
|
+
.binary(args.zoneType + '_alarm_2', exposes_1.access.STATE, true, false)
|
|
1159
|
+
.withDescription(IAS_EXPOSE_LOOKUP[args.zoneType].description + ' (alarm_2)'));
|
|
1160
|
+
alarm2Name = args.zoneType + '_alarm_2';
|
|
1161
|
+
}
|
|
1162
|
+
else {
|
|
1163
|
+
exposes.push(IAS_EXPOSE_LOOKUP[args.zoneType]);
|
|
1164
|
+
alarm1Name = args.zoneType;
|
|
1165
|
+
alarm2Name = args.zoneType;
|
|
1166
|
+
}
|
|
1167
|
+
args.zoneAttributes.map((attr) => {
|
|
1168
|
+
if (attr !== 'alarm_1' && attr !== 'alarm_2')
|
|
1169
|
+
exposes.push(IAS_EXPOSE_LOOKUP[attr]);
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
if (args.manufacturerZoneAttributes)
|
|
1173
|
+
args.manufacturerZoneAttributes.map((attr) => {
|
|
1174
|
+
let expose = exposes_1.presets.binary(attr.name, exposes_1.access.STATE, attr.valueOn, attr.valueOff).withDescription(attr.description);
|
|
1175
|
+
if (attr.entityCategory)
|
|
1176
|
+
expose = expose.withCategory(attr.entityCategory);
|
|
1177
|
+
exposes.push(expose);
|
|
1178
|
+
});
|
|
1179
|
+
const timeoutProperty = `${args.zoneType}_timeout`;
|
|
1180
|
+
const fromZigbee = [
|
|
1181
|
+
{
|
|
1182
|
+
cluster: 'ssIasZone',
|
|
1183
|
+
type: ['commandStatusChangeNotification', 'attributeReport', 'readResponse'],
|
|
1184
|
+
options: args.alarmTimeout
|
|
1185
|
+
? [
|
|
1186
|
+
exposes_1.presets
|
|
1187
|
+
.numeric(timeoutProperty, exposes_1.access.SET)
|
|
1188
|
+
.withValueMin(0)
|
|
1189
|
+
.withDescription(`Time in seconds after which ${args.zoneType} is cleared after detecting it (default 90 seconds).`),
|
|
1190
|
+
]
|
|
1191
|
+
: [],
|
|
1192
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1193
|
+
if (args.alarmTimeout) {
|
|
1194
|
+
const timeout = options?.[timeoutProperty] !== undefined ? Number(options[timeoutProperty]) : 90;
|
|
1195
|
+
clearTimeout(globalStore.getValue(msg.endpoint, 'timer'));
|
|
1196
|
+
if (timeout !== 0) {
|
|
1197
|
+
const timer = setTimeout(() => publish({ [alarm1Name]: false, [alarm2Name]: false }), timeout * 1000);
|
|
1198
|
+
globalStore.putValue(msg.endpoint, 'timer', timer);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
const isChange = msg.type === 'commandStatusChangeNotification';
|
|
1202
|
+
const zoneStatus = isChange ? msg.data.zonestatus : msg.data.zoneStatus;
|
|
1203
|
+
if (zoneStatus !== undefined) {
|
|
1204
|
+
let payload = {};
|
|
1205
|
+
if (args.zoneAttributes.includes('tamper')) {
|
|
1206
|
+
payload = { tamper: (zoneStatus & (1 << 2)) > 0, ...payload };
|
|
1207
|
+
}
|
|
1208
|
+
if (args.zoneAttributes.includes('battery_low')) {
|
|
1209
|
+
payload = { battery_low: (zoneStatus & (1 << 3)) > 0, ...payload };
|
|
1210
|
+
}
|
|
1211
|
+
if (args.zoneAttributes.includes('supervision_reports')) {
|
|
1212
|
+
payload = { supervision_reports: (zoneStatus & (1 << 4)) > 0, ...payload };
|
|
1213
|
+
}
|
|
1214
|
+
if (args.zoneAttributes.includes('restore_reports')) {
|
|
1215
|
+
payload = { restore_reports: (zoneStatus & (1 << 5)) > 0, ...payload };
|
|
1216
|
+
}
|
|
1217
|
+
if (args.zoneAttributes.includes('trouble')) {
|
|
1218
|
+
payload = { trouble: (zoneStatus & (1 << 6)) > 0, ...payload };
|
|
1219
|
+
}
|
|
1220
|
+
if (args.zoneAttributes.includes('ac_status')) {
|
|
1221
|
+
payload = { ac_status: (zoneStatus & (1 << 7)) > 0, ...payload };
|
|
1222
|
+
}
|
|
1223
|
+
if (args.zoneAttributes.includes('test')) {
|
|
1224
|
+
payload = { test: (zoneStatus & (1 << 8)) > 0, ...payload };
|
|
1225
|
+
}
|
|
1226
|
+
if (args.zoneAttributes.includes('battery_defect')) {
|
|
1227
|
+
payload = { battery_defect: (zoneStatus & (1 << 9)) > 0, ...payload };
|
|
1228
|
+
}
|
|
1229
|
+
let alarm1Payload = (zoneStatus & 1) > 0;
|
|
1230
|
+
let alarm2Payload = (zoneStatus & (1 << 1)) > 0;
|
|
1231
|
+
if (invertAlarmPayload) {
|
|
1232
|
+
alarm1Payload = !alarm1Payload;
|
|
1233
|
+
alarm2Payload = !alarm2Payload;
|
|
1234
|
+
}
|
|
1235
|
+
// Can't just alarm1Payload || alarm2Payload as an unused alarm's bit might be always 1 or random in the received data
|
|
1236
|
+
let addTimeout = false;
|
|
1237
|
+
if (args.zoneAttributes.includes('alarm_1')) {
|
|
1238
|
+
payload = { [alarm1Name]: alarm1Payload, ...payload };
|
|
1239
|
+
addTimeout ||= alarm1Payload;
|
|
1240
|
+
}
|
|
1241
|
+
if (args.zoneAttributes.includes('alarm_2')) {
|
|
1242
|
+
payload = { [alarm2Name]: alarm2Payload, ...payload };
|
|
1243
|
+
addTimeout ||= alarm2Payload;
|
|
1244
|
+
}
|
|
1245
|
+
if (isChange && args.keepAliveTimeout > 0) {
|
|
1246
|
+
// This sensor continuously sends occupation updates as long as motion is detected; (re)start a timeout
|
|
1247
|
+
// each time we receive one, in case the clearance message gets lost. Normally, these kinds of sensors
|
|
1248
|
+
// send a clearance message, so this is an additional safety measure.
|
|
1249
|
+
clearTimeout(globalStore.getValue(msg.endpoint, 'timeout'));
|
|
1250
|
+
if (addTimeout) {
|
|
1251
|
+
// At least one zone active
|
|
1252
|
+
const timer = setTimeout(() => publish({ [alarm1Name]: false, [alarm2Name]: false }), args.keepAliveTimeout * 1000);
|
|
1253
|
+
globalStore.putValue(msg.endpoint, 'timeout', timer);
|
|
1254
|
+
}
|
|
1255
|
+
else {
|
|
1256
|
+
globalStore.clearValue(msg.endpoint, 'timeout');
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
if (args.manufacturerZoneAttributes)
|
|
1260
|
+
args.manufacturerZoneAttributes.map((attr) => {
|
|
1261
|
+
payload = { [attr.name]: (zoneStatus & (1 << attr.bit)) > 0, ...payload };
|
|
1262
|
+
});
|
|
1263
|
+
return payload;
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
},
|
|
1267
|
+
];
|
|
1268
|
+
let configure;
|
|
1269
|
+
if (args.zoneStatusReporting) {
|
|
1270
|
+
configure = [
|
|
1271
|
+
async (device, coordinatorEndpoint) => {
|
|
1272
|
+
await setupAttributes(device, coordinatorEndpoint, 'ssIasZone', [{ attribute: 'zoneStatus', min: 'MIN', max: 'MAX', change: 0 }]);
|
|
1273
|
+
},
|
|
1274
|
+
];
|
|
1275
|
+
}
|
|
1276
|
+
return { fromZigbee, exposes, isModernExtend: true, ...(configure && { configure }) };
|
|
1277
|
+
}
|
|
1278
|
+
function iasWarning(args) {
|
|
1279
|
+
const warningMode = { stop: 0, burglar: 1, fire: 2, emergency: 3, police_panic: 4, fire_panic: 5, emergency_panic: 6 };
|
|
1280
|
+
// levels for siren, strobe and squawk are identical
|
|
1281
|
+
const level = { low: 0, medium: 1, high: 2, very_high: 3 };
|
|
1282
|
+
const exposes = [
|
|
1283
|
+
exposes_1.presets
|
|
1284
|
+
.composite('warning', 'warning', exposes_1.access.SET)
|
|
1285
|
+
.withFeature(exposes_1.presets.enum('mode', exposes_1.access.SET, Object.keys(warningMode)).withDescription('Mode of the warning (sound effect)'))
|
|
1286
|
+
.withFeature(exposes_1.presets.enum('level', exposes_1.access.SET, Object.keys(level)).withDescription('Sound level'))
|
|
1287
|
+
.withFeature(exposes_1.presets.enum('strobe_level', exposes_1.access.SET, Object.keys(level)).withDescription('Intensity of the strobe'))
|
|
1288
|
+
.withFeature(exposes_1.presets.binary('strobe', exposes_1.access.SET, true, false).withDescription('Turn on/off the strobe (light) during warning'))
|
|
1289
|
+
.withFeature(exposes_1.presets.numeric('strobe_duty_cycle', exposes_1.access.SET).withValueMax(10).withValueMin(0).withDescription('Length of the flash cycle'))
|
|
1290
|
+
.withFeature(exposes_1.presets.numeric('duration', exposes_1.access.SET).withUnit('s').withDescription('Duration in seconds of the alarm')),
|
|
1291
|
+
];
|
|
1292
|
+
const toZigbee = [
|
|
1293
|
+
{
|
|
1294
|
+
key: ['warning'],
|
|
1295
|
+
convertSet: async (entity, key, value, meta) => {
|
|
1296
|
+
const values = {
|
|
1297
|
+
// @ts-expect-error ignore
|
|
1298
|
+
mode: value.mode || 'emergency',
|
|
1299
|
+
// @ts-expect-error ignore
|
|
1300
|
+
level: value.level || 'medium',
|
|
1301
|
+
// @ts-expect-error ignore
|
|
1302
|
+
strobe: value.strobe !== undefined ? value.strobe : true,
|
|
1303
|
+
// @ts-expect-error ignore
|
|
1304
|
+
duration: value.duration !== undefined ? value.duration : 10,
|
|
1305
|
+
// @ts-expect-error ignore
|
|
1306
|
+
strobeDutyCycle: value.strobe_duty_cycle !== undefined ? value.strobe_duty_cycle * 10 : 0,
|
|
1307
|
+
// @ts-expect-error ignore
|
|
1308
|
+
strobeLevel: value.strobe_level !== undefined ? utils.getFromLookup(value.strobe_level, strobeLevel) : 1,
|
|
1309
|
+
};
|
|
1310
|
+
let info;
|
|
1311
|
+
if (args?.reversePayload) {
|
|
1312
|
+
info = (0, utils_1.getFromLookup)(values.mode, warningMode) + ((values.strobe ? 1 : 0) << 4) + ((0, utils_1.getFromLookup)(values.level, level) << 6);
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
info = ((0, utils_1.getFromLookup)(values.mode, warningMode) << 4) + ((values.strobe ? 1 : 0) << 2) + (0, utils_1.getFromLookup)(values.level, level);
|
|
1316
|
+
}
|
|
1317
|
+
const payload = {
|
|
1318
|
+
startwarninginfo: info,
|
|
1319
|
+
warningduration: values.duration,
|
|
1320
|
+
strobedutycycle: values.strobeDutyCycle,
|
|
1321
|
+
strobelevel: values.strobeLevel,
|
|
1322
|
+
};
|
|
1323
|
+
await entity.command('ssIasWd', 'startWarning', payload, (0, utils_1.getOptions)(meta.mapped, entity));
|
|
1324
|
+
},
|
|
1325
|
+
},
|
|
1326
|
+
];
|
|
1327
|
+
return { toZigbee, exposes, isModernExtend: true };
|
|
1328
|
+
}
|
|
1329
|
+
function electricityMeter(args) {
|
|
1330
|
+
args = {
|
|
1331
|
+
cluster: 'both',
|
|
1332
|
+
electricalMeasurementType: 'ac',
|
|
1333
|
+
configureReporting: true,
|
|
1334
|
+
threePhase: false,
|
|
1335
|
+
producedEnergy: false,
|
|
1336
|
+
acFrequency: false,
|
|
1337
|
+
powerFactor: false,
|
|
1338
|
+
...args,
|
|
1339
|
+
};
|
|
1340
|
+
if (args.cluster !== 'electrical') {
|
|
1341
|
+
const divisors = new Set([
|
|
1342
|
+
args.cluster === 'metering' && (0, utils_1.isObject)(args.power) ? args.power?.divisor : false,
|
|
1343
|
+
(0, utils_1.isObject)(args.energy) ? args.energy?.divisor : false,
|
|
1344
|
+
(0, utils_1.isObject)(args.producedEnergy) ? args.producedEnergy?.divisor : false,
|
|
1345
|
+
]);
|
|
1346
|
+
divisors.delete(false);
|
|
1347
|
+
const multipliers = new Set([
|
|
1348
|
+
args.cluster === 'metering' && (0, utils_1.isObject)(args.power) ? args.power?.multiplier : false,
|
|
1349
|
+
(0, utils_1.isObject)(args.energy) ? args.energy?.multiplier : false,
|
|
1350
|
+
(0, utils_1.isObject)(args.producedEnergy) ? args.producedEnergy?.multiplier : false,
|
|
1351
|
+
]);
|
|
1352
|
+
multipliers.delete(false);
|
|
1353
|
+
if (multipliers.size > 1 || divisors.size > 1) {
|
|
1354
|
+
throw new Error(`When cluster is metering, power and energy divisor/multiplier should be equal, got divisors=${Array.from(divisors).join(', ')}, multipliers=${Array.from(multipliers).join(', ')}`);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
if (args.cluster === 'electrical' && args.producedEnergy) {
|
|
1358
|
+
throw new Error(`Produced energy is not supported with cluster 'electrical', use 'both' or 'metering'`);
|
|
1359
|
+
}
|
|
1360
|
+
if (args.cluster === 'metering' && args.acFrequency) {
|
|
1361
|
+
throw new Error(`AC frequency is not supported with cluster 'metering', use 'both' or 'electrical'`);
|
|
1362
|
+
}
|
|
1363
|
+
if (args.cluster === 'metering' && args.powerFactor) {
|
|
1364
|
+
throw new Error(`Power factor is not supported with cluster 'metering', use 'both' or 'electrical'`);
|
|
1365
|
+
}
|
|
1366
|
+
if (args.cluster === 'metering' && args.electricalMeasurementType === 'dc') {
|
|
1367
|
+
throw new Error(`DC attributes are not supported with cluster 'metering', use 'both' or 'ac'`);
|
|
1368
|
+
}
|
|
1369
|
+
let exposes = [];
|
|
1370
|
+
let fromZigbee;
|
|
1371
|
+
let toZigbee;
|
|
1372
|
+
const configureLookup = {
|
|
1373
|
+
haElectricalMeasurement: {
|
|
1374
|
+
// Report change with every 5W change
|
|
1375
|
+
power: { attribute: 'activePower', divisor: 'acPowerDivisor', multiplier: 'acPowerMultiplier', forced: args.power, change: 5 },
|
|
1376
|
+
power_phase_b: { attribute: 'activePowerPhB', divisor: 'acPowerDivisor', multiplier: 'acPowerMultiplier', forced: args.power, change: 5 },
|
|
1377
|
+
power_phase_c: { attribute: 'activePowerPhC', divisor: 'acPowerDivisor', multiplier: 'acPowerMultiplier', forced: args.power, change: 5 },
|
|
1378
|
+
// Report change with every 0.05A change
|
|
1379
|
+
current: { attribute: 'rmsCurrent', divisor: 'acCurrentDivisor', multiplier: 'acCurrentMultiplier', forced: args.current, change: 0.05 },
|
|
1380
|
+
// Report change every 1 Hz
|
|
1381
|
+
ac_frequency: {
|
|
1382
|
+
attribute: 'acFrequency',
|
|
1383
|
+
divisor: 'acFrequencyDivisor',
|
|
1384
|
+
multiplier: 'acFrequencyMultiplier',
|
|
1385
|
+
forced: (0, utils_1.isObject)(args.acFrequency) ? args.acFrequency : false,
|
|
1386
|
+
change: 1,
|
|
1387
|
+
},
|
|
1388
|
+
current_phase_b: {
|
|
1389
|
+
attribute: 'rmsCurrentPhB',
|
|
1390
|
+
divisor: 'acCurrentDivisor',
|
|
1391
|
+
multiplier: 'acCurrentMultiplier',
|
|
1392
|
+
forced: args.current,
|
|
1393
|
+
change: 0.05,
|
|
1394
|
+
},
|
|
1395
|
+
current_phase_c: {
|
|
1396
|
+
attribute: 'rmsCurrentPhC',
|
|
1397
|
+
divisor: 'acCurrentDivisor',
|
|
1398
|
+
multiplier: 'acCurrentMultiplier',
|
|
1399
|
+
forced: args.current,
|
|
1400
|
+
change: 0.05,
|
|
1401
|
+
},
|
|
1402
|
+
power_factor: {
|
|
1403
|
+
attribute: 'powerFactor',
|
|
1404
|
+
change: 10,
|
|
1405
|
+
},
|
|
1406
|
+
// Report change with every 5V change
|
|
1407
|
+
voltage: { attribute: 'rmsVoltage', divisor: 'acVoltageDivisor', multiplier: 'acVoltageMultiplier', forced: args.voltage, change: 5 },
|
|
1408
|
+
voltage_phase_b: {
|
|
1409
|
+
attribute: 'rmsVoltagePhB',
|
|
1410
|
+
divisor: 'acVoltageDivisor',
|
|
1411
|
+
multiplier: 'acVoltageMultiplier',
|
|
1412
|
+
forced: args.voltage,
|
|
1413
|
+
change: 5,
|
|
1414
|
+
},
|
|
1415
|
+
voltage_phase_c: {
|
|
1416
|
+
attribute: 'rmsVoltagePhC',
|
|
1417
|
+
divisor: 'acVoltageDivisor',
|
|
1418
|
+
multiplier: 'acVoltageMultiplier',
|
|
1419
|
+
forced: args.voltage,
|
|
1420
|
+
change: 5,
|
|
1421
|
+
},
|
|
1422
|
+
// Report change with every 100mW change
|
|
1423
|
+
dc_power: { attribute: 'dcPower', divisor: 'dcPowerDivisor', multiplier: 'dcPowerMultiplier', forced: args.power, change: 100 },
|
|
1424
|
+
// Report change with every 100mV change
|
|
1425
|
+
dc_voltage: { attribute: 'dcVoltage', divisor: 'dcVoltageDivisor', multiplier: 'dcVoltageMultiplier', forced: args.voltage, change: 100 },
|
|
1426
|
+
// Report change with every 100mA change
|
|
1427
|
+
dc_current: { attribute: 'dcCurrent', divisor: 'dcCurrentDivisor', multiplier: 'dcCurrentMultiplier', forced: args.current, change: 100 },
|
|
1428
|
+
},
|
|
1429
|
+
seMetering: {
|
|
1430
|
+
// Report change with every 5W change
|
|
1431
|
+
power: { attribute: 'instantaneousDemand', divisor: 'divisor', multiplier: 'multiplier', forced: args.power, change: 0.005 },
|
|
1432
|
+
// Report change with every 0.1kWh change
|
|
1433
|
+
energy: { attribute: 'currentSummDelivered', divisor: 'divisor', multiplier: 'multiplier', forced: args.energy, change: 0.1 },
|
|
1434
|
+
produced_energy: {
|
|
1435
|
+
attribute: 'currentSummReceived',
|
|
1436
|
+
divisor: 'divisor',
|
|
1437
|
+
multiplier: 'multiplier',
|
|
1438
|
+
forced: (0, utils_1.isObject)(args.producedEnergy) ? args.producedEnergy : false,
|
|
1439
|
+
change: 0.1,
|
|
1440
|
+
},
|
|
1441
|
+
},
|
|
1442
|
+
};
|
|
1443
|
+
if (args.power === false) {
|
|
1444
|
+
delete configureLookup.haElectricalMeasurement.power;
|
|
1445
|
+
delete configureLookup.seMetering.power;
|
|
1446
|
+
delete configureLookup.haElectricalMeasurement.power_phase_b;
|
|
1447
|
+
delete configureLookup.haElectricalMeasurement.power_phase_c;
|
|
1448
|
+
delete configureLookup.haElectricalMeasurement.dc_power;
|
|
1449
|
+
}
|
|
1450
|
+
if (args.voltage === false) {
|
|
1451
|
+
delete configureLookup.haElectricalMeasurement.voltage;
|
|
1452
|
+
delete configureLookup.haElectricalMeasurement.voltage_phase_b;
|
|
1453
|
+
delete configureLookup.haElectricalMeasurement.voltage_phase_c;
|
|
1454
|
+
delete configureLookup.haElectricalMeasurement.dc_voltage;
|
|
1455
|
+
}
|
|
1456
|
+
if (args.current === false) {
|
|
1457
|
+
delete configureLookup.haElectricalMeasurement.current;
|
|
1458
|
+
delete configureLookup.haElectricalMeasurement.current_phase_b;
|
|
1459
|
+
delete configureLookup.haElectricalMeasurement.current_phase_c;
|
|
1460
|
+
delete configureLookup.haElectricalMeasurement.dc_current;
|
|
1461
|
+
}
|
|
1462
|
+
if (args.energy === false) {
|
|
1463
|
+
delete configureLookup.seMetering.energy;
|
|
1464
|
+
}
|
|
1465
|
+
if (args.producedEnergy === false) {
|
|
1466
|
+
delete configureLookup.seMetering.produced_energy;
|
|
1467
|
+
}
|
|
1468
|
+
if (args.powerFactor === false) {
|
|
1469
|
+
delete configureLookup.haElectricalMeasurement.power_factor;
|
|
1470
|
+
}
|
|
1471
|
+
if (args.acFrequency === false) {
|
|
1472
|
+
delete configureLookup.haElectricalMeasurement.ac_frequency;
|
|
1473
|
+
}
|
|
1474
|
+
if (args.threePhase === false) {
|
|
1475
|
+
delete configureLookup.haElectricalMeasurement.power_phase_b;
|
|
1476
|
+
delete configureLookup.haElectricalMeasurement.power_phase_c;
|
|
1477
|
+
delete configureLookup.haElectricalMeasurement.current_phase_b;
|
|
1478
|
+
delete configureLookup.haElectricalMeasurement.current_phase_c;
|
|
1479
|
+
delete configureLookup.haElectricalMeasurement.voltage_phase_b;
|
|
1480
|
+
delete configureLookup.haElectricalMeasurement.voltage_phase_c;
|
|
1481
|
+
}
|
|
1482
|
+
if (args.electricalMeasurementType === 'dc') {
|
|
1483
|
+
delete configureLookup.haElectricalMeasurement.power;
|
|
1484
|
+
delete configureLookup.haElectricalMeasurement.voltage;
|
|
1485
|
+
delete configureLookup.haElectricalMeasurement.current;
|
|
1486
|
+
delete configureLookup.haElectricalMeasurement.power_factor;
|
|
1487
|
+
delete configureLookup.haElectricalMeasurement.ac_frequency;
|
|
1488
|
+
delete configureLookup.haElectricalMeasurement.power_phase_b;
|
|
1489
|
+
delete configureLookup.haElectricalMeasurement.power_phase_c;
|
|
1490
|
+
delete configureLookup.haElectricalMeasurement.current_phase_b;
|
|
1491
|
+
delete configureLookup.haElectricalMeasurement.current_phase_c;
|
|
1492
|
+
delete configureLookup.haElectricalMeasurement.voltage_phase_b;
|
|
1493
|
+
delete configureLookup.haElectricalMeasurement.voltage_phase_c;
|
|
1494
|
+
}
|
|
1495
|
+
if (args.electricalMeasurementType === 'ac') {
|
|
1496
|
+
delete configureLookup.haElectricalMeasurement.dc_power;
|
|
1497
|
+
delete configureLookup.haElectricalMeasurement.dc_voltage;
|
|
1498
|
+
delete configureLookup.haElectricalMeasurement.dc_current;
|
|
1499
|
+
}
|
|
1500
|
+
if (args.cluster === 'both') {
|
|
1501
|
+
if (args.power !== false)
|
|
1502
|
+
exposes.push(exposes_1.presets.power().withAccess(exposes_1.access.STATE_GET));
|
|
1503
|
+
if (args.voltage !== false)
|
|
1504
|
+
exposes.push(exposes_1.presets.voltage().withAccess(exposes_1.access.STATE_GET));
|
|
1505
|
+
if (args.acFrequency !== false)
|
|
1506
|
+
exposes.push(exposes_1.presets.ac_frequency().withAccess(exposes_1.access.STATE_GET));
|
|
1507
|
+
if (args.powerFactor !== false)
|
|
1508
|
+
exposes.push(exposes_1.presets.power_factor().withAccess(exposes_1.access.STATE_GET));
|
|
1509
|
+
if (args.current !== false)
|
|
1510
|
+
exposes.push(exposes_1.presets.current().withAccess(exposes_1.access.STATE_GET));
|
|
1511
|
+
if (args.energy !== false)
|
|
1512
|
+
exposes.push(exposes_1.presets.energy().withAccess(exposes_1.access.STATE_GET));
|
|
1513
|
+
if (args.producedEnergy !== false)
|
|
1514
|
+
exposes.push(exposes_1.presets.produced_energy().withAccess(exposes_1.access.STATE_GET));
|
|
1515
|
+
fromZigbee = [args.fzElectricalMeasurement ?? fromZigbee_1.default.electrical_measurement, args.fzMetering ?? fromZigbee_1.default.metering];
|
|
1516
|
+
toZigbee = [
|
|
1517
|
+
toZigbee_1.default.electrical_measurement_power,
|
|
1518
|
+
toZigbee_1.default.acvoltage,
|
|
1519
|
+
toZigbee_1.default.accurrent,
|
|
1520
|
+
toZigbee_1.default.currentsummdelivered,
|
|
1521
|
+
toZigbee_1.default.currentsummreceived,
|
|
1522
|
+
toZigbee_1.default.frequency,
|
|
1523
|
+
toZigbee_1.default.powerfactor,
|
|
1524
|
+
];
|
|
1525
|
+
delete configureLookup.seMetering.power;
|
|
1526
|
+
}
|
|
1527
|
+
else if (args.cluster === 'metering') {
|
|
1528
|
+
if (args.power !== false)
|
|
1529
|
+
exposes.push(exposes_1.presets.power().withAccess(exposes_1.access.STATE_GET));
|
|
1530
|
+
if (args.energy !== false)
|
|
1531
|
+
exposes.push(exposes_1.presets.energy().withAccess(exposes_1.access.STATE_GET));
|
|
1532
|
+
if (args.producedEnergy !== false)
|
|
1533
|
+
exposes.push(exposes_1.presets.produced_energy().withAccess(exposes_1.access.STATE_GET));
|
|
1534
|
+
fromZigbee = [args.fzMetering ?? fromZigbee_1.default.metering];
|
|
1535
|
+
toZigbee = [toZigbee_1.default.metering_power, toZigbee_1.default.currentsummdelivered, toZigbee_1.default.currentsummreceived];
|
|
1536
|
+
delete configureLookup.haElectricalMeasurement;
|
|
1537
|
+
}
|
|
1538
|
+
else if (args.cluster === 'electrical') {
|
|
1539
|
+
if (args.power !== false)
|
|
1540
|
+
exposes.push(exposes_1.presets.power().withAccess(exposes_1.access.STATE_GET));
|
|
1541
|
+
if (args.voltage !== false)
|
|
1542
|
+
exposes.push(exposes_1.presets.voltage().withAccess(exposes_1.access.STATE_GET));
|
|
1543
|
+
if (args.current !== false)
|
|
1544
|
+
exposes.push(exposes_1.presets.current().withAccess(exposes_1.access.STATE_GET));
|
|
1545
|
+
if (args.acFrequency !== false)
|
|
1546
|
+
exposes.push(exposes_1.presets.ac_frequency().withAccess(exposes_1.access.STATE_GET));
|
|
1547
|
+
if (args.powerFactor !== false)
|
|
1548
|
+
exposes.push(exposes_1.presets.power_factor().withAccess(exposes_1.access.STATE_GET));
|
|
1549
|
+
fromZigbee = [args.fzElectricalMeasurement ?? fromZigbee_1.default.electrical_measurement];
|
|
1550
|
+
toZigbee = [toZigbee_1.default.electrical_measurement_power, toZigbee_1.default.acvoltage, toZigbee_1.default.accurrent, toZigbee_1.default.frequency, toZigbee_1.default.powerfactor];
|
|
1551
|
+
delete configureLookup.seMetering;
|
|
1552
|
+
}
|
|
1553
|
+
if (args.threePhase === true) {
|
|
1554
|
+
exposes.push(exposes_1.presets.power_phase_b().withAccess(exposes_1.access.STATE_GET), exposes_1.presets.power_phase_c().withAccess(exposes_1.access.STATE_GET), exposes_1.presets.voltage_phase_b().withAccess(exposes_1.access.STATE_GET), exposes_1.presets.voltage_phase_c().withAccess(exposes_1.access.STATE_GET), exposes_1.presets.current_phase_b().withAccess(exposes_1.access.STATE_GET), exposes_1.presets.current_phase_c().withAccess(exposes_1.access.STATE_GET));
|
|
1555
|
+
toZigbee.push(toZigbee_1.default.electrical_measurement_power_phase_b, toZigbee_1.default.electrical_measurement_power_phase_c, toZigbee_1.default.acvoltage_phase_b, toZigbee_1.default.acvoltage_phase_c, toZigbee_1.default.accurrent_phase_b, toZigbee_1.default.accurrent_phase_c);
|
|
1556
|
+
}
|
|
1557
|
+
if (args.endpointNames) {
|
|
1558
|
+
exposes = (0, utils_1.flatten)(exposes.map((expose) => args.endpointNames.map((endpoint) => expose.clone().withEndpoint(endpoint))));
|
|
1559
|
+
}
|
|
1560
|
+
const result = { exposes, fromZigbee, toZigbee, isModernExtend: true };
|
|
1561
|
+
if (args.configureReporting) {
|
|
1562
|
+
result.configure = [
|
|
1563
|
+
async (device, coordinatorEndpoint) => {
|
|
1564
|
+
for (const [cluster, properties] of Object.entries(configureLookup)) {
|
|
1565
|
+
for (const endpoint of getEndpointsWithCluster(device, cluster, 'input')) {
|
|
1566
|
+
const items = [];
|
|
1567
|
+
for (const property of Object.values(properties)) {
|
|
1568
|
+
let change = property.change;
|
|
1569
|
+
let min = '10_SECONDS';
|
|
1570
|
+
let max = 'MAX';
|
|
1571
|
+
// Check if this property has a divisor and multiplier, e.g. AC frequency doesn't.
|
|
1572
|
+
if ('divisor' in property) {
|
|
1573
|
+
// In case multiplier or divisor was provided, use that instead of reading from device.
|
|
1574
|
+
if (property.forced && (property.forced.divisor || property.forced.multiplier)) {
|
|
1575
|
+
endpoint.saveClusterAttributeKeyValue(cluster, {
|
|
1576
|
+
[property.divisor]: property.forced.divisor ?? 1,
|
|
1577
|
+
[property.multiplier]: property.forced.multiplier ?? 1,
|
|
1578
|
+
});
|
|
1579
|
+
endpoint.save();
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
await endpoint.read(cluster, [property.divisor, property.multiplier]);
|
|
1583
|
+
}
|
|
1584
|
+
const divisor = endpoint.getClusterAttributeValue(cluster, property.divisor);
|
|
1585
|
+
(0, utils_1.assertNumber)(divisor, property.divisor);
|
|
1586
|
+
const multiplier = endpoint.getClusterAttributeValue(cluster, property.multiplier);
|
|
1587
|
+
(0, utils_1.assertNumber)(multiplier, property.multiplier);
|
|
1588
|
+
change = property.change * (divisor / multiplier);
|
|
1589
|
+
}
|
|
1590
|
+
if ('forced' in property && property.forced) {
|
|
1591
|
+
if ('min' in property.forced) {
|
|
1592
|
+
min = property.forced.min;
|
|
1593
|
+
}
|
|
1594
|
+
if ('max' in property.forced) {
|
|
1595
|
+
max = property.forced.max;
|
|
1596
|
+
}
|
|
1597
|
+
if ('change' in property.forced) {
|
|
1598
|
+
change = property.forced.change;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
items.push({ attribute: property.attribute, min, max, change });
|
|
1602
|
+
}
|
|
1603
|
+
if (items.length) {
|
|
1604
|
+
await setupAttributes(endpoint, coordinatorEndpoint, cluster, items);
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
},
|
|
1609
|
+
];
|
|
1610
|
+
}
|
|
1611
|
+
return result;
|
|
1612
|
+
}
|
|
1613
|
+
function commandsScenes(args) {
|
|
1614
|
+
args = { commands: ['recall', 'store', 'add', 'remove', 'remove_all'], bind: true, ...args };
|
|
1615
|
+
let actions = args.commands;
|
|
1616
|
+
if (args.endpointNames) {
|
|
1617
|
+
actions = args.commands.map((c) => args.endpointNames.map((e) => `${c}_${e}`)).flat();
|
|
1618
|
+
}
|
|
1619
|
+
const exposesArray = [exposes_1.presets.enum('action', exposes_1.access.STATE, actions).withDescription('Triggered scene action (e.g. recall a scene)')];
|
|
1620
|
+
const actionPayloadLookup = {
|
|
1621
|
+
commandRecall: 'recall',
|
|
1622
|
+
commandStore: 'store',
|
|
1623
|
+
commandAdd: 'add',
|
|
1624
|
+
commandRemove: 'remove',
|
|
1625
|
+
commandRemoveAll: 'remove_all',
|
|
1626
|
+
};
|
|
1627
|
+
const fromZigbee = [
|
|
1628
|
+
{
|
|
1629
|
+
cluster: 'genScenes',
|
|
1630
|
+
type: ['commandRecall', 'commandStore', 'commandAdd', 'commandRemove', 'commandRemoveAll'],
|
|
1631
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1632
|
+
if ((0, utils_1.hasAlreadyProcessedMessage)(msg, model))
|
|
1633
|
+
return;
|
|
1634
|
+
let trailing = '';
|
|
1635
|
+
if (msg.type === 'commandRecall' || msg.type === 'commandStore') {
|
|
1636
|
+
trailing = `_${msg.data.sceneid}`;
|
|
1637
|
+
}
|
|
1638
|
+
const payload = {
|
|
1639
|
+
action: (0, utils_1.postfixWithEndpointName)(actionPayloadLookup[msg.type] + trailing, msg, model, meta),
|
|
1640
|
+
};
|
|
1641
|
+
(0, utils_1.addActionGroup)(payload, msg, model);
|
|
1642
|
+
return payload;
|
|
1643
|
+
},
|
|
1644
|
+
},
|
|
1645
|
+
];
|
|
1646
|
+
const result = { exposes: exposesArray, fromZigbee, isModernExtend: true };
|
|
1647
|
+
if (args.bind)
|
|
1648
|
+
result.configure = [setupConfigureForBinding('genScenes', 'output', args.endpointNames)];
|
|
1649
|
+
return result;
|
|
1650
|
+
}
|
|
1651
|
+
function enumLookup(args) {
|
|
1652
|
+
const { name, lookup, cluster, attribute, description, zigbeeCommandOptions, endpointName, reporting, entityCategory } = args;
|
|
1653
|
+
const attributeKey = (0, utils_1.isString)(attribute) ? attribute : attribute.ID;
|
|
1654
|
+
const access = exposes_1.access[args.access ?? 'ALL'];
|
|
1655
|
+
let expose = exposes_1.presets.enum(name, access, Object.keys(lookup)).withDescription(description);
|
|
1656
|
+
if (endpointName)
|
|
1657
|
+
expose = expose.withEndpoint(endpointName);
|
|
1658
|
+
if (entityCategory)
|
|
1659
|
+
expose = expose.withCategory(entityCategory);
|
|
1660
|
+
const fromZigbee = [
|
|
1661
|
+
{
|
|
1662
|
+
cluster: cluster.toString(),
|
|
1663
|
+
type: ['attributeReport', 'readResponse'],
|
|
1664
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1665
|
+
if (attributeKey in msg.data && (!endpointName || (0, utils_1.getEndpointName)(msg, model, meta) === endpointName)) {
|
|
1666
|
+
// skip undefined value
|
|
1667
|
+
if (msg.data[attributeKey] !== undefined)
|
|
1668
|
+
return { [expose.property]: (0, utils_1.getFromLookupByValue)(msg.data[attributeKey], lookup) };
|
|
1669
|
+
}
|
|
1670
|
+
},
|
|
1671
|
+
},
|
|
1672
|
+
];
|
|
1673
|
+
const toZigbee = [
|
|
1674
|
+
{
|
|
1675
|
+
key: [name],
|
|
1676
|
+
convertSet: access & exposes_1.access.SET
|
|
1677
|
+
? async (entity, key, value, meta) => {
|
|
1678
|
+
const payloadValue = (0, utils_1.getFromLookup)(value, lookup);
|
|
1679
|
+
const payload = (0, utils_1.isString)(attribute)
|
|
1680
|
+
? { [attribute]: payloadValue }
|
|
1681
|
+
: { [attribute.ID]: { value: payloadValue, type: attribute.type } };
|
|
1682
|
+
await determineEndpoint(entity, meta, cluster).write(cluster, payload, zigbeeCommandOptions);
|
|
1683
|
+
return { state: { [key]: value } };
|
|
1684
|
+
}
|
|
1685
|
+
: undefined,
|
|
1686
|
+
convertGet: access & exposes_1.access.GET
|
|
1687
|
+
? async (entity, key, meta) => {
|
|
1688
|
+
await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions);
|
|
1689
|
+
}
|
|
1690
|
+
: undefined,
|
|
1691
|
+
},
|
|
1692
|
+
];
|
|
1693
|
+
const configure = [setupConfigureForReporting(cluster, attribute, reporting, access)];
|
|
1694
|
+
return { exposes: [expose], fromZigbee, toZigbee, configure, isModernExtend: true };
|
|
1695
|
+
}
|
|
1696
|
+
function numeric(args) {
|
|
1697
|
+
const { name, cluster, attribute, description, zigbeeCommandOptions, unit, reporting, valueMin, valueMax, valueStep, valueIgnore, scale, label, entityCategory, precision, } = args;
|
|
1698
|
+
const endpoints = args.endpointNames;
|
|
1699
|
+
const attributeKey = (0, utils_1.isString)(attribute) ? attribute : attribute.ID;
|
|
1700
|
+
const access = exposes_1.access[args.access ?? 'ALL'];
|
|
1701
|
+
const exposes = [];
|
|
1702
|
+
const createExpose = (endpoint) => {
|
|
1703
|
+
let expose = exposes_1.presets.numeric(name, access).withDescription(description);
|
|
1704
|
+
if (endpoint)
|
|
1705
|
+
expose = expose.withEndpoint(endpoint);
|
|
1706
|
+
if (unit)
|
|
1707
|
+
expose = expose.withUnit(unit);
|
|
1708
|
+
if (valueMin !== undefined)
|
|
1709
|
+
expose = expose.withValueMin(valueMin);
|
|
1710
|
+
if (valueMax !== undefined)
|
|
1711
|
+
expose = expose.withValueMax(valueMax);
|
|
1712
|
+
if (valueStep !== undefined)
|
|
1713
|
+
expose = expose.withValueStep(valueStep);
|
|
1714
|
+
if (label !== undefined)
|
|
1715
|
+
expose = expose.withLabel(label);
|
|
1716
|
+
if (entityCategory)
|
|
1717
|
+
expose = expose.withCategory(entityCategory);
|
|
1718
|
+
return expose;
|
|
1719
|
+
};
|
|
1720
|
+
// Generate for multiple endpoints only if required.
|
|
1721
|
+
if (!endpoints) {
|
|
1722
|
+
exposes.push(createExpose(undefined));
|
|
1723
|
+
}
|
|
1724
|
+
else {
|
|
1725
|
+
for (const endpoint of endpoints) {
|
|
1726
|
+
exposes.push(createExpose(endpoint));
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
const fromZigbee = [
|
|
1730
|
+
{
|
|
1731
|
+
cluster: cluster.toString(),
|
|
1732
|
+
type: ['attributeReport', 'readResponse'],
|
|
1733
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1734
|
+
if (attributeKey in msg.data) {
|
|
1735
|
+
const endpoint = endpoints?.find((e) => (0, utils_1.getEndpointName)(msg, model, meta) === e);
|
|
1736
|
+
if (endpoints && !endpoint) {
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
let value = msg.data[attributeKey];
|
|
1740
|
+
(0, utils_1.assertNumber)(value);
|
|
1741
|
+
if (valueIgnore && valueIgnore.includes(value))
|
|
1742
|
+
return;
|
|
1743
|
+
if (scale !== undefined) {
|
|
1744
|
+
value = typeof scale === 'number' ? value / scale : scale(value, 'from');
|
|
1745
|
+
}
|
|
1746
|
+
(0, utils_1.assertNumber)(value);
|
|
1747
|
+
if (precision != null)
|
|
1748
|
+
value = (0, utils_1.precisionRound)(value, precision);
|
|
1749
|
+
const expose = exposes.length === 1 ? exposes[0] : exposes.find((e) => e.endpoint === endpoint);
|
|
1750
|
+
return { [expose.property]: value };
|
|
1751
|
+
}
|
|
1752
|
+
},
|
|
1753
|
+
},
|
|
1754
|
+
];
|
|
1755
|
+
const toZigbee = [
|
|
1756
|
+
{
|
|
1757
|
+
key: [name],
|
|
1758
|
+
convertSet: access & exposes_1.access.SET
|
|
1759
|
+
? async (entity, key, value, meta) => {
|
|
1760
|
+
(0, utils_1.assertNumber)(value, key);
|
|
1761
|
+
let payloadValue = value;
|
|
1762
|
+
if (scale !== undefined) {
|
|
1763
|
+
payloadValue = typeof scale === 'number' ? payloadValue * scale : scale(payloadValue, 'to');
|
|
1764
|
+
}
|
|
1765
|
+
(0, utils_1.assertNumber)(payloadValue);
|
|
1766
|
+
if (precision != null)
|
|
1767
|
+
payloadValue = (0, utils_1.precisionRound)(payloadValue, precision);
|
|
1768
|
+
const payload = (0, utils_1.isString)(attribute)
|
|
1769
|
+
? { [attribute]: payloadValue }
|
|
1770
|
+
: { [attribute.ID]: { value: payloadValue, type: attribute.type } };
|
|
1771
|
+
await determineEndpoint(entity, meta, cluster).write(cluster, payload, zigbeeCommandOptions);
|
|
1772
|
+
return { state: { [key]: value } };
|
|
1773
|
+
}
|
|
1774
|
+
: undefined,
|
|
1775
|
+
convertGet: access & exposes_1.access.GET
|
|
1776
|
+
? async (entity, key, meta) => {
|
|
1777
|
+
await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions);
|
|
1778
|
+
}
|
|
1779
|
+
: undefined,
|
|
1780
|
+
},
|
|
1781
|
+
];
|
|
1782
|
+
const configure = [setupConfigureForReporting(cluster, attribute, reporting, access, endpoints)];
|
|
1783
|
+
return { exposes, fromZigbee, toZigbee, configure, isModernExtend: true };
|
|
1784
|
+
}
|
|
1785
|
+
function binary(args) {
|
|
1786
|
+
const { name, valueOn, valueOff, cluster, attribute, description, zigbeeCommandOptions, endpointName, reporting, entityCategory } = args;
|
|
1787
|
+
const attributeKey = (0, utils_1.isString)(attribute) ? attribute : attribute.ID;
|
|
1788
|
+
const access = exposes_1.access[args.access ?? 'ALL'];
|
|
1789
|
+
let expose = exposes_1.presets.binary(name, access, valueOn[0], valueOff[0]).withDescription(description);
|
|
1790
|
+
if (endpointName)
|
|
1791
|
+
expose = expose.withEndpoint(endpointName);
|
|
1792
|
+
if (entityCategory)
|
|
1793
|
+
expose = expose.withCategory(entityCategory);
|
|
1794
|
+
const fromZigbee = [
|
|
1795
|
+
{
|
|
1796
|
+
cluster: cluster.toString(),
|
|
1797
|
+
type: ['attributeReport', 'readResponse'],
|
|
1798
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1799
|
+
if (attributeKey in msg.data && (!endpointName || (0, utils_1.getEndpointName)(msg, model, meta) === endpointName)) {
|
|
1800
|
+
return { [expose.property]: msg.data[attributeKey] === valueOn[1] ? valueOn[0] : valueOff[0] };
|
|
1801
|
+
}
|
|
1802
|
+
},
|
|
1803
|
+
},
|
|
1804
|
+
];
|
|
1805
|
+
const toZigbee = [
|
|
1806
|
+
{
|
|
1807
|
+
key: [name],
|
|
1808
|
+
convertSet: access & exposes_1.access.SET
|
|
1809
|
+
? async (entity, key, value, meta) => {
|
|
1810
|
+
const payloadValue = value === valueOn[0] ? valueOn[1] : valueOff[1];
|
|
1811
|
+
const payload = (0, utils_1.isString)(attribute)
|
|
1812
|
+
? { [attribute]: payloadValue }
|
|
1813
|
+
: { [attribute.ID]: { value: payloadValue, type: attribute.type } };
|
|
1814
|
+
await determineEndpoint(entity, meta, cluster).write(cluster, payload, zigbeeCommandOptions);
|
|
1815
|
+
return { state: { [key]: value } };
|
|
1816
|
+
}
|
|
1817
|
+
: undefined,
|
|
1818
|
+
convertGet: access & exposes_1.access.GET
|
|
1819
|
+
? async (entity, key, meta) => {
|
|
1820
|
+
await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions);
|
|
1821
|
+
}
|
|
1822
|
+
: undefined,
|
|
1823
|
+
},
|
|
1824
|
+
];
|
|
1825
|
+
const configure = [setupConfigureForReporting(cluster, attribute, reporting, access)];
|
|
1826
|
+
return { exposes: [expose], fromZigbee, toZigbee, configure, isModernExtend: true };
|
|
1827
|
+
}
|
|
1828
|
+
function text(args) {
|
|
1829
|
+
const { name, cluster, attribute, description, zigbeeCommandOptions, endpointName, reporting, entityCategory, validate } = args;
|
|
1830
|
+
const attributeKey = (0, utils_1.isString)(attribute) ? attribute : attribute.ID;
|
|
1831
|
+
const access = exposes_1.access[args.access ?? 'ALL'];
|
|
1832
|
+
let expose = exposes_1.presets.text(name, access).withDescription(description);
|
|
1833
|
+
if (endpointName)
|
|
1834
|
+
expose = expose.withEndpoint(endpointName);
|
|
1835
|
+
if (entityCategory)
|
|
1836
|
+
expose = expose.withCategory(entityCategory);
|
|
1837
|
+
const fromZigbee = [
|
|
1838
|
+
{
|
|
1839
|
+
cluster: cluster.toString(),
|
|
1840
|
+
type: ['attributeReport', 'readResponse'],
|
|
1841
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1842
|
+
if (attributeKey in msg.data && (!endpointName || (0, utils_1.getEndpointName)(msg, model, meta) === endpointName)) {
|
|
1843
|
+
return { [expose.property]: msg.data[attributeKey] };
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
},
|
|
1847
|
+
];
|
|
1848
|
+
const toZigbee = [
|
|
1849
|
+
{
|
|
1850
|
+
key: [name],
|
|
1851
|
+
convertSet: access & exposes_1.access.SET
|
|
1852
|
+
? async (entity, key, value, meta) => {
|
|
1853
|
+
void validate(value);
|
|
1854
|
+
const payload = (0, utils_1.isString)(attribute) ? { [attribute]: value } : { [attribute.ID]: { value, type: attribute.type } };
|
|
1855
|
+
await determineEndpoint(entity, meta, cluster).write(cluster, payload, zigbeeCommandOptions);
|
|
1856
|
+
return { state: { [key]: value } };
|
|
1857
|
+
}
|
|
1858
|
+
: undefined,
|
|
1859
|
+
convertGet: access & exposes_1.access.GET
|
|
1860
|
+
? async (entity, key, meta) => {
|
|
1861
|
+
await determineEndpoint(entity, meta, cluster).read(cluster, [attributeKey], zigbeeCommandOptions);
|
|
1862
|
+
}
|
|
1863
|
+
: undefined,
|
|
1864
|
+
},
|
|
1865
|
+
];
|
|
1866
|
+
const configure = [setupConfigureForReporting(cluster, attribute, reporting, access)];
|
|
1867
|
+
return { exposes: [expose], fromZigbee, toZigbee, configure, isModernExtend: true };
|
|
1868
|
+
}
|
|
1869
|
+
function actionEnumLookup(args) {
|
|
1870
|
+
const { actionLookup: lookup, attribute, cluster, buttonLookup } = args;
|
|
1871
|
+
const attributeKey = (0, utils_1.isString)(attribute) ? attribute : attribute.ID;
|
|
1872
|
+
const commands = args.commands || ['attributeReport', 'readResponse'];
|
|
1873
|
+
const parse = args.parse;
|
|
1874
|
+
let actions = Object.keys(lookup)
|
|
1875
|
+
.map((a) => (args.endpointNames ? args.endpointNames.map((e) => `${a}_${e}`) : [a]))
|
|
1876
|
+
.flat();
|
|
1877
|
+
// allows direct external input to be used by other extends in the same device
|
|
1878
|
+
if (args.extraActions)
|
|
1879
|
+
actions = actions.concat(args.extraActions);
|
|
1880
|
+
const expose = exposes_1.presets.enum('action', exposes_1.access.STATE, actions).withDescription('Triggered action (e.g. a button click)').withCategory('diagnostic');
|
|
1881
|
+
const fromZigbee = [
|
|
1882
|
+
{
|
|
1883
|
+
cluster: cluster.toString(),
|
|
1884
|
+
type: commands,
|
|
1885
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1886
|
+
if (attributeKey in msg.data) {
|
|
1887
|
+
let value = parse ? parse(msg, attributeKey) : msg.data[attributeKey];
|
|
1888
|
+
value = (0, utils_1.getFromLookupByValue)(value, lookup);
|
|
1889
|
+
// endpointNames is used when action endpoint names don't overlap with other endpoint names
|
|
1890
|
+
if (args.endpointNames)
|
|
1891
|
+
value = (0, utils_1.postfixWithEndpointName)(value, msg, model, meta);
|
|
1892
|
+
// buttonLookup is used when action endpoint names overlap with other endpoint names
|
|
1893
|
+
if (args.buttonLookup) {
|
|
1894
|
+
const endpointName = (0, utils_1.getFromLookupByValue)(msg.endpoint.ID, buttonLookup);
|
|
1895
|
+
value = `${value}_${endpointName}`;
|
|
1896
|
+
}
|
|
1897
|
+
return { [expose.property]: value };
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
},
|
|
1901
|
+
];
|
|
1902
|
+
return { exposes: [expose], fromZigbee, isModernExtend: true };
|
|
1903
|
+
}
|
|
1904
|
+
function quirkAddEndpointCluster(args) {
|
|
1905
|
+
const { endpointID, inputClusters, outputClusters } = args;
|
|
1906
|
+
const configure = [
|
|
1907
|
+
async (device, coordinatorEndpoint, definition) => {
|
|
1908
|
+
const endpoint = device.getEndpoint(endpointID);
|
|
1909
|
+
if (endpoint == undefined) {
|
|
1910
|
+
logger_1.logger.error(`Quirk: cannot add clusters to endpoint ${endpointID}, endpoint does not exist!`, 'zhc:quirkaddendpointcluster');
|
|
1911
|
+
return;
|
|
1912
|
+
}
|
|
1913
|
+
inputClusters?.forEach((cluster) => {
|
|
1914
|
+
const clusterID = (0, utils_1.isString)(cluster) ? zigbee_herdsman_1.Zcl.Utils.getCluster(cluster, device.manufacturerID, device.customClusters).ID : cluster;
|
|
1915
|
+
if (!endpoint.inputClusters.includes(clusterID)) {
|
|
1916
|
+
logger_1.logger.debug(`Quirk: adding input cluster ${clusterID} to endpoint ${endpointID}.`, 'zhc:quirkaddendpointcluster');
|
|
1917
|
+
endpoint.inputClusters.push(clusterID);
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1920
|
+
outputClusters?.forEach((cluster) => {
|
|
1921
|
+
const clusterID = (0, utils_1.isString)(cluster) ? zigbee_herdsman_1.Zcl.Utils.getCluster(cluster, device.manufacturerID, device.customClusters).ID : cluster;
|
|
1922
|
+
if (!endpoint.outputClusters.includes(clusterID)) {
|
|
1923
|
+
logger_1.logger.debug(`Quirk: adding output cluster ${clusterID} to endpoint ${endpointID}.`, 'zhc:quirkaddendpointcluster');
|
|
1924
|
+
endpoint.outputClusters.push(clusterID);
|
|
1925
|
+
}
|
|
1926
|
+
});
|
|
1927
|
+
device.save();
|
|
1928
|
+
},
|
|
1929
|
+
];
|
|
1930
|
+
return { configure, isModernExtend: true };
|
|
1931
|
+
}
|
|
1932
|
+
function quirkCheckinInterval(timeout) {
|
|
1933
|
+
const configure = [
|
|
1934
|
+
async (device, coordinatorEndpoint, definition) => {
|
|
1935
|
+
device.checkinInterval = typeof timeout == 'number' ? timeout : exports.TIME_LOOKUP[timeout];
|
|
1936
|
+
device.save();
|
|
1937
|
+
},
|
|
1938
|
+
];
|
|
1939
|
+
return { configure, isModernExtend: true };
|
|
1940
|
+
}
|
|
1941
|
+
function reconfigureReportingsOnDeviceAnnounce() {
|
|
1942
|
+
const onEvent = async (type, data, device, options, state) => {
|
|
1943
|
+
if (type === 'deviceAnnounce') {
|
|
1944
|
+
for (const endpoint of device.endpoints) {
|
|
1945
|
+
for (const c of endpoint.configuredReportings) {
|
|
1946
|
+
await endpoint.configureReporting(c.cluster.name, [
|
|
1947
|
+
{
|
|
1948
|
+
attribute: c.attribute.name,
|
|
1949
|
+
minimumReportInterval: c.minimumReportInterval,
|
|
1950
|
+
maximumReportInterval: c.maximumReportInterval,
|
|
1951
|
+
reportableChange: c.reportableChange,
|
|
1952
|
+
},
|
|
1953
|
+
]);
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
return { onEvent, isModernExtend: true };
|
|
1959
|
+
}
|
|
1960
|
+
function deviceEndpoints(args) {
|
|
1961
|
+
const result = {
|
|
1962
|
+
meta: { multiEndpoint: true },
|
|
1963
|
+
endpoint: (d) => args.endpoints,
|
|
1964
|
+
isModernExtend: true,
|
|
1965
|
+
};
|
|
1966
|
+
if (args.multiEndpointSkip)
|
|
1967
|
+
result.meta.multiEndpointSkip = args.multiEndpointSkip;
|
|
1968
|
+
return result;
|
|
1969
|
+
}
|
|
1970
|
+
function deviceAddCustomCluster(clusterName, clusterDefinition) {
|
|
1971
|
+
const addCluster = (device) => {
|
|
1972
|
+
if (!device.customClusters[clusterName]) {
|
|
1973
|
+
device.addCustomCluster(clusterName, clusterDefinition);
|
|
1974
|
+
}
|
|
1975
|
+
};
|
|
1976
|
+
const onEvent = async (type, data, device, options, state) => addCluster(device);
|
|
1977
|
+
const configure = [async (device) => addCluster(device)];
|
|
1978
|
+
return { onEvent, configure, isModernExtend: true };
|
|
1979
|
+
}
|
|
1980
|
+
function ignoreClusterReport(args) {
|
|
1981
|
+
const fromZigbee = [
|
|
1982
|
+
{
|
|
1983
|
+
cluster: args.cluster.toString(),
|
|
1984
|
+
type: ['attributeReport', 'readResponse'],
|
|
1985
|
+
convert: (model, msg, publish, options, meta) => { },
|
|
1986
|
+
},
|
|
1987
|
+
];
|
|
1988
|
+
return { fromZigbee, isModernExtend: true };
|
|
1989
|
+
}
|
|
1990
|
+
function bindCluster(args) {
|
|
1991
|
+
const configure = [setupConfigureForBinding(args.cluster, args.clusterType, args.endpointNames)];
|
|
1992
|
+
return { configure, isModernExtend: true };
|
|
1993
|
+
}
|
|
1994
|
+
// #endregion
|
|
1995
|
+
//# sourceMappingURL=modernExtend.js.map
|