Closed Nerivec closed 1 week ago
@Koenkk If you can review this commit in great details. It drastically changes the code for clusters/custom clusters lookup. We need to make sure it still matches the way you designed custom clusters to be (i.e. that tests aren't testing this wrong). 😅 If it does, these changes have one heck of a nice side-effect:
x10000 getCluster
:
Old: ~280ms
New: ~50ms
x10000 getCluster
with 2 custom clusters:
Old: ~7.5s
New: ~57ms
Thanks!
import {ZSpec, Zcl, Zdo} from 'zigbee-herdsman'
ZSpec.ZIGBEE_REVISION
ZSpec.BroadcastAddress.RX_ON_WHEN_IDLE
ZSpec.Utils.channelsToUInt32Mask()
Zdo.ZDO_ENDPOINT
Zdo.LeaveRequestFlags.WITHOUT_REJOIN
Zdo.Utils.getServerMask()
Zdo.Status.SUCCESS
andnew Zdo.StatusError(Zdo.Status.INV_REQUESTTYPE)
Zcl.POWER_SOURCES
Zcl.DataType.UINT8
Zcl.Utils.isClusterName()
Zcl.Status.SUCCESS
andnew Zcl.StatusError(Zcl.Status.FAILURE)
Zcl.Frame
Zcl.Header
ParameterCondition
,DataTypeClass
and replace hardcoded strings in Clusters/Foundation.ParameterDefinition
, and more...CHAR_STR
to its own data typeMI_STRUCT
.TODO: