Last Updated on : 2022-02-17 05:21:57download
A project is an independent unit that is managed by a user. Areas and devices must be assigned to a user before they can be managed.
One or more projects can be created for a user. The maximum number of projects that can be created for a user depends on the plan purchased by the user. A newly created user is not assigned projects. Projects must be created after login to enable follow-up operations.
Indoor project: visual management of devices on the building plan. Recommended for simple scenarios where the project address can be simply described in text. It is suitable for office buildings, shopping malls, and other similar projects.
Outdoor project: accurate positioning of devices by GIS maps, recommended for larger areas and scattered device scenarios. The project region is specified with the country code combined with a level-1 administrative code. Project subordinate areas are displayed by marking points on the map. [The current project type is only available for the advanced version of the brand to open the account to create permission]. It is suitable for outdoor street lights, charging piles, and other projects.
TuyaLightingProjectManager
class. The creation of outdoor projects requires administrative area information that is provided by the TuyaLightingRegionManager
class. The features to get project information, update project information, and delete project functions are provided by the TuyaLightingProject
class. Project information is provided by the TuyaLightingProjectModel
class.API description
- (void)getProjectConfigListWithSuccess:(void(^)(NSArray<TuyaLightingProjectConfigModel *> *configList))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
success | Success callback |
failure | Failure callback |
Example
ObjC:
[[TuyaLightingProjectManager new] getProjectConfigListWithSuccess:^(NSArray <TuyaLightingProjectConfigModel *> *configList) {
NSLog(@"get success");
} failure:^(NSError *error) {
NSLog(@"get failure: %@", error);
}];
** API description**
- (void)getProjectListWithSuccess:(nullable void(^)(NSArray <TuyaLightingProjectModel *> *projectList))success
failure:(nullable void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
success | Success callback |
failure | Failure callback |
Example
ObjC:
[[TuyaLightingProjectManager new] getProjectListWithSuccess:^(NSArray <TuyaLightingProjectModel *> *projectList) {
NSLog(@"get success");
} failure:^(NSError *error) {
NSLog(@"get failure: %@", error);
}];
API description
- (void)createProjectWithProjectType:(TuyaLightingProjectType)projectType
projectName:(NSString *)projectName
leaderName:(NSString *)leaderName
leaderMobile:(NSString *)leaderMobile
detailAddress:(NSString *)detailAddress
regionLocationId:(NSString *)regionLocationId
success:(void(^)(id result))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
projectType | Project type, required |
projectName | Project name, required |
leaderName | Project leader’s name, required |
leaderMobile | Project leader’s phone number, required |
detailAddress | Location, required |
regionLocationId | The project region ID, a combination of the country code and the level-1 region code, spliced with commas (,). The region code is obtained through the TuyaLightingRegionManager, optional |
success | Success callback |
failure | Failure callback |
Example
ObjC:
[[TuyaLightingProjectManager new] createProjectWithProjectType:TuyaLightingProjectTypeIndoor
projectName:@"your projectName"
leaderName:@"your leaderName"
leaderMobile:@"your leaderMobile"
detailAddress:@"your detailAddress"
regionLocationId:nil
success:^(id result) {
NSLog(@"create success");
} failure:^(NSError *error) {
NSLog(@"create failure: %@", error);
}];
API description
- (void)getProjectInfoWithSuccess:(nullable void(^)(id result))success
failure:(nullable void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
success | Success callback |
failure | Failure callback |
Example
ObjC:
TuyaLightingProject *project = [TuyaLightingProject projectWithProjectId:123];
[project getProjectInfoWithSuccess:^(id result) {
NSLog(@"get success");
} failure:^(NSError *error) {
NSLog(@"get failure: %@", error);
}];
Returns project details, including mesh list, project information, collection area, gateway list, and the area list.
API description
- (void)getProjectDetailWithSuccess:(nullable void(^)(void))success
failure:(nullable void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
success | Success callback |
failure | Failure callback |
Example
ObjC:
TuyaLightingProject *project = [TuyaLightingProject projectWithProjectId:123];
[project getProjectDetailWithSuccess:^(void) {
NSLog(@"get success");
} failure:^(NSError *error) {
NSLog(@"get failure: %@", error);
}];
API description
- (void)updateProjectInfoWithProjectName:(nonnull NSString *)projectName
leaderName:(nonnull NSString *)leaderName
leaderMobile:(nonnull NSString *)leaderMobile
detailAddress:(nonnull NSString *)detailAddress
regionLocationId:(nullable NSString *)regionLocationId
success:(nullable void(^)(id result))success
failure:(nullable void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
projectName | Project name, required |
leaderName | Name of the project leader, required |
leaderMobile | Phone of the project leader, required |
detailAddress | Detailed location, required |
regionLocationId | Project administrative region ID, which is a combination of country code and first-level administrative region code, spliced by commas (,). The region code is obtained through TuyaLightingRegionManager , optional |
success | Success callback |
failure | Failure callback |
Example
ObjC:
TuyaLightingProject *project = [TuyaLightingProject projectWithProjectId:123];
[project updateProjectInfoWithProjectName:@"your projectName"
leaderName:@"your leaderName"
leaderMobile:@"your leaderMobile"
detailAddress:@"your detailAddress"
regionLocationId:nil
success:^(id result) {
NSLog(@"update success");
} failure:^(NSError *error) {
NSLog(@"update failure: %@", error);
}];
API description
- (void)deleteProjectWithPassword:(nonnull NSString *)password
success:(nullable void(^)(void))success
failure:(nullable void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
password | Password, required |
success | Success callback |
failure | Failure callback |
Example
ObjC:
TuyaLightingProject *project = [TuyaLightingProject projectWithProjectId:123];
[project deleteProjectWithPassword:@"your password"
success:^{
NSLog(@"delete success");
} failure:^(NSError *error) {
NSLog(@"delete failure: %@", error);
}];
API description
- (void)getRegionListWithSuccess:(void(^)(NSArray<TuyaLightingRegionModel *> *regionList))success
failure:(void(^)(NSError *error))failure;
Parameters
Parameter | Description |
---|---|
success | Success callback |
failure | Failure callback |
Example
ObjC:
TuyaLightingRegionManager *project = [TuyaLightingRegionManager new];
[[TuyaLightingRegionManager sharedInstance] getRegionListWithSuccess:^(NSArray * _Nonnull regionList) {
NSLog(@"get success");
} failure:^(NSError * _Nonnull error) {
NSLog(@"get failure: %@", error);
}];
Parameter | Description |
---|---|
projectType | Project type. Valid values: 0 : indoor. 1 : outdoor |
projectTypeName | Project type name |
projectIconUrl | projectTypeIconUrl |
spaceAttributes | Space hierarchy attributes, TuyaLightingProjectSpaceItemModel array |
validationConditions | Valid input range restrictions, TuyaLightingProjectValidationItemModel array |
Parameters | Description |
---|---|
name | Space hierarchy name |
iconUrl | spaceLevelIconUrl |
roomLevel | spaceLevel |
#3# TuyaLightingProjectValidationItemModel
Parameter | Description |
---|---|
min | The minimum valid range |
max | The maximum value range |
Parameter | Description | |
---|---|---|
locationId | Administrative region ID | |
name | Name of the region | |
pinyinInitials | The initials of the region name | |
parentId | ParentId | Administrative area ID |
name | Spatial hierarchy name |
Parameter | Description |
---|---|
projectId | Project ID |
name | Project name |
geoName | Project geographic location |
latitude | Latitude |
longitude | Longitude |
backgroundUrl | Project background image |
controlMode | Example: smart: smart control, local: local control, remote: remote control |
leaderName | Project leader’s name |
leaderMobile | Project leader’s cell phone or email |
clientCount | Total number of devices |
errorClientCount | Total number of offline devices (including Bluetooth direct-connected devices) |
authClientCount | Total number of authorized devices |
realOfflineCount | Total number of offline devices (not including Bluetooth direct-connected devices) |
power | Power consumption |
projectType | Project type |
regionLocationId | Project region ID |
projectTypeName | Project type name |
projectIconUrl | projecticonUrl |
displayOrder | Sorting order |
dealStatus | Public field |
role | Public field |
admin | Public field |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback