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