@@ -43,16 +43,42 @@ class Matter_Plugin_Root : Matter_Plugin
43
43
0x003E : [ 0 ,1 ,2 ,3 ,4 ,5 ] , # Node Operational Credentials Cluster 11.17 p.704
44
44
0x003F : [] # Group Key Management Cluster 11.2 p.572
45
45
})
46
+ # static var CLUSTERS_ICD = matter.consolidate_clusters(_class.CLUSTERS, {
47
+ # 0x0046: [0,1,2] # ICD Management Cluster
48
+ # })
46
49
static var TYPES = { 0x0016 : 1 } # Root node
47
50
51
+ # # ICD options
52
+ # var icd_idle, icd_active, icd_threshold
53
+
48
54
#############################################################
49
55
# Constructor
50
56
def init ( device, endpoint, config)
51
57
super ( self ) .init ( device, endpoint, config)
58
+ # # check if we have ICD parameters
59
+ # self.icd_idle = config.find("icd_idle", nil)
60
+ # if (self.icd_idle != nil)
61
+ # self.icd_active = config.find("icd_active", 5000) # default 5s
62
+ # self.icd_threshold = config.find("icd_threshold", 300) # default 300ms
63
+ # end
64
+ # publish mandatory events
52
65
self .publish_event ( 0x0028 , 0x00 , matter.EVENT_CRITICAL , matter.TLV.Matter_TLV_item () .set ( matter.TLV.U4 , tasmota.version ())) # Event StartUp - Software Version
53
66
self .publish_event ( 0x0033 , 0x03 , matter.EVENT_CRITICAL , matter.TLV.Matter_TLV_item () .set ( matter.TLV.U1 , 1 )) # Event BootReason - PowerOnReboot - TODO if we need to refine
54
67
end
55
68
69
+ #############################################################
70
+ # consolidate_clusters
71
+ #
72
+ # Build a consolidated map of all the `CLUSTERS` static vars
73
+ # from the inheritance hierarchy
74
+ # def get_clusters()
75
+ # if (self.icd_idle == nil)
76
+ # return self.CLUSTERS
77
+ # else
78
+ # return self.CLUSTERS_ICD
79
+ # end
80
+ # end
81
+
56
82
#############################################################
57
83
# read an attribute
58
84
#
@@ -323,6 +349,17 @@ class Matter_Plugin_Root : Matter_Plugin
323
349
return pl
324
350
end
325
351
352
+ # ====================================================================================================
353
+ # elif cluster == 0x0046 # ========== ICD Management Cluster ==========
354
+
355
+ # if attribute == 0x0000 # ---------- IdleModeDuration / uint32 (seconds) ----------
356
+ # return tlv_solo.set_or_nil(TLV.U4, self.icd_idle)
357
+ # elif attribute == 0x0001 # ---------- ActiveModeDuration / uint32 (milliseconds) ----------
358
+ # return tlv_solo.set_or_nil(TLV.U4, self.icd_active)
359
+ # elif attribute == 0x0002 # ---------- ActiveModeThreshold / uint16 (milliseconds) ----------
360
+ # return tlv_solo.set_or_nil(TLV.U2, self.icd_threshold)
361
+ # end
362
+
326
363
end
327
364
return super ( self ) .read_attribute ( session, ctx, tlv_solo)
328
365
end
0 commit comments