pub mod schema;
pub mod json_util;
pub use schema::{CommandField, FieldKind};
pub mod account_login;
pub mod acl_cluster;
pub mod actions_cluster;
pub mod admin_commissioning_cluster;
pub mod air_quality;
pub mod alarm_base;
pub mod application_basic;
pub mod application_launcher;
pub mod audio_output;
pub mod basic_information_cluster;
pub mod binding_cluster;
pub mod boolean_state;
pub mod boolean_state_configuration;
pub mod bridged_device_basic_information_cluster;
pub mod camera_av_settings_user_level_management;
pub mod camera_av_stream_management;
pub mod channel;
pub mod chime;
pub mod closure_control;
pub mod closure_dimension;
pub mod color_control;
pub mod commissioner_control_cluster;
pub mod commodity_metering;
pub mod commodity_price;
pub mod commodity_tariff;
pub mod concentration_measurement;
pub mod content_app_observer;
pub mod content_control;
pub mod content_launcher;
pub mod descriptor_cluster;
pub mod device_energy_management;
pub mod diagnostic_logs_cluster;
pub mod diagnostics_ethernet;
pub mod diagnostics_general;
pub mod diagnostics_software;
pub mod diagnostics_thread;
pub mod diagnostics_wifi;
pub mod dishwasher_alarm;
pub mod door_lock;
pub mod ecosystem_information_cluster;
pub mod electrical_energy_measurement;
pub mod electrical_grid_conditions;
pub mod electrical_power_measurement;
pub mod energy_evse;
pub mod energy_preference;
pub mod fan_control;
pub mod fixed_label_cluster;
pub mod flow_measurement;
pub mod general_commissioning_cluster;
pub mod group_key_management_cluster;
pub mod groups;
pub mod icd_management;
pub mod identify;
pub mod illuminance_measurement;
pub mod joint_fabric_administrator_cluster;
pub mod joint_fabric_datastore_cluster;
pub mod keypad_input;
pub mod label_cluster;
pub mod laundry_dryer_controls;
pub mod laundry_washer_controls;
pub mod level_control;
pub mod localization_configuration;
pub mod localization_time_format;
pub mod localization_unit;
pub mod low_power;
pub mod media_input;
pub mod media_playback;
pub mod messages;
pub mod meter_identification;
pub mod microwave_oven_control;
pub mod mode_base;
pub mod mode_device_energy_management;
pub mod mode_dishwasher;
pub mod mode_evse;
pub mod mode_laundry_washer;
pub mod mode_microwave_oven;
pub mod mode_oven;
pub mod mode_refrigerator;
pub mod mode_rvc_clean;
pub mod mode_rvc_run;
pub mod mode_select;
pub mod mode_water_heater;
pub mod network_commissioning_cluster;
pub mod occupancy_sensing;
pub mod on_off;
pub mod operational_credential_cluster;
pub mod operational_state;
pub mod operational_state_oven;
pub mod operational_state_rvc;
pub mod ota_provider;
pub mod ota_requestor;
pub mod power_source_cluster;
pub mod power_source_configuration_cluster;
pub mod power_topology;
pub mod pressure_measurement;
pub mod pump_configuration_control;
pub mod push_av_stream_transport;
pub mod refrigerator_alarm;
pub mod resource_monitoring;
pub mod scenes;
pub mod service_area;
pub mod smoke_co_alarm;
pub mod soil_measurement;
pub mod switch;
pub mod target_navigator;
pub mod temperature_control;
pub mod temperature_measurement;
pub mod thermostat;
pub mod thermostat_user_interface_configuration;
pub mod thread_border_router_management;
pub mod thread_network_directory;
pub mod time_sync;
pub mod tls_certificate_management;
pub mod tls_client_management;
pub mod user_label_cluster;
pub mod valve_configuration_control;
pub mod wake_on_lan;
pub mod water_content_measurement;
pub mod water_heater_management;
pub mod web_rtc_provider;
pub mod web_rtc_requestor;
pub mod wifi_network_management;
pub mod window_covering;
pub mod zone_management;
pub fn decode_attribute_json(cluster_id: u32, attribute_id: u32, tlv_value: &crate::tlv::TlvItemValue) -> String {
match cluster_id {
0x0000 => alarm_base::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0003 => identify::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0004 => groups::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0006 => on_off::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0008 => level_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x001D => descriptor_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x001E => binding_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x001F => acl_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0025 => actions_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0028 => basic_information_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x002A => ota_requestor::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x002B => localization_configuration::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x002C => localization_time_format::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x002D => localization_unit::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x002E => power_source_configuration_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x002F => power_source_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0030 => general_commissioning_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0031 => network_commissioning_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0033 => diagnostics_general::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0034 => diagnostics_software::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0035 => diagnostics_thread::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0036 => diagnostics_wifi::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0037 => diagnostics_ethernet::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0038 => time_sync::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0039 => bridged_device_basic_information_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x003B => switch::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x003C => admin_commissioning_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x003E => operational_credential_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x003F => group_key_management_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0040 => fixed_label_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0041 => user_label_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0045 => boolean_state::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0046 => icd_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0049 => mode_oven::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x004A => laundry_dryer_controls::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0050 => mode_select::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0051 => mode_laundry_washer::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0052 => mode_refrigerator::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0053 => laundry_washer_controls::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0054 => mode_rvc_run::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0055 => mode_rvc_clean::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0056 => temperature_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0059 => mode_dishwasher::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x005B => air_quality::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x005C => smoke_co_alarm::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x005E => mode_microwave_oven::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x005F => microwave_oven_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0060 => operational_state::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0062 => scenes::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0080 => boolean_state_configuration::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0081 => valve_configuration_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0090 => electrical_power_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0091 => electrical_energy_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0094 => water_heater_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0095 => commodity_price::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0097 => messages::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0098 => device_energy_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0099 => energy_evse::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x009B => energy_preference::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x009C => power_topology::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x009D => mode_evse::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x009E => mode_water_heater::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x009F => mode_device_energy_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x00A0 => electrical_grid_conditions::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0101 => door_lock::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0102 => window_covering::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0104 => closure_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0105 => closure_dimension::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0150 => service_area::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0200 => pump_configuration_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0201 => thermostat::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0202 => fan_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0204 => thermostat_user_interface_configuration::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0300 => color_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0400 => illuminance_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0402 => temperature_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0403 => pressure_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0404 => flow_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0406 => occupancy_sensing::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0430 => soil_measurement::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0451 => wifi_network_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0452 => thread_border_router_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0453 => thread_network_directory::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0503 => wake_on_lan::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0504 => channel::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0505 => target_navigator::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0506 => media_playback::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0507 => media_input::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x050A => content_launcher::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x050B => audio_output::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x050C => application_launcher::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x050D => application_basic::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x050F => content_control::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0550 => zone_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0551 => camera_av_stream_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0552 => camera_av_settings_user_level_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0553 => web_rtc_provider::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0554 => web_rtc_requestor::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0555 => push_av_stream_transport::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0556 => chime::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0700 => commodity_tariff::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0750 => ecosystem_information_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0751 => commissioner_control_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0752 => joint_fabric_datastore_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0753 => joint_fabric_administrator_cluster::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0801 => tls_certificate_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0802 => tls_client_management::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0B06 => meter_identification::decode_attribute_json(cluster_id, attribute_id, tlv_value),
0x0B07 => commodity_metering::decode_attribute_json(cluster_id, attribute_id, tlv_value),
_ => format!("{{\"error\": \"Unsupported cluster ID: {}\"}}", cluster_id),
}
}
pub fn get_attribute_list(cluster_id: u32) -> Vec<(u32, &'static str)> {
match cluster_id {
0x0000 => alarm_base::get_attribute_list(),
0x0003 => identify::get_attribute_list(),
0x0004 => groups::get_attribute_list(),
0x0006 => on_off::get_attribute_list(),
0x0008 => level_control::get_attribute_list(),
0x001D => descriptor_cluster::get_attribute_list(),
0x001E => binding_cluster::get_attribute_list(),
0x001F => acl_cluster::get_attribute_list(),
0x0025 => actions_cluster::get_attribute_list(),
0x0028 => basic_information_cluster::get_attribute_list(),
0x002A => ota_requestor::get_attribute_list(),
0x002B => localization_configuration::get_attribute_list(),
0x002C => localization_time_format::get_attribute_list(),
0x002D => localization_unit::get_attribute_list(),
0x002E => power_source_configuration_cluster::get_attribute_list(),
0x002F => power_source_cluster::get_attribute_list(),
0x0030 => general_commissioning_cluster::get_attribute_list(),
0x0031 => network_commissioning_cluster::get_attribute_list(),
0x0033 => diagnostics_general::get_attribute_list(),
0x0034 => diagnostics_software::get_attribute_list(),
0x0035 => diagnostics_thread::get_attribute_list(),
0x0036 => diagnostics_wifi::get_attribute_list(),
0x0037 => diagnostics_ethernet::get_attribute_list(),
0x0038 => time_sync::get_attribute_list(),
0x0039 => bridged_device_basic_information_cluster::get_attribute_list(),
0x003B => switch::get_attribute_list(),
0x003C => admin_commissioning_cluster::get_attribute_list(),
0x003E => operational_credential_cluster::get_attribute_list(),
0x003F => group_key_management_cluster::get_attribute_list(),
0x0040 => fixed_label_cluster::get_attribute_list(),
0x0041 => user_label_cluster::get_attribute_list(),
0x0045 => boolean_state::get_attribute_list(),
0x0046 => icd_management::get_attribute_list(),
0x0049 => mode_oven::get_attribute_list(),
0x004A => laundry_dryer_controls::get_attribute_list(),
0x0050 => mode_select::get_attribute_list(),
0x0051 => mode_laundry_washer::get_attribute_list(),
0x0052 => mode_refrigerator::get_attribute_list(),
0x0053 => laundry_washer_controls::get_attribute_list(),
0x0054 => mode_rvc_run::get_attribute_list(),
0x0055 => mode_rvc_clean::get_attribute_list(),
0x0056 => temperature_control::get_attribute_list(),
0x0059 => mode_dishwasher::get_attribute_list(),
0x005B => air_quality::get_attribute_list(),
0x005C => smoke_co_alarm::get_attribute_list(),
0x005E => mode_microwave_oven::get_attribute_list(),
0x005F => microwave_oven_control::get_attribute_list(),
0x0060 => operational_state::get_attribute_list(),
0x0062 => scenes::get_attribute_list(),
0x0080 => boolean_state_configuration::get_attribute_list(),
0x0081 => valve_configuration_control::get_attribute_list(),
0x0090 => electrical_power_measurement::get_attribute_list(),
0x0091 => electrical_energy_measurement::get_attribute_list(),
0x0094 => water_heater_management::get_attribute_list(),
0x0095 => commodity_price::get_attribute_list(),
0x0097 => messages::get_attribute_list(),
0x0098 => device_energy_management::get_attribute_list(),
0x0099 => energy_evse::get_attribute_list(),
0x009B => energy_preference::get_attribute_list(),
0x009C => power_topology::get_attribute_list(),
0x009D => mode_evse::get_attribute_list(),
0x009E => mode_water_heater::get_attribute_list(),
0x009F => mode_device_energy_management::get_attribute_list(),
0x00A0 => electrical_grid_conditions::get_attribute_list(),
0x0101 => door_lock::get_attribute_list(),
0x0102 => window_covering::get_attribute_list(),
0x0104 => closure_control::get_attribute_list(),
0x0105 => closure_dimension::get_attribute_list(),
0x0150 => service_area::get_attribute_list(),
0x0200 => pump_configuration_control::get_attribute_list(),
0x0201 => thermostat::get_attribute_list(),
0x0202 => fan_control::get_attribute_list(),
0x0204 => thermostat_user_interface_configuration::get_attribute_list(),
0x0300 => color_control::get_attribute_list(),
0x0400 => illuminance_measurement::get_attribute_list(),
0x0402 => temperature_measurement::get_attribute_list(),
0x0403 => pressure_measurement::get_attribute_list(),
0x0404 => flow_measurement::get_attribute_list(),
0x0406 => occupancy_sensing::get_attribute_list(),
0x0430 => soil_measurement::get_attribute_list(),
0x0451 => wifi_network_management::get_attribute_list(),
0x0452 => thread_border_router_management::get_attribute_list(),
0x0453 => thread_network_directory::get_attribute_list(),
0x0503 => wake_on_lan::get_attribute_list(),
0x0504 => channel::get_attribute_list(),
0x0505 => target_navigator::get_attribute_list(),
0x0506 => media_playback::get_attribute_list(),
0x0507 => media_input::get_attribute_list(),
0x050A => content_launcher::get_attribute_list(),
0x050B => audio_output::get_attribute_list(),
0x050C => application_launcher::get_attribute_list(),
0x050D => application_basic::get_attribute_list(),
0x050F => content_control::get_attribute_list(),
0x0550 => zone_management::get_attribute_list(),
0x0551 => camera_av_stream_management::get_attribute_list(),
0x0552 => camera_av_settings_user_level_management::get_attribute_list(),
0x0553 => web_rtc_provider::get_attribute_list(),
0x0554 => web_rtc_requestor::get_attribute_list(),
0x0555 => push_av_stream_transport::get_attribute_list(),
0x0556 => chime::get_attribute_list(),
0x0700 => commodity_tariff::get_attribute_list(),
0x0750 => ecosystem_information_cluster::get_attribute_list(),
0x0751 => commissioner_control_cluster::get_attribute_list(),
0x0752 => joint_fabric_datastore_cluster::get_attribute_list(),
0x0753 => joint_fabric_administrator_cluster::get_attribute_list(),
0x0801 => tls_certificate_management::get_attribute_list(),
0x0802 => tls_client_management::get_attribute_list(),
0x0B06 => meter_identification::get_attribute_list(),
0x0B07 => commodity_metering::get_attribute_list(),
_ => vec![],
}
}
pub fn get_command_list(cluster_id: u32) -> Vec<(u32, &'static str)> {
match cluster_id {
0x0000 => alarm_base::get_command_list(),
0x0003 => identify::get_command_list(),
0x0004 => groups::get_command_list(),
0x0006 => on_off::get_command_list(),
0x0008 => level_control::get_command_list(),
0x001F => acl_cluster::get_command_list(),
0x0025 => actions_cluster::get_command_list(),
0x0029 => ota_provider::get_command_list(),
0x002A => ota_requestor::get_command_list(),
0x0030 => general_commissioning_cluster::get_command_list(),
0x0031 => network_commissioning_cluster::get_command_list(),
0x0032 => diagnostic_logs_cluster::get_command_list(),
0x0033 => diagnostics_general::get_command_list(),
0x0034 => diagnostics_software::get_command_list(),
0x0035 => diagnostics_thread::get_command_list(),
0x0036 => diagnostics_wifi::get_command_list(),
0x0037 => diagnostics_ethernet::get_command_list(),
0x0038 => time_sync::get_command_list(),
0x0039 => bridged_device_basic_information_cluster::get_command_list(),
0x003C => admin_commissioning_cluster::get_command_list(),
0x003E => operational_credential_cluster::get_command_list(),
0x003F => group_key_management_cluster::get_command_list(),
0x0046 => icd_management::get_command_list(),
0x0048 => operational_state_oven::get_command_list(),
0x0050 => mode_select::get_command_list(),
0x0056 => temperature_control::get_command_list(),
0x0057 => refrigerator_alarm::get_command_list(),
0x005C => smoke_co_alarm::get_command_list(),
0x005E => mode_microwave_oven::get_command_list(),
0x005F => microwave_oven_control::get_command_list(),
0x0060 => operational_state::get_command_list(),
0x0061 => operational_state_rvc::get_command_list(),
0x0062 => scenes::get_command_list(),
0x0080 => boolean_state_configuration::get_command_list(),
0x0081 => valve_configuration_control::get_command_list(),
0x0094 => water_heater_management::get_command_list(),
0x0095 => commodity_price::get_command_list(),
0x0097 => messages::get_command_list(),
0x0098 => device_energy_management::get_command_list(),
0x0099 => energy_evse::get_command_list(),
0x0101 => door_lock::get_command_list(),
0x0102 => window_covering::get_command_list(),
0x0104 => closure_control::get_command_list(),
0x0105 => closure_dimension::get_command_list(),
0x0150 => service_area::get_command_list(),
0x0201 => thermostat::get_command_list(),
0x0202 => fan_control::get_command_list(),
0x0300 => color_control::get_command_list(),
0x0451 => wifi_network_management::get_command_list(),
0x0452 => thread_border_router_management::get_command_list(),
0x0453 => thread_network_directory::get_command_list(),
0x0504 => channel::get_command_list(),
0x0505 => target_navigator::get_command_list(),
0x0506 => media_playback::get_command_list(),
0x0507 => media_input::get_command_list(),
0x0508 => low_power::get_command_list(),
0x0509 => keypad_input::get_command_list(),
0x050A => content_launcher::get_command_list(),
0x050B => audio_output::get_command_list(),
0x050C => application_launcher::get_command_list(),
0x050E => account_login::get_command_list(),
0x050F => content_control::get_command_list(),
0x0510 => content_app_observer::get_command_list(),
0x0550 => zone_management::get_command_list(),
0x0551 => camera_av_stream_management::get_command_list(),
0x0552 => camera_av_settings_user_level_management::get_command_list(),
0x0553 => web_rtc_provider::get_command_list(),
0x0554 => web_rtc_requestor::get_command_list(),
0x0555 => push_av_stream_transport::get_command_list(),
0x0556 => chime::get_command_list(),
0x0700 => commodity_tariff::get_command_list(),
0x0751 => commissioner_control_cluster::get_command_list(),
0x0752 => joint_fabric_datastore_cluster::get_command_list(),
0x0753 => joint_fabric_administrator_cluster::get_command_list(),
0x0801 => tls_certificate_management::get_command_list(),
0x0802 => tls_client_management::get_command_list(),
_ => vec![],
}
}
pub fn get_command_name(cluster_id: u32, cmd_id: u32) -> Option<&'static str> {
match cluster_id {
0x0000 => alarm_base::get_command_name(cmd_id),
0x0003 => identify::get_command_name(cmd_id),
0x0004 => groups::get_command_name(cmd_id),
0x0006 => on_off::get_command_name(cmd_id),
0x0008 => level_control::get_command_name(cmd_id),
0x001F => acl_cluster::get_command_name(cmd_id),
0x0025 => actions_cluster::get_command_name(cmd_id),
0x0029 => ota_provider::get_command_name(cmd_id),
0x002A => ota_requestor::get_command_name(cmd_id),
0x0030 => general_commissioning_cluster::get_command_name(cmd_id),
0x0031 => network_commissioning_cluster::get_command_name(cmd_id),
0x0032 => diagnostic_logs_cluster::get_command_name(cmd_id),
0x0033 => diagnostics_general::get_command_name(cmd_id),
0x0034 => diagnostics_software::get_command_name(cmd_id),
0x0035 => diagnostics_thread::get_command_name(cmd_id),
0x0036 => diagnostics_wifi::get_command_name(cmd_id),
0x0037 => diagnostics_ethernet::get_command_name(cmd_id),
0x0038 => time_sync::get_command_name(cmd_id),
0x0039 => bridged_device_basic_information_cluster::get_command_name(cmd_id),
0x003C => admin_commissioning_cluster::get_command_name(cmd_id),
0x003E => operational_credential_cluster::get_command_name(cmd_id),
0x003F => group_key_management_cluster::get_command_name(cmd_id),
0x0046 => icd_management::get_command_name(cmd_id),
0x0048 => operational_state_oven::get_command_name(cmd_id),
0x0050 => mode_select::get_command_name(cmd_id),
0x0056 => temperature_control::get_command_name(cmd_id),
0x0057 => refrigerator_alarm::get_command_name(cmd_id),
0x005C => smoke_co_alarm::get_command_name(cmd_id),
0x005E => mode_microwave_oven::get_command_name(cmd_id),
0x005F => microwave_oven_control::get_command_name(cmd_id),
0x0060 => operational_state::get_command_name(cmd_id),
0x0061 => operational_state_rvc::get_command_name(cmd_id),
0x0062 => scenes::get_command_name(cmd_id),
0x0080 => boolean_state_configuration::get_command_name(cmd_id),
0x0081 => valve_configuration_control::get_command_name(cmd_id),
0x0094 => water_heater_management::get_command_name(cmd_id),
0x0095 => commodity_price::get_command_name(cmd_id),
0x0097 => messages::get_command_name(cmd_id),
0x0098 => device_energy_management::get_command_name(cmd_id),
0x0099 => energy_evse::get_command_name(cmd_id),
0x0101 => door_lock::get_command_name(cmd_id),
0x0102 => window_covering::get_command_name(cmd_id),
0x0104 => closure_control::get_command_name(cmd_id),
0x0105 => closure_dimension::get_command_name(cmd_id),
0x0150 => service_area::get_command_name(cmd_id),
0x0201 => thermostat::get_command_name(cmd_id),
0x0202 => fan_control::get_command_name(cmd_id),
0x0300 => color_control::get_command_name(cmd_id),
0x0451 => wifi_network_management::get_command_name(cmd_id),
0x0452 => thread_border_router_management::get_command_name(cmd_id),
0x0453 => thread_network_directory::get_command_name(cmd_id),
0x0504 => channel::get_command_name(cmd_id),
0x0505 => target_navigator::get_command_name(cmd_id),
0x0506 => media_playback::get_command_name(cmd_id),
0x0507 => media_input::get_command_name(cmd_id),
0x0508 => low_power::get_command_name(cmd_id),
0x0509 => keypad_input::get_command_name(cmd_id),
0x050A => content_launcher::get_command_name(cmd_id),
0x050B => audio_output::get_command_name(cmd_id),
0x050C => application_launcher::get_command_name(cmd_id),
0x050E => account_login::get_command_name(cmd_id),
0x050F => content_control::get_command_name(cmd_id),
0x0510 => content_app_observer::get_command_name(cmd_id),
0x0550 => zone_management::get_command_name(cmd_id),
0x0551 => camera_av_stream_management::get_command_name(cmd_id),
0x0552 => camera_av_settings_user_level_management::get_command_name(cmd_id),
0x0553 => web_rtc_provider::get_command_name(cmd_id),
0x0554 => web_rtc_requestor::get_command_name(cmd_id),
0x0555 => push_av_stream_transport::get_command_name(cmd_id),
0x0556 => chime::get_command_name(cmd_id),
0x0700 => commodity_tariff::get_command_name(cmd_id),
0x0751 => commissioner_control_cluster::get_command_name(cmd_id),
0x0752 => joint_fabric_datastore_cluster::get_command_name(cmd_id),
0x0753 => joint_fabric_administrator_cluster::get_command_name(cmd_id),
0x0801 => tls_certificate_management::get_command_name(cmd_id),
0x0802 => tls_client_management::get_command_name(cmd_id),
_ => None,
}
}
pub fn get_command_schema(cluster_id: u32, cmd_id: u32) -> Option<Vec<CommandField>> {
match cluster_id {
0x0000 => alarm_base::get_command_schema(cmd_id),
0x0003 => identify::get_command_schema(cmd_id),
0x0004 => groups::get_command_schema(cmd_id),
0x0006 => on_off::get_command_schema(cmd_id),
0x0008 => level_control::get_command_schema(cmd_id),
0x001F => acl_cluster::get_command_schema(cmd_id),
0x0025 => actions_cluster::get_command_schema(cmd_id),
0x0029 => ota_provider::get_command_schema(cmd_id),
0x002A => ota_requestor::get_command_schema(cmd_id),
0x0030 => general_commissioning_cluster::get_command_schema(cmd_id),
0x0031 => network_commissioning_cluster::get_command_schema(cmd_id),
0x0032 => diagnostic_logs_cluster::get_command_schema(cmd_id),
0x0033 => diagnostics_general::get_command_schema(cmd_id),
0x0034 => diagnostics_software::get_command_schema(cmd_id),
0x0035 => diagnostics_thread::get_command_schema(cmd_id),
0x0036 => diagnostics_wifi::get_command_schema(cmd_id),
0x0037 => diagnostics_ethernet::get_command_schema(cmd_id),
0x0038 => time_sync::get_command_schema(cmd_id),
0x0039 => bridged_device_basic_information_cluster::get_command_schema(cmd_id),
0x003C => admin_commissioning_cluster::get_command_schema(cmd_id),
0x003E => operational_credential_cluster::get_command_schema(cmd_id),
0x003F => group_key_management_cluster::get_command_schema(cmd_id),
0x0046 => icd_management::get_command_schema(cmd_id),
0x0048 => operational_state_oven::get_command_schema(cmd_id),
0x0050 => mode_select::get_command_schema(cmd_id),
0x0056 => temperature_control::get_command_schema(cmd_id),
0x0057 => refrigerator_alarm::get_command_schema(cmd_id),
0x005C => smoke_co_alarm::get_command_schema(cmd_id),
0x005E => mode_microwave_oven::get_command_schema(cmd_id),
0x005F => microwave_oven_control::get_command_schema(cmd_id),
0x0060 => operational_state::get_command_schema(cmd_id),
0x0061 => operational_state_rvc::get_command_schema(cmd_id),
0x0062 => scenes::get_command_schema(cmd_id),
0x0080 => boolean_state_configuration::get_command_schema(cmd_id),
0x0081 => valve_configuration_control::get_command_schema(cmd_id),
0x0094 => water_heater_management::get_command_schema(cmd_id),
0x0095 => commodity_price::get_command_schema(cmd_id),
0x0097 => messages::get_command_schema(cmd_id),
0x0098 => device_energy_management::get_command_schema(cmd_id),
0x0099 => energy_evse::get_command_schema(cmd_id),
0x0101 => door_lock::get_command_schema(cmd_id),
0x0102 => window_covering::get_command_schema(cmd_id),
0x0104 => closure_control::get_command_schema(cmd_id),
0x0105 => closure_dimension::get_command_schema(cmd_id),
0x0150 => service_area::get_command_schema(cmd_id),
0x0201 => thermostat::get_command_schema(cmd_id),
0x0202 => fan_control::get_command_schema(cmd_id),
0x0300 => color_control::get_command_schema(cmd_id),
0x0451 => wifi_network_management::get_command_schema(cmd_id),
0x0452 => thread_border_router_management::get_command_schema(cmd_id),
0x0453 => thread_network_directory::get_command_schema(cmd_id),
0x0504 => channel::get_command_schema(cmd_id),
0x0505 => target_navigator::get_command_schema(cmd_id),
0x0506 => media_playback::get_command_schema(cmd_id),
0x0507 => media_input::get_command_schema(cmd_id),
0x0508 => low_power::get_command_schema(cmd_id),
0x0509 => keypad_input::get_command_schema(cmd_id),
0x050A => content_launcher::get_command_schema(cmd_id),
0x050B => audio_output::get_command_schema(cmd_id),
0x050C => application_launcher::get_command_schema(cmd_id),
0x050E => account_login::get_command_schema(cmd_id),
0x050F => content_control::get_command_schema(cmd_id),
0x0510 => content_app_observer::get_command_schema(cmd_id),
0x0550 => zone_management::get_command_schema(cmd_id),
0x0551 => camera_av_stream_management::get_command_schema(cmd_id),
0x0552 => camera_av_settings_user_level_management::get_command_schema(cmd_id),
0x0553 => web_rtc_provider::get_command_schema(cmd_id),
0x0554 => web_rtc_requestor::get_command_schema(cmd_id),
0x0555 => push_av_stream_transport::get_command_schema(cmd_id),
0x0556 => chime::get_command_schema(cmd_id),
0x0700 => commodity_tariff::get_command_schema(cmd_id),
0x0751 => commissioner_control_cluster::get_command_schema(cmd_id),
0x0752 => joint_fabric_datastore_cluster::get_command_schema(cmd_id),
0x0753 => joint_fabric_administrator_cluster::get_command_schema(cmd_id),
0x0801 => tls_certificate_management::get_command_schema(cmd_id),
0x0802 => tls_client_management::get_command_schema(cmd_id),
_ => None,
}
}
pub fn encode_command_json(cluster_id: u32, cmd_id: u32, args: &serde_json::Value) -> anyhow::Result<Vec<u8>> {
match cluster_id {
0x0000 => alarm_base::encode_command_json(cmd_id, args),
0x0003 => identify::encode_command_json(cmd_id, args),
0x0004 => groups::encode_command_json(cmd_id, args),
0x0006 => on_off::encode_command_json(cmd_id, args),
0x0008 => level_control::encode_command_json(cmd_id, args),
0x001F => acl_cluster::encode_command_json(cmd_id, args),
0x0025 => actions_cluster::encode_command_json(cmd_id, args),
0x0029 => ota_provider::encode_command_json(cmd_id, args),
0x002A => ota_requestor::encode_command_json(cmd_id, args),
0x0030 => general_commissioning_cluster::encode_command_json(cmd_id, args),
0x0031 => network_commissioning_cluster::encode_command_json(cmd_id, args),
0x0032 => diagnostic_logs_cluster::encode_command_json(cmd_id, args),
0x0033 => diagnostics_general::encode_command_json(cmd_id, args),
0x0034 => diagnostics_software::encode_command_json(cmd_id, args),
0x0035 => diagnostics_thread::encode_command_json(cmd_id, args),
0x0036 => diagnostics_wifi::encode_command_json(cmd_id, args),
0x0037 => diagnostics_ethernet::encode_command_json(cmd_id, args),
0x0038 => time_sync::encode_command_json(cmd_id, args),
0x0039 => bridged_device_basic_information_cluster::encode_command_json(cmd_id, args),
0x003C => admin_commissioning_cluster::encode_command_json(cmd_id, args),
0x003E => operational_credential_cluster::encode_command_json(cmd_id, args),
0x003F => group_key_management_cluster::encode_command_json(cmd_id, args),
0x0046 => icd_management::encode_command_json(cmd_id, args),
0x0048 => operational_state_oven::encode_command_json(cmd_id, args),
0x0050 => mode_select::encode_command_json(cmd_id, args),
0x0056 => temperature_control::encode_command_json(cmd_id, args),
0x0057 => refrigerator_alarm::encode_command_json(cmd_id, args),
0x005C => smoke_co_alarm::encode_command_json(cmd_id, args),
0x005E => mode_microwave_oven::encode_command_json(cmd_id, args),
0x005F => microwave_oven_control::encode_command_json(cmd_id, args),
0x0060 => operational_state::encode_command_json(cmd_id, args),
0x0061 => operational_state_rvc::encode_command_json(cmd_id, args),
0x0062 => scenes::encode_command_json(cmd_id, args),
0x0080 => boolean_state_configuration::encode_command_json(cmd_id, args),
0x0081 => valve_configuration_control::encode_command_json(cmd_id, args),
0x0094 => water_heater_management::encode_command_json(cmd_id, args),
0x0095 => commodity_price::encode_command_json(cmd_id, args),
0x0097 => messages::encode_command_json(cmd_id, args),
0x0098 => device_energy_management::encode_command_json(cmd_id, args),
0x0099 => energy_evse::encode_command_json(cmd_id, args),
0x0101 => door_lock::encode_command_json(cmd_id, args),
0x0102 => window_covering::encode_command_json(cmd_id, args),
0x0104 => closure_control::encode_command_json(cmd_id, args),
0x0105 => closure_dimension::encode_command_json(cmd_id, args),
0x0150 => service_area::encode_command_json(cmd_id, args),
0x0201 => thermostat::encode_command_json(cmd_id, args),
0x0202 => fan_control::encode_command_json(cmd_id, args),
0x0300 => color_control::encode_command_json(cmd_id, args),
0x0451 => wifi_network_management::encode_command_json(cmd_id, args),
0x0452 => thread_border_router_management::encode_command_json(cmd_id, args),
0x0453 => thread_network_directory::encode_command_json(cmd_id, args),
0x0504 => channel::encode_command_json(cmd_id, args),
0x0505 => target_navigator::encode_command_json(cmd_id, args),
0x0506 => media_playback::encode_command_json(cmd_id, args),
0x0507 => media_input::encode_command_json(cmd_id, args),
0x0508 => low_power::encode_command_json(cmd_id, args),
0x0509 => keypad_input::encode_command_json(cmd_id, args),
0x050A => content_launcher::encode_command_json(cmd_id, args),
0x050B => audio_output::encode_command_json(cmd_id, args),
0x050C => application_launcher::encode_command_json(cmd_id, args),
0x050E => account_login::encode_command_json(cmd_id, args),
0x050F => content_control::encode_command_json(cmd_id, args),
0x0510 => content_app_observer::encode_command_json(cmd_id, args),
0x0550 => zone_management::encode_command_json(cmd_id, args),
0x0551 => camera_av_stream_management::encode_command_json(cmd_id, args),
0x0552 => camera_av_settings_user_level_management::encode_command_json(cmd_id, args),
0x0553 => web_rtc_provider::encode_command_json(cmd_id, args),
0x0554 => web_rtc_requestor::encode_command_json(cmd_id, args),
0x0555 => push_av_stream_transport::encode_command_json(cmd_id, args),
0x0556 => chime::encode_command_json(cmd_id, args),
0x0700 => commodity_tariff::encode_command_json(cmd_id, args),
0x0751 => commissioner_control_cluster::encode_command_json(cmd_id, args),
0x0752 => joint_fabric_datastore_cluster::encode_command_json(cmd_id, args),
0x0753 => joint_fabric_administrator_cluster::encode_command_json(cmd_id, args),
0x0801 => tls_certificate_management::encode_command_json(cmd_id, args),
0x0802 => tls_client_management::encode_command_json(cmd_id, args),
_ => Err(anyhow::anyhow!("unsupported cluster: 0x{:04X}", cluster_id)),
}
}