mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
components/esp_matter: Add irrigation system device type data model
This commit is contained in:
@@ -68,6 +68,7 @@ enum device_type_enum {
|
||||
ESP_MATTER_ELECTRICAL_METER,
|
||||
ESP_MATTER_ELECTRICAL_UTILITY_METER,
|
||||
ESP_MATTER_SOIL_SENSOR,
|
||||
ESP_MATTER_IRRIGATION_SYSTEM,
|
||||
ESP_MATTER_DEVICE_TYPE_MAX
|
||||
};
|
||||
|
||||
@@ -142,5 +143,6 @@ const device_type_name device_type_list[ESP_MATTER_DEVICE_TYPE_MAX] = {
|
||||
{"electrical_meter", ESP_MATTER_ELECTRICAL_METER},
|
||||
{"electrical_utility_meter", ESP_MATTER_ELECTRICAL_UTILITY_METER},
|
||||
{"soil_sensor", ESP_MATTER_SOIL_SENSOR},
|
||||
{"irrigation_system", ESP_MATTER_IRRIGATION_SYSTEM},
|
||||
};
|
||||
} /* namespace esp_matter */
|
||||
|
||||
@@ -743,6 +743,15 @@ int create(uint8_t device_type_index)
|
||||
chip::app::Clusters::SoilMeasurement::SetSoilMoistureLimits(esp_matter::endpoint::get_id(endpoint), limits);
|
||||
break;
|
||||
}
|
||||
case ESP_MATTER_IRRIGATION_SYSTEM: {
|
||||
esp_matter::endpoint::irrigation_system::config_t irrigation_system_config;
|
||||
endpoint = esp_matter::endpoint::irrigation_system::create(node, &irrigation_system_config, ENDPOINT_FLAG_NONE, NULL);
|
||||
|
||||
esp_matter::endpoint::water_valve::config_t water_valve_config;
|
||||
esp_err_t err = esp_matter::endpoint::water_valve::add(endpoint, &water_valve_config);
|
||||
VerifyOrReturnValue(err == ESP_OK, 1, ESP_LOGE(TAG, "Failed to add water valve endpoint"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ESP_LOGE(TAG, "Please input a valid device type");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user