Skip to main content

matc/clusters/codec/
mod.rs

1//! Matter cluster TLV encoders and decoders
2//! 
3//! This file is automatically generated.
4
5pub mod schema;
6pub mod json_util;
7pub use schema::{CommandField, FieldKind};
8
9pub mod account_login;
10pub mod acl_cluster;
11pub mod actions_cluster;
12pub mod admin_commissioning_cluster;
13pub mod air_quality;
14pub mod alarm_base;
15pub mod application_basic;
16pub mod application_launcher;
17pub mod audio_output;
18pub mod basic_information_cluster;
19pub mod binding_cluster;
20pub mod boolean_state;
21pub mod boolean_state_configuration;
22pub mod bridged_device_basic_information_cluster;
23pub mod camera_av_settings_user_level_management;
24pub mod camera_av_stream_management;
25pub mod channel;
26pub mod chime;
27pub mod closure_control;
28pub mod closure_dimension;
29pub mod color_control;
30pub mod commissioner_control_cluster;
31pub mod commodity_metering;
32pub mod commodity_price;
33pub mod commodity_tariff;
34pub mod concentration_measurement;
35pub mod content_app_observer;
36pub mod content_control;
37pub mod content_launcher;
38pub mod descriptor_cluster;
39pub mod device_energy_management;
40pub mod diagnostic_logs_cluster;
41pub mod diagnostics_ethernet;
42pub mod diagnostics_general;
43pub mod diagnostics_software;
44pub mod diagnostics_thread;
45pub mod diagnostics_wifi;
46pub mod dishwasher_alarm;
47pub mod door_lock;
48pub mod ecosystem_information_cluster;
49pub mod electrical_energy_measurement;
50pub mod electrical_grid_conditions;
51pub mod electrical_power_measurement;
52pub mod energy_evse;
53pub mod energy_preference;
54pub mod fan_control;
55pub mod fixed_label_cluster;
56pub mod flow_measurement;
57pub mod general_commissioning_cluster;
58pub mod group_key_management_cluster;
59pub mod groupcast;
60pub mod groups;
61pub mod icd_management;
62pub mod identify;
63pub mod illuminance_measurement;
64pub mod joint_fabric_administrator_cluster;
65pub mod joint_fabric_datastore_cluster;
66pub mod keypad_input;
67pub mod label_cluster;
68pub mod laundry_dryer_controls;
69pub mod laundry_washer_controls;
70pub mod level_control;
71pub mod localization_configuration;
72pub mod localization_time_format;
73pub mod localization_unit;
74pub mod low_power;
75pub mod media_input;
76pub mod media_playback;
77pub mod messages;
78pub mod meter_identification;
79pub mod microwave_oven_control;
80pub mod mode_base;
81pub mod mode_device_energy_management;
82pub mod mode_dishwasher;
83pub mod mode_evse;
84pub mod mode_laundry_washer;
85pub mod mode_microwave_oven;
86pub mod mode_oven;
87pub mod mode_refrigerator;
88pub mod mode_rvc_clean;
89pub mod mode_rvc_run;
90pub mod mode_select;
91pub mod mode_water_heater;
92pub mod network_commissioning_cluster;
93pub mod network_identity_management;
94pub mod occupancy_sensing;
95pub mod on_off;
96pub mod operational_credential_cluster;
97pub mod operational_state;
98pub mod operational_state_oven;
99pub mod operational_state_rvc;
100pub mod ota_provider;
101pub mod ota_requestor;
102pub mod power_source_cluster;
103pub mod power_source_configuration_cluster;
104pub mod power_topology;
105pub mod pressure_measurement;
106pub mod pump_configuration_control;
107pub mod push_av_stream_transport;
108pub mod refrigerator_alarm;
109pub mod resource_monitoring;
110pub mod scenes;
111pub mod service_area;
112pub mod smoke_co_alarm;
113pub mod soil_measurement;
114pub mod switch;
115pub mod target_navigator;
116pub mod temperature_alarm;
117pub mod temperature_control;
118pub mod temperature_measurement;
119pub mod thermostat;
120pub mod thermostat_user_interface_configuration;
121pub mod thread_border_router_diagnostics;
122pub mod thread_border_router_management;
123pub mod thread_network_directory;
124pub mod time_sync;
125pub mod tls_certificate_management;
126pub mod tls_client_management;
127pub mod user_label_cluster;
128pub mod valve_configuration_control;
129pub mod wake_on_lan;
130pub mod water_content_measurement;
131pub mod water_heater_management;
132pub mod web_rtc_provider;
133pub mod web_rtc_requestor;
134pub mod wifi_network_management;
135pub mod window_covering;
136pub mod zone_management;
137
138
139/// Main dispatcher function for decoding attributes to JSON
140///
141/// This function routes to the appropriate cluster-specific decoder based on cluster ID.
142///
143/// # Parameters
144/// * `cluster_id` - The cluster identifier
145/// * `attribute_id` - The attribute identifier
146/// * `tlv_value` - The TLV value to decode
147///
148/// # Returns
149/// JSON string representation of the decoded value or error message
150pub fn decode_attribute_json(cluster_id: u32, attribute_id: u32, tlv_value: &crate::tlv::TlvItemValue) -> String {
151    match cluster_id {
152        0x0000 => alarm_base::decode_attribute_json(cluster_id, attribute_id, tlv_value),
153        0x0003 => identify::decode_attribute_json(cluster_id, attribute_id, tlv_value),
154        0x0004 => groups::decode_attribute_json(cluster_id, attribute_id, tlv_value),
155        0x0006 => on_off::decode_attribute_json(cluster_id, attribute_id, tlv_value),
156        0x0008 => level_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
157        0x001D => descriptor_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
158        0x001E => binding_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
159        0x001F => acl_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
160        0x0025 => actions_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
161        0x0028 => basic_information_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
162        0x002A => ota_requestor::decode_attribute_json(cluster_id, attribute_id, tlv_value),
163        0x002B => localization_configuration::decode_attribute_json(cluster_id, attribute_id, tlv_value),
164        0x002C => localization_time_format::decode_attribute_json(cluster_id, attribute_id, tlv_value),
165        0x002D => localization_unit::decode_attribute_json(cluster_id, attribute_id, tlv_value),
166        0x002E => power_source_configuration_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
167        0x002F => power_source_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
168        0x0030 => general_commissioning_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
169        0x0031 => network_commissioning_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
170        0x0033 => diagnostics_general::decode_attribute_json(cluster_id, attribute_id, tlv_value),
171        0x0034 => diagnostics_software::decode_attribute_json(cluster_id, attribute_id, tlv_value),
172        0x0035 => diagnostics_thread::decode_attribute_json(cluster_id, attribute_id, tlv_value),
173        0x0036 => diagnostics_wifi::decode_attribute_json(cluster_id, attribute_id, tlv_value),
174        0x0037 => diagnostics_ethernet::decode_attribute_json(cluster_id, attribute_id, tlv_value),
175        0x0038 => time_sync::decode_attribute_json(cluster_id, attribute_id, tlv_value),
176        0x0039 => bridged_device_basic_information_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
177        0x003B => switch::decode_attribute_json(cluster_id, attribute_id, tlv_value),
178        0x003C => admin_commissioning_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
179        0x003E => operational_credential_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
180        0x003F => group_key_management_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
181        0x0040 => fixed_label_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
182        0x0041 => user_label_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
183        0x0045 => boolean_state::decode_attribute_json(cluster_id, attribute_id, tlv_value),
184        0x0046 => icd_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
185        0x0049 => mode_oven::decode_attribute_json(cluster_id, attribute_id, tlv_value),
186        0x004A => laundry_dryer_controls::decode_attribute_json(cluster_id, attribute_id, tlv_value),
187        0x0050 => mode_select::decode_attribute_json(cluster_id, attribute_id, tlv_value),
188        0x0051 => mode_laundry_washer::decode_attribute_json(cluster_id, attribute_id, tlv_value),
189        0x0052 => mode_refrigerator::decode_attribute_json(cluster_id, attribute_id, tlv_value),
190        0x0053 => laundry_washer_controls::decode_attribute_json(cluster_id, attribute_id, tlv_value),
191        0x0054 => mode_rvc_run::decode_attribute_json(cluster_id, attribute_id, tlv_value),
192        0x0055 => mode_rvc_clean::decode_attribute_json(cluster_id, attribute_id, tlv_value),
193        0x0056 => temperature_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
194        0x0059 => mode_dishwasher::decode_attribute_json(cluster_id, attribute_id, tlv_value),
195        0x005B => air_quality::decode_attribute_json(cluster_id, attribute_id, tlv_value),
196        0x005C => smoke_co_alarm::decode_attribute_json(cluster_id, attribute_id, tlv_value),
197        0x005E => mode_microwave_oven::decode_attribute_json(cluster_id, attribute_id, tlv_value),
198        0x005F => microwave_oven_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
199        0x0060 => operational_state::decode_attribute_json(cluster_id, attribute_id, tlv_value),
200        0x0062 => scenes::decode_attribute_json(cluster_id, attribute_id, tlv_value),
201        0x0064 => temperature_alarm::decode_attribute_json(cluster_id, attribute_id, tlv_value),
202        0x0065 => groupcast::decode_attribute_json(cluster_id, attribute_id, tlv_value),
203        0x0080 => boolean_state_configuration::decode_attribute_json(cluster_id, attribute_id, tlv_value),
204        0x0081 => valve_configuration_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
205        0x0090 => electrical_power_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
206        0x0091 => electrical_energy_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
207        0x0094 => water_heater_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
208        0x0095 => commodity_price::decode_attribute_json(cluster_id, attribute_id, tlv_value),
209        0x0097 => messages::decode_attribute_json(cluster_id, attribute_id, tlv_value),
210        0x0098 => device_energy_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
211        0x0099 => energy_evse::decode_attribute_json(cluster_id, attribute_id, tlv_value),
212        0x009B => energy_preference::decode_attribute_json(cluster_id, attribute_id, tlv_value),
213        0x009C => power_topology::decode_attribute_json(cluster_id, attribute_id, tlv_value),
214        0x009D => mode_evse::decode_attribute_json(cluster_id, attribute_id, tlv_value),
215        0x009E => mode_water_heater::decode_attribute_json(cluster_id, attribute_id, tlv_value),
216        0x009F => mode_device_energy_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
217        0x00A0 => electrical_grid_conditions::decode_attribute_json(cluster_id, attribute_id, tlv_value),
218        0x0101 => door_lock::decode_attribute_json(cluster_id, attribute_id, tlv_value),
219        0x0102 => window_covering::decode_attribute_json(cluster_id, attribute_id, tlv_value),
220        0x0104 => closure_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
221        0x0105 => closure_dimension::decode_attribute_json(cluster_id, attribute_id, tlv_value),
222        0x0150 => service_area::decode_attribute_json(cluster_id, attribute_id, tlv_value),
223        0x0200 => pump_configuration_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
224        0x0201 => thermostat::decode_attribute_json(cluster_id, attribute_id, tlv_value),
225        0x0202 => fan_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
226        0x0204 => thermostat_user_interface_configuration::decode_attribute_json(cluster_id, attribute_id, tlv_value),
227        0x0300 => color_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
228        0x0400 => illuminance_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
229        0x0402 => temperature_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
230        0x0403 => pressure_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
231        0x0404 => flow_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
232        0x0406 => occupancy_sensing::decode_attribute_json(cluster_id, attribute_id, tlv_value),
233        0x0430 => soil_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
234        0x0450 => network_identity_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
235        0x0451 => wifi_network_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
236        0x0452 => thread_border_router_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
237        0x0453 => thread_network_directory::decode_attribute_json(cluster_id, attribute_id, tlv_value),
238        0x0454 => thread_border_router_diagnostics::decode_attribute_json(cluster_id, attribute_id, tlv_value),
239        0x0503 => wake_on_lan::decode_attribute_json(cluster_id, attribute_id, tlv_value),
240        0x0504 => channel::decode_attribute_json(cluster_id, attribute_id, tlv_value),
241        0x0505 => target_navigator::decode_attribute_json(cluster_id, attribute_id, tlv_value),
242        0x0506 => media_playback::decode_attribute_json(cluster_id, attribute_id, tlv_value),
243        0x0507 => media_input::decode_attribute_json(cluster_id, attribute_id, tlv_value),
244        0x050A => content_launcher::decode_attribute_json(cluster_id, attribute_id, tlv_value),
245        0x050B => audio_output::decode_attribute_json(cluster_id, attribute_id, tlv_value),
246        0x050C => application_launcher::decode_attribute_json(cluster_id, attribute_id, tlv_value),
247        0x050D => application_basic::decode_attribute_json(cluster_id, attribute_id, tlv_value),
248        0x050F => content_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
249        0x0550 => zone_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
250        0x0551 => camera_av_stream_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
251        0x0552 => camera_av_settings_user_level_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
252        0x0553 => web_rtc_provider::decode_attribute_json(cluster_id, attribute_id, tlv_value),
253        0x0554 => web_rtc_requestor::decode_attribute_json(cluster_id, attribute_id, tlv_value),
254        0x0555 => push_av_stream_transport::decode_attribute_json(cluster_id, attribute_id, tlv_value),
255        0x0556 => chime::decode_attribute_json(cluster_id, attribute_id, tlv_value),
256        0x0700 => commodity_tariff::decode_attribute_json(cluster_id, attribute_id, tlv_value),
257        0x0750 => ecosystem_information_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
258        0x0751 => commissioner_control_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
259        0x0752 => joint_fabric_datastore_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
260        0x0753 => joint_fabric_administrator_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
261        0x0801 => tls_certificate_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
262        0x0802 => tls_client_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
263        0x0B06 => meter_identification::decode_attribute_json(cluster_id, attribute_id, tlv_value),
264        0x0B07 => commodity_metering::decode_attribute_json(cluster_id, attribute_id, tlv_value),
265        _ => format!("{{\"error\": \"Unsupported cluster ID: {}\"}}", cluster_id),
266    }
267}
268
269
270/// Main dispatcher function for getting attribute lists
271///
272/// This function routes to the appropriate cluster-specific attribute list based on cluster ID.
273///
274/// # Parameters
275/// * `cluster_id` - The cluster identifier
276///
277/// # Returns
278/// Vector of tuples containing (attribute_id, attribute_name) or empty vector if unsupported
279pub fn get_attribute_list(cluster_id: u32) -> Vec<(u32, &'static str)> {
280    match cluster_id {
281        0x0000 => alarm_base::get_attribute_list(),
282        0x0003 => identify::get_attribute_list(),
283        0x0004 => groups::get_attribute_list(),
284        0x0006 => on_off::get_attribute_list(),
285        0x0008 => level_control::get_attribute_list(),
286        0x001D => descriptor_cluster::get_attribute_list(),
287        0x001E => binding_cluster::get_attribute_list(),
288        0x001F => acl_cluster::get_attribute_list(),
289        0x0025 => actions_cluster::get_attribute_list(),
290        0x0028 => basic_information_cluster::get_attribute_list(),
291        0x002A => ota_requestor::get_attribute_list(),
292        0x002B => localization_configuration::get_attribute_list(),
293        0x002C => localization_time_format::get_attribute_list(),
294        0x002D => localization_unit::get_attribute_list(),
295        0x002E => power_source_configuration_cluster::get_attribute_list(),
296        0x002F => power_source_cluster::get_attribute_list(),
297        0x0030 => general_commissioning_cluster::get_attribute_list(),
298        0x0031 => network_commissioning_cluster::get_attribute_list(),
299        0x0033 => diagnostics_general::get_attribute_list(),
300        0x0034 => diagnostics_software::get_attribute_list(),
301        0x0035 => diagnostics_thread::get_attribute_list(),
302        0x0036 => diagnostics_wifi::get_attribute_list(),
303        0x0037 => diagnostics_ethernet::get_attribute_list(),
304        0x0038 => time_sync::get_attribute_list(),
305        0x0039 => bridged_device_basic_information_cluster::get_attribute_list(),
306        0x003B => switch::get_attribute_list(),
307        0x003C => admin_commissioning_cluster::get_attribute_list(),
308        0x003E => operational_credential_cluster::get_attribute_list(),
309        0x003F => group_key_management_cluster::get_attribute_list(),
310        0x0040 => fixed_label_cluster::get_attribute_list(),
311        0x0041 => user_label_cluster::get_attribute_list(),
312        0x0045 => boolean_state::get_attribute_list(),
313        0x0046 => icd_management::get_attribute_list(),
314        0x0049 => mode_oven::get_attribute_list(),
315        0x004A => laundry_dryer_controls::get_attribute_list(),
316        0x0050 => mode_select::get_attribute_list(),
317        0x0051 => mode_laundry_washer::get_attribute_list(),
318        0x0052 => mode_refrigerator::get_attribute_list(),
319        0x0053 => laundry_washer_controls::get_attribute_list(),
320        0x0054 => mode_rvc_run::get_attribute_list(),
321        0x0055 => mode_rvc_clean::get_attribute_list(),
322        0x0056 => temperature_control::get_attribute_list(),
323        0x0059 => mode_dishwasher::get_attribute_list(),
324        0x005B => air_quality::get_attribute_list(),
325        0x005C => smoke_co_alarm::get_attribute_list(),
326        0x005E => mode_microwave_oven::get_attribute_list(),
327        0x005F => microwave_oven_control::get_attribute_list(),
328        0x0060 => operational_state::get_attribute_list(),
329        0x0062 => scenes::get_attribute_list(),
330        0x0064 => temperature_alarm::get_attribute_list(),
331        0x0065 => groupcast::get_attribute_list(),
332        0x0080 => boolean_state_configuration::get_attribute_list(),
333        0x0081 => valve_configuration_control::get_attribute_list(),
334        0x0090 => electrical_power_measurement::get_attribute_list(),
335        0x0091 => electrical_energy_measurement::get_attribute_list(),
336        0x0094 => water_heater_management::get_attribute_list(),
337        0x0095 => commodity_price::get_attribute_list(),
338        0x0097 => messages::get_attribute_list(),
339        0x0098 => device_energy_management::get_attribute_list(),
340        0x0099 => energy_evse::get_attribute_list(),
341        0x009B => energy_preference::get_attribute_list(),
342        0x009C => power_topology::get_attribute_list(),
343        0x009D => mode_evse::get_attribute_list(),
344        0x009E => mode_water_heater::get_attribute_list(),
345        0x009F => mode_device_energy_management::get_attribute_list(),
346        0x00A0 => electrical_grid_conditions::get_attribute_list(),
347        0x0101 => door_lock::get_attribute_list(),
348        0x0102 => window_covering::get_attribute_list(),
349        0x0104 => closure_control::get_attribute_list(),
350        0x0105 => closure_dimension::get_attribute_list(),
351        0x0150 => service_area::get_attribute_list(),
352        0x0200 => pump_configuration_control::get_attribute_list(),
353        0x0201 => thermostat::get_attribute_list(),
354        0x0202 => fan_control::get_attribute_list(),
355        0x0204 => thermostat_user_interface_configuration::get_attribute_list(),
356        0x0300 => color_control::get_attribute_list(),
357        0x0400 => illuminance_measurement::get_attribute_list(),
358        0x0402 => temperature_measurement::get_attribute_list(),
359        0x0403 => pressure_measurement::get_attribute_list(),
360        0x0404 => flow_measurement::get_attribute_list(),
361        0x0406 => occupancy_sensing::get_attribute_list(),
362        0x0430 => soil_measurement::get_attribute_list(),
363        0x0450 => network_identity_management::get_attribute_list(),
364        0x0451 => wifi_network_management::get_attribute_list(),
365        0x0452 => thread_border_router_management::get_attribute_list(),
366        0x0453 => thread_network_directory::get_attribute_list(),
367        0x0454 => thread_border_router_diagnostics::get_attribute_list(),
368        0x0503 => wake_on_lan::get_attribute_list(),
369        0x0504 => channel::get_attribute_list(),
370        0x0505 => target_navigator::get_attribute_list(),
371        0x0506 => media_playback::get_attribute_list(),
372        0x0507 => media_input::get_attribute_list(),
373        0x050A => content_launcher::get_attribute_list(),
374        0x050B => audio_output::get_attribute_list(),
375        0x050C => application_launcher::get_attribute_list(),
376        0x050D => application_basic::get_attribute_list(),
377        0x050F => content_control::get_attribute_list(),
378        0x0550 => zone_management::get_attribute_list(),
379        0x0551 => camera_av_stream_management::get_attribute_list(),
380        0x0552 => camera_av_settings_user_level_management::get_attribute_list(),
381        0x0553 => web_rtc_provider::get_attribute_list(),
382        0x0554 => web_rtc_requestor::get_attribute_list(),
383        0x0555 => push_av_stream_transport::get_attribute_list(),
384        0x0556 => chime::get_attribute_list(),
385        0x0700 => commodity_tariff::get_attribute_list(),
386        0x0750 => ecosystem_information_cluster::get_attribute_list(),
387        0x0751 => commissioner_control_cluster::get_attribute_list(),
388        0x0752 => joint_fabric_datastore_cluster::get_attribute_list(),
389        0x0753 => joint_fabric_administrator_cluster::get_attribute_list(),
390        0x0801 => tls_certificate_management::get_attribute_list(),
391        0x0802 => tls_client_management::get_attribute_list(),
392        0x0B06 => meter_identification::get_attribute_list(),
393        0x0B07 => commodity_metering::get_attribute_list(),
394        _ => vec![],
395    }
396}
397
398
399pub fn get_command_list(cluster_id: u32) -> Vec<(u32, &'static str)> {
400    match cluster_id {
401        0x0000 => alarm_base::get_command_list(),
402        0x0003 => identify::get_command_list(),
403        0x0004 => groups::get_command_list(),
404        0x0006 => on_off::get_command_list(),
405        0x0008 => level_control::get_command_list(),
406        0x001F => acl_cluster::get_command_list(),
407        0x0025 => actions_cluster::get_command_list(),
408        0x0029 => ota_provider::get_command_list(),
409        0x002A => ota_requestor::get_command_list(),
410        0x0030 => general_commissioning_cluster::get_command_list(),
411        0x0031 => network_commissioning_cluster::get_command_list(),
412        0x0032 => diagnostic_logs_cluster::get_command_list(),
413        0x0033 => diagnostics_general::get_command_list(),
414        0x0034 => diagnostics_software::get_command_list(),
415        0x0035 => diagnostics_thread::get_command_list(),
416        0x0036 => diagnostics_wifi::get_command_list(),
417        0x0037 => diagnostics_ethernet::get_command_list(),
418        0x0038 => time_sync::get_command_list(),
419        0x0039 => bridged_device_basic_information_cluster::get_command_list(),
420        0x003C => admin_commissioning_cluster::get_command_list(),
421        0x003E => operational_credential_cluster::get_command_list(),
422        0x003F => group_key_management_cluster::get_command_list(),
423        0x0046 => icd_management::get_command_list(),
424        0x0048 => operational_state_oven::get_command_list(),
425        0x0050 => mode_select::get_command_list(),
426        0x0056 => temperature_control::get_command_list(),
427        0x0057 => refrigerator_alarm::get_command_list(),
428        0x005C => smoke_co_alarm::get_command_list(),
429        0x005E => mode_microwave_oven::get_command_list(),
430        0x005F => microwave_oven_control::get_command_list(),
431        0x0060 => operational_state::get_command_list(),
432        0x0061 => operational_state_rvc::get_command_list(),
433        0x0062 => scenes::get_command_list(),
434        0x0064 => temperature_alarm::get_command_list(),
435        0x0065 => groupcast::get_command_list(),
436        0x0080 => boolean_state_configuration::get_command_list(),
437        0x0081 => valve_configuration_control::get_command_list(),
438        0x0094 => water_heater_management::get_command_list(),
439        0x0095 => commodity_price::get_command_list(),
440        0x0097 => messages::get_command_list(),
441        0x0098 => device_energy_management::get_command_list(),
442        0x0099 => energy_evse::get_command_list(),
443        0x0101 => door_lock::get_command_list(),
444        0x0102 => window_covering::get_command_list(),
445        0x0104 => closure_control::get_command_list(),
446        0x0105 => closure_dimension::get_command_list(),
447        0x0150 => service_area::get_command_list(),
448        0x0201 => thermostat::get_command_list(),
449        0x0202 => fan_control::get_command_list(),
450        0x0300 => color_control::get_command_list(),
451        0x0450 => network_identity_management::get_command_list(),
452        0x0451 => wifi_network_management::get_command_list(),
453        0x0452 => thread_border_router_management::get_command_list(),
454        0x0453 => thread_network_directory::get_command_list(),
455        0x0504 => channel::get_command_list(),
456        0x0505 => target_navigator::get_command_list(),
457        0x0506 => media_playback::get_command_list(),
458        0x0507 => media_input::get_command_list(),
459        0x0508 => low_power::get_command_list(),
460        0x0509 => keypad_input::get_command_list(),
461        0x050A => content_launcher::get_command_list(),
462        0x050B => audio_output::get_command_list(),
463        0x050C => application_launcher::get_command_list(),
464        0x050E => account_login::get_command_list(),
465        0x050F => content_control::get_command_list(),
466        0x0510 => content_app_observer::get_command_list(),
467        0x0550 => zone_management::get_command_list(),
468        0x0551 => camera_av_stream_management::get_command_list(),
469        0x0552 => camera_av_settings_user_level_management::get_command_list(),
470        0x0553 => web_rtc_provider::get_command_list(),
471        0x0554 => web_rtc_requestor::get_command_list(),
472        0x0555 => push_av_stream_transport::get_command_list(),
473        0x0556 => chime::get_command_list(),
474        0x0700 => commodity_tariff::get_command_list(),
475        0x0751 => commissioner_control_cluster::get_command_list(),
476        0x0752 => joint_fabric_datastore_cluster::get_command_list(),
477        0x0753 => joint_fabric_administrator_cluster::get_command_list(),
478        0x0801 => tls_certificate_management::get_command_list(),
479        0x0802 => tls_client_management::get_command_list(),
480        _ => vec![],
481    }
482}
483
484pub fn get_command_name(cluster_id: u32, cmd_id: u32) -> Option<&'static str> {
485    match cluster_id {
486        0x0000 => alarm_base::get_command_name(cmd_id),
487        0x0003 => identify::get_command_name(cmd_id),
488        0x0004 => groups::get_command_name(cmd_id),
489        0x0006 => on_off::get_command_name(cmd_id),
490        0x0008 => level_control::get_command_name(cmd_id),
491        0x001F => acl_cluster::get_command_name(cmd_id),
492        0x0025 => actions_cluster::get_command_name(cmd_id),
493        0x0029 => ota_provider::get_command_name(cmd_id),
494        0x002A => ota_requestor::get_command_name(cmd_id),
495        0x0030 => general_commissioning_cluster::get_command_name(cmd_id),
496        0x0031 => network_commissioning_cluster::get_command_name(cmd_id),
497        0x0032 => diagnostic_logs_cluster::get_command_name(cmd_id),
498        0x0033 => diagnostics_general::get_command_name(cmd_id),
499        0x0034 => diagnostics_software::get_command_name(cmd_id),
500        0x0035 => diagnostics_thread::get_command_name(cmd_id),
501        0x0036 => diagnostics_wifi::get_command_name(cmd_id),
502        0x0037 => diagnostics_ethernet::get_command_name(cmd_id),
503        0x0038 => time_sync::get_command_name(cmd_id),
504        0x0039 => bridged_device_basic_information_cluster::get_command_name(cmd_id),
505        0x003C => admin_commissioning_cluster::get_command_name(cmd_id),
506        0x003E => operational_credential_cluster::get_command_name(cmd_id),
507        0x003F => group_key_management_cluster::get_command_name(cmd_id),
508        0x0046 => icd_management::get_command_name(cmd_id),
509        0x0048 => operational_state_oven::get_command_name(cmd_id),
510        0x0050 => mode_select::get_command_name(cmd_id),
511        0x0056 => temperature_control::get_command_name(cmd_id),
512        0x0057 => refrigerator_alarm::get_command_name(cmd_id),
513        0x005C => smoke_co_alarm::get_command_name(cmd_id),
514        0x005E => mode_microwave_oven::get_command_name(cmd_id),
515        0x005F => microwave_oven_control::get_command_name(cmd_id),
516        0x0060 => operational_state::get_command_name(cmd_id),
517        0x0061 => operational_state_rvc::get_command_name(cmd_id),
518        0x0062 => scenes::get_command_name(cmd_id),
519        0x0064 => temperature_alarm::get_command_name(cmd_id),
520        0x0065 => groupcast::get_command_name(cmd_id),
521        0x0080 => boolean_state_configuration::get_command_name(cmd_id),
522        0x0081 => valve_configuration_control::get_command_name(cmd_id),
523        0x0094 => water_heater_management::get_command_name(cmd_id),
524        0x0095 => commodity_price::get_command_name(cmd_id),
525        0x0097 => messages::get_command_name(cmd_id),
526        0x0098 => device_energy_management::get_command_name(cmd_id),
527        0x0099 => energy_evse::get_command_name(cmd_id),
528        0x0101 => door_lock::get_command_name(cmd_id),
529        0x0102 => window_covering::get_command_name(cmd_id),
530        0x0104 => closure_control::get_command_name(cmd_id),
531        0x0105 => closure_dimension::get_command_name(cmd_id),
532        0x0150 => service_area::get_command_name(cmd_id),
533        0x0201 => thermostat::get_command_name(cmd_id),
534        0x0202 => fan_control::get_command_name(cmd_id),
535        0x0300 => color_control::get_command_name(cmd_id),
536        0x0450 => network_identity_management::get_command_name(cmd_id),
537        0x0451 => wifi_network_management::get_command_name(cmd_id),
538        0x0452 => thread_border_router_management::get_command_name(cmd_id),
539        0x0453 => thread_network_directory::get_command_name(cmd_id),
540        0x0504 => channel::get_command_name(cmd_id),
541        0x0505 => target_navigator::get_command_name(cmd_id),
542        0x0506 => media_playback::get_command_name(cmd_id),
543        0x0507 => media_input::get_command_name(cmd_id),
544        0x0508 => low_power::get_command_name(cmd_id),
545        0x0509 => keypad_input::get_command_name(cmd_id),
546        0x050A => content_launcher::get_command_name(cmd_id),
547        0x050B => audio_output::get_command_name(cmd_id),
548        0x050C => application_launcher::get_command_name(cmd_id),
549        0x050E => account_login::get_command_name(cmd_id),
550        0x050F => content_control::get_command_name(cmd_id),
551        0x0510 => content_app_observer::get_command_name(cmd_id),
552        0x0550 => zone_management::get_command_name(cmd_id),
553        0x0551 => camera_av_stream_management::get_command_name(cmd_id),
554        0x0552 => camera_av_settings_user_level_management::get_command_name(cmd_id),
555        0x0553 => web_rtc_provider::get_command_name(cmd_id),
556        0x0554 => web_rtc_requestor::get_command_name(cmd_id),
557        0x0555 => push_av_stream_transport::get_command_name(cmd_id),
558        0x0556 => chime::get_command_name(cmd_id),
559        0x0700 => commodity_tariff::get_command_name(cmd_id),
560        0x0751 => commissioner_control_cluster::get_command_name(cmd_id),
561        0x0752 => joint_fabric_datastore_cluster::get_command_name(cmd_id),
562        0x0753 => joint_fabric_administrator_cluster::get_command_name(cmd_id),
563        0x0801 => tls_certificate_management::get_command_name(cmd_id),
564        0x0802 => tls_client_management::get_command_name(cmd_id),
565        _ => None,
566    }
567}
568
569pub fn get_command_schema(cluster_id: u32, cmd_id: u32) -> Option<Vec<CommandField>> {
570    match cluster_id {
571        0x0000 => alarm_base::get_command_schema(cmd_id),
572        0x0003 => identify::get_command_schema(cmd_id),
573        0x0004 => groups::get_command_schema(cmd_id),
574        0x0006 => on_off::get_command_schema(cmd_id),
575        0x0008 => level_control::get_command_schema(cmd_id),
576        0x001F => acl_cluster::get_command_schema(cmd_id),
577        0x0025 => actions_cluster::get_command_schema(cmd_id),
578        0x0029 => ota_provider::get_command_schema(cmd_id),
579        0x002A => ota_requestor::get_command_schema(cmd_id),
580        0x0030 => general_commissioning_cluster::get_command_schema(cmd_id),
581        0x0031 => network_commissioning_cluster::get_command_schema(cmd_id),
582        0x0032 => diagnostic_logs_cluster::get_command_schema(cmd_id),
583        0x0033 => diagnostics_general::get_command_schema(cmd_id),
584        0x0034 => diagnostics_software::get_command_schema(cmd_id),
585        0x0035 => diagnostics_thread::get_command_schema(cmd_id),
586        0x0036 => diagnostics_wifi::get_command_schema(cmd_id),
587        0x0037 => diagnostics_ethernet::get_command_schema(cmd_id),
588        0x0038 => time_sync::get_command_schema(cmd_id),
589        0x0039 => bridged_device_basic_information_cluster::get_command_schema(cmd_id),
590        0x003C => admin_commissioning_cluster::get_command_schema(cmd_id),
591        0x003E => operational_credential_cluster::get_command_schema(cmd_id),
592        0x003F => group_key_management_cluster::get_command_schema(cmd_id),
593        0x0046 => icd_management::get_command_schema(cmd_id),
594        0x0048 => operational_state_oven::get_command_schema(cmd_id),
595        0x0050 => mode_select::get_command_schema(cmd_id),
596        0x0056 => temperature_control::get_command_schema(cmd_id),
597        0x0057 => refrigerator_alarm::get_command_schema(cmd_id),
598        0x005C => smoke_co_alarm::get_command_schema(cmd_id),
599        0x005E => mode_microwave_oven::get_command_schema(cmd_id),
600        0x005F => microwave_oven_control::get_command_schema(cmd_id),
601        0x0060 => operational_state::get_command_schema(cmd_id),
602        0x0061 => operational_state_rvc::get_command_schema(cmd_id),
603        0x0062 => scenes::get_command_schema(cmd_id),
604        0x0064 => temperature_alarm::get_command_schema(cmd_id),
605        0x0065 => groupcast::get_command_schema(cmd_id),
606        0x0080 => boolean_state_configuration::get_command_schema(cmd_id),
607        0x0081 => valve_configuration_control::get_command_schema(cmd_id),
608        0x0094 => water_heater_management::get_command_schema(cmd_id),
609        0x0095 => commodity_price::get_command_schema(cmd_id),
610        0x0097 => messages::get_command_schema(cmd_id),
611        0x0098 => device_energy_management::get_command_schema(cmd_id),
612        0x0099 => energy_evse::get_command_schema(cmd_id),
613        0x0101 => door_lock::get_command_schema(cmd_id),
614        0x0102 => window_covering::get_command_schema(cmd_id),
615        0x0104 => closure_control::get_command_schema(cmd_id),
616        0x0105 => closure_dimension::get_command_schema(cmd_id),
617        0x0150 => service_area::get_command_schema(cmd_id),
618        0x0201 => thermostat::get_command_schema(cmd_id),
619        0x0202 => fan_control::get_command_schema(cmd_id),
620        0x0300 => color_control::get_command_schema(cmd_id),
621        0x0450 => network_identity_management::get_command_schema(cmd_id),
622        0x0451 => wifi_network_management::get_command_schema(cmd_id),
623        0x0452 => thread_border_router_management::get_command_schema(cmd_id),
624        0x0453 => thread_network_directory::get_command_schema(cmd_id),
625        0x0504 => channel::get_command_schema(cmd_id),
626        0x0505 => target_navigator::get_command_schema(cmd_id),
627        0x0506 => media_playback::get_command_schema(cmd_id),
628        0x0507 => media_input::get_command_schema(cmd_id),
629        0x0508 => low_power::get_command_schema(cmd_id),
630        0x0509 => keypad_input::get_command_schema(cmd_id),
631        0x050A => content_launcher::get_command_schema(cmd_id),
632        0x050B => audio_output::get_command_schema(cmd_id),
633        0x050C => application_launcher::get_command_schema(cmd_id),
634        0x050E => account_login::get_command_schema(cmd_id),
635        0x050F => content_control::get_command_schema(cmd_id),
636        0x0510 => content_app_observer::get_command_schema(cmd_id),
637        0x0550 => zone_management::get_command_schema(cmd_id),
638        0x0551 => camera_av_stream_management::get_command_schema(cmd_id),
639        0x0552 => camera_av_settings_user_level_management::get_command_schema(cmd_id),
640        0x0553 => web_rtc_provider::get_command_schema(cmd_id),
641        0x0554 => web_rtc_requestor::get_command_schema(cmd_id),
642        0x0555 => push_av_stream_transport::get_command_schema(cmd_id),
643        0x0556 => chime::get_command_schema(cmd_id),
644        0x0700 => commodity_tariff::get_command_schema(cmd_id),
645        0x0751 => commissioner_control_cluster::get_command_schema(cmd_id),
646        0x0752 => joint_fabric_datastore_cluster::get_command_schema(cmd_id),
647        0x0753 => joint_fabric_administrator_cluster::get_command_schema(cmd_id),
648        0x0801 => tls_certificate_management::get_command_schema(cmd_id),
649        0x0802 => tls_client_management::get_command_schema(cmd_id),
650        _ => None,
651    }
652}
653
654pub fn encode_command_json(cluster_id: u32, cmd_id: u32, args: &serde_json::Value) -> anyhow::Result<Vec<u8>> {
655    match cluster_id {
656        0x0000 => alarm_base::encode_command_json(cmd_id, args),
657        0x0003 => identify::encode_command_json(cmd_id, args),
658        0x0004 => groups::encode_command_json(cmd_id, args),
659        0x0006 => on_off::encode_command_json(cmd_id, args),
660        0x0008 => level_control::encode_command_json(cmd_id, args),
661        0x001F => acl_cluster::encode_command_json(cmd_id, args),
662        0x0025 => actions_cluster::encode_command_json(cmd_id, args),
663        0x0029 => ota_provider::encode_command_json(cmd_id, args),
664        0x002A => ota_requestor::encode_command_json(cmd_id, args),
665        0x0030 => general_commissioning_cluster::encode_command_json(cmd_id, args),
666        0x0031 => network_commissioning_cluster::encode_command_json(cmd_id, args),
667        0x0032 => diagnostic_logs_cluster::encode_command_json(cmd_id, args),
668        0x0033 => diagnostics_general::encode_command_json(cmd_id, args),
669        0x0034 => diagnostics_software::encode_command_json(cmd_id, args),
670        0x0035 => diagnostics_thread::encode_command_json(cmd_id, args),
671        0x0036 => diagnostics_wifi::encode_command_json(cmd_id, args),
672        0x0037 => diagnostics_ethernet::encode_command_json(cmd_id, args),
673        0x0038 => time_sync::encode_command_json(cmd_id, args),
674        0x0039 => bridged_device_basic_information_cluster::encode_command_json(cmd_id, args),
675        0x003C => admin_commissioning_cluster::encode_command_json(cmd_id, args),
676        0x003E => operational_credential_cluster::encode_command_json(cmd_id, args),
677        0x003F => group_key_management_cluster::encode_command_json(cmd_id, args),
678        0x0046 => icd_management::encode_command_json(cmd_id, args),
679        0x0048 => operational_state_oven::encode_command_json(cmd_id, args),
680        0x0050 => mode_select::encode_command_json(cmd_id, args),
681        0x0056 => temperature_control::encode_command_json(cmd_id, args),
682        0x0057 => refrigerator_alarm::encode_command_json(cmd_id, args),
683        0x005C => smoke_co_alarm::encode_command_json(cmd_id, args),
684        0x005E => mode_microwave_oven::encode_command_json(cmd_id, args),
685        0x005F => microwave_oven_control::encode_command_json(cmd_id, args),
686        0x0060 => operational_state::encode_command_json(cmd_id, args),
687        0x0061 => operational_state_rvc::encode_command_json(cmd_id, args),
688        0x0062 => scenes::encode_command_json(cmd_id, args),
689        0x0064 => temperature_alarm::encode_command_json(cmd_id, args),
690        0x0065 => groupcast::encode_command_json(cmd_id, args),
691        0x0080 => boolean_state_configuration::encode_command_json(cmd_id, args),
692        0x0081 => valve_configuration_control::encode_command_json(cmd_id, args),
693        0x0094 => water_heater_management::encode_command_json(cmd_id, args),
694        0x0095 => commodity_price::encode_command_json(cmd_id, args),
695        0x0097 => messages::encode_command_json(cmd_id, args),
696        0x0098 => device_energy_management::encode_command_json(cmd_id, args),
697        0x0099 => energy_evse::encode_command_json(cmd_id, args),
698        0x0101 => door_lock::encode_command_json(cmd_id, args),
699        0x0102 => window_covering::encode_command_json(cmd_id, args),
700        0x0104 => closure_control::encode_command_json(cmd_id, args),
701        0x0105 => closure_dimension::encode_command_json(cmd_id, args),
702        0x0150 => service_area::encode_command_json(cmd_id, args),
703        0x0201 => thermostat::encode_command_json(cmd_id, args),
704        0x0202 => fan_control::encode_command_json(cmd_id, args),
705        0x0300 => color_control::encode_command_json(cmd_id, args),
706        0x0450 => network_identity_management::encode_command_json(cmd_id, args),
707        0x0451 => wifi_network_management::encode_command_json(cmd_id, args),
708        0x0452 => thread_border_router_management::encode_command_json(cmd_id, args),
709        0x0453 => thread_network_directory::encode_command_json(cmd_id, args),
710        0x0504 => channel::encode_command_json(cmd_id, args),
711        0x0505 => target_navigator::encode_command_json(cmd_id, args),
712        0x0506 => media_playback::encode_command_json(cmd_id, args),
713        0x0507 => media_input::encode_command_json(cmd_id, args),
714        0x0508 => low_power::encode_command_json(cmd_id, args),
715        0x0509 => keypad_input::encode_command_json(cmd_id, args),
716        0x050A => content_launcher::encode_command_json(cmd_id, args),
717        0x050B => audio_output::encode_command_json(cmd_id, args),
718        0x050C => application_launcher::encode_command_json(cmd_id, args),
719        0x050E => account_login::encode_command_json(cmd_id, args),
720        0x050F => content_control::encode_command_json(cmd_id, args),
721        0x0510 => content_app_observer::encode_command_json(cmd_id, args),
722        0x0550 => zone_management::encode_command_json(cmd_id, args),
723        0x0551 => camera_av_stream_management::encode_command_json(cmd_id, args),
724        0x0552 => camera_av_settings_user_level_management::encode_command_json(cmd_id, args),
725        0x0553 => web_rtc_provider::encode_command_json(cmd_id, args),
726        0x0554 => web_rtc_requestor::encode_command_json(cmd_id, args),
727        0x0555 => push_av_stream_transport::encode_command_json(cmd_id, args),
728        0x0556 => chime::encode_command_json(cmd_id, args),
729        0x0700 => commodity_tariff::encode_command_json(cmd_id, args),
730        0x0751 => commissioner_control_cluster::encode_command_json(cmd_id, args),
731        0x0752 => joint_fabric_datastore_cluster::encode_command_json(cmd_id, args),
732        0x0753 => joint_fabric_administrator_cluster::encode_command_json(cmd_id, args),
733        0x0801 => tls_certificate_management::encode_command_json(cmd_id, args),
734        0x0802 => tls_client_management::encode_command_json(cmd_id, args),
735        _ => Err(anyhow::anyhow!("unsupported cluster: 0x{:04X}", cluster_id)),
736    }
737}
738
739
740/// Main dispatcher for decoding event TLV values to JSON strings
741pub fn decode_event_json(cluster_id: u32, event_id: u32, tlv_value: &crate::tlv::TlvItemValue) -> String {
742    match cluster_id {
743        0x0000 => alarm_base::decode_event_json(cluster_id, event_id, tlv_value),
744        0x001F => acl_cluster::decode_event_json(cluster_id, event_id, tlv_value),
745        0x0025 => actions_cluster::decode_event_json(cluster_id, event_id, tlv_value),
746        0x0028 => basic_information_cluster::decode_event_json(cluster_id, event_id, tlv_value),
747        0x002A => ota_requestor::decode_event_json(cluster_id, event_id, tlv_value),
748        0x002F => power_source_cluster::decode_event_json(cluster_id, event_id, tlv_value),
749        0x0033 => diagnostics_general::decode_event_json(cluster_id, event_id, tlv_value),
750        0x0034 => diagnostics_software::decode_event_json(cluster_id, event_id, tlv_value),
751        0x0035 => diagnostics_thread::decode_event_json(cluster_id, event_id, tlv_value),
752        0x0036 => diagnostics_wifi::decode_event_json(cluster_id, event_id, tlv_value),
753        0x0038 => time_sync::decode_event_json(cluster_id, event_id, tlv_value),
754        0x0039 => bridged_device_basic_information_cluster::decode_event_json(cluster_id, event_id, tlv_value),
755        0x003B => switch::decode_event_json(cluster_id, event_id, tlv_value),
756        0x0045 => boolean_state::decode_event_json(cluster_id, event_id, tlv_value),
757        0x005C => smoke_co_alarm::decode_event_json(cluster_id, event_id, tlv_value),
758        0x0060 => operational_state::decode_event_json(cluster_id, event_id, tlv_value),
759        0x0065 => groupcast::decode_event_json(cluster_id, event_id, tlv_value),
760        0x0080 => boolean_state_configuration::decode_event_json(cluster_id, event_id, tlv_value),
761        0x0081 => valve_configuration_control::decode_event_json(cluster_id, event_id, tlv_value),
762        0x0090 => electrical_power_measurement::decode_event_json(cluster_id, event_id, tlv_value),
763        0x0091 => electrical_energy_measurement::decode_event_json(cluster_id, event_id, tlv_value),
764        0x0094 => water_heater_management::decode_event_json(cluster_id, event_id, tlv_value),
765        0x0095 => commodity_price::decode_event_json(cluster_id, event_id, tlv_value),
766        0x0097 => messages::decode_event_json(cluster_id, event_id, tlv_value),
767        0x0098 => device_energy_management::decode_event_json(cluster_id, event_id, tlv_value),
768        0x0099 => energy_evse::decode_event_json(cluster_id, event_id, tlv_value),
769        0x00A0 => electrical_grid_conditions::decode_event_json(cluster_id, event_id, tlv_value),
770        0x0101 => door_lock::decode_event_json(cluster_id, event_id, tlv_value),
771        0x0104 => closure_control::decode_event_json(cluster_id, event_id, tlv_value),
772        0x0200 => pump_configuration_control::decode_event_json(cluster_id, event_id, tlv_value),
773        0x0201 => thermostat::decode_event_json(cluster_id, event_id, tlv_value),
774        0x0406 => occupancy_sensing::decode_event_json(cluster_id, event_id, tlv_value),
775        0x0505 => target_navigator::decode_event_json(cluster_id, event_id, tlv_value),
776        0x0506 => media_playback::decode_event_json(cluster_id, event_id, tlv_value),
777        0x050E => account_login::decode_event_json(cluster_id, event_id, tlv_value),
778        0x050F => content_control::decode_event_json(cluster_id, event_id, tlv_value),
779        0x0550 => zone_management::decode_event_json(cluster_id, event_id, tlv_value),
780        0x0555 => push_av_stream_transport::decode_event_json(cluster_id, event_id, tlv_value),
781        0x0556 => chime::decode_event_json(cluster_id, event_id, tlv_value),
782        0x0751 => commissioner_control_cluster::decode_event_json(cluster_id, event_id, tlv_value),
783        _ => format!("{{\"error\": \"Unsupported cluster ID: {}\"}}", cluster_id),
784    }
785}
786
787/// Main dispatcher for getting event lists by cluster ID
788pub fn get_event_list(cluster_id: u32) -> Vec<(u32, &'static str)> {
789    match cluster_id {
790        0x0000 => alarm_base::get_event_list(),
791        0x001F => acl_cluster::get_event_list(),
792        0x0025 => actions_cluster::get_event_list(),
793        0x0028 => basic_information_cluster::get_event_list(),
794        0x002A => ota_requestor::get_event_list(),
795        0x002F => power_source_cluster::get_event_list(),
796        0x0033 => diagnostics_general::get_event_list(),
797        0x0034 => diagnostics_software::get_event_list(),
798        0x0035 => diagnostics_thread::get_event_list(),
799        0x0036 => diagnostics_wifi::get_event_list(),
800        0x0038 => time_sync::get_event_list(),
801        0x0039 => bridged_device_basic_information_cluster::get_event_list(),
802        0x003B => switch::get_event_list(),
803        0x0045 => boolean_state::get_event_list(),
804        0x005C => smoke_co_alarm::get_event_list(),
805        0x0060 => operational_state::get_event_list(),
806        0x0065 => groupcast::get_event_list(),
807        0x0080 => boolean_state_configuration::get_event_list(),
808        0x0081 => valve_configuration_control::get_event_list(),
809        0x0090 => electrical_power_measurement::get_event_list(),
810        0x0091 => electrical_energy_measurement::get_event_list(),
811        0x0094 => water_heater_management::get_event_list(),
812        0x0095 => commodity_price::get_event_list(),
813        0x0097 => messages::get_event_list(),
814        0x0098 => device_energy_management::get_event_list(),
815        0x0099 => energy_evse::get_event_list(),
816        0x00A0 => electrical_grid_conditions::get_event_list(),
817        0x0101 => door_lock::get_event_list(),
818        0x0104 => closure_control::get_event_list(),
819        0x0200 => pump_configuration_control::get_event_list(),
820        0x0201 => thermostat::get_event_list(),
821        0x0406 => occupancy_sensing::get_event_list(),
822        0x0505 => target_navigator::get_event_list(),
823        0x0506 => media_playback::get_event_list(),
824        0x050E => account_login::get_event_list(),
825        0x050F => content_control::get_event_list(),
826        0x0550 => zone_management::get_event_list(),
827        0x0555 => push_av_stream_transport::get_event_list(),
828        0x0556 => chime::get_event_list(),
829        0x0751 => commissioner_control_cluster::get_event_list(),
830        _ => vec![],
831    }
832}