TuyaSmartGroup Class Reference

Inherits from NSObject
Declared in TuyaSmartGroup.h

Other Methods

  groupModel

@property (nonatomic, strong, readonly) TuyaSmartGroupModel *groupModel

  delegate

@property (nonatomic, weak, nullable) id<TuyaSmartGroupDelegate> delegate

+ groupWithGroupId:

Get TuyaSmartGroup instance. 获取群组对象

+ (nullable instancetype)groupWithGroupId:(NSString *)groupId

Parameters

groupId

groupId

Return Value

instance

Discussion

Get TuyaSmartGroup instance. 获取群组对象

Declared In

TuyaSmartGroup.h

– initWithGroupId:

Get TuyaSmartGroup instance. 获取群组对象

- (nullable instancetype)initWithGroupId:(NSString *)groupId

Parameters

groupId

groupId

Return Value

instance

Discussion

Get TuyaSmartGroup instance. 获取群组对象

Declared In

TuyaSmartGroup.h

– init

- (instancetype)init

+ createGroupWithName:productId:homeId:devIdList:success:failure:

Creating Groups of Wifi Devices 创建 wifi 设备群组

+ (void)createGroupWithName:(NSString *)name productId:(NSString *)productId homeId:(long long)homeId devIdList:(NSArray<NSString*> *)devIdList success:(nullable void ( ^ ) ( TuyaSmartGroup *group ))success failure:(nullable TYFailureError)failure

Parameters

name

Group name

productId

Product ID

homeId

Home ID

devIdList

DeviceId list

success

Success block

failure

Failure block

Discussion

Creating Groups of Wifi Devices 创建 wifi 设备群组

Declared In

TuyaSmartGroup.h

+ getDevList:homeId:success:failure:

Get list of WiFi devices that support groups based on productId 根据 productId 获取对应的支持群组的 wifi 设备列表

+ (void)getDevList:(NSString *)productId homeId:(long long)homeId success:(nullable void ( ^ ) ( NSArray<TuyaSmartGroupDevListModel*> *list ))success failure:(nullable TYFailureError)failure

Parameters

productId

Product ID

homeId

Home ID

success

Success block

failure

Failure block

Discussion

Get list of WiFi devices that support groups based on productId 根据 productId 获取对应的支持群组的 wifi 设备列表

Declared In

TuyaSmartGroup.h

– getDevList:success:failure:

Get the device list for the corresponding group based on productId 根据 productId 获取对应群组下的设备列表

- (void)getDevList:(NSString *)productId success:(nullable void ( ^ ) ( NSArray<TuyaSmartGroupDevListModel*> *list ))success failure:(nullable TYFailureError)failure

Parameters

productId

Product ID

success

Success block

failure

Failure block

Discussion

Get the device list for the corresponding group based on productId 根据 productId 获取对应群组下的设备列表

Declared In

TuyaSmartGroup.h

– publishDps:success:failure:

Group control command issuance 群组dp命令下发

- (void)publishDps:(NSDictionary *)dps success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

dps

dps

success

Success block

failure

Failure block

Discussion

Group control command issuance 群组dp命令下发

Declared In

TuyaSmartGroup.h

– updateGroupName:success:failure:

Rename the group name 修改群组名称

- (void)updateGroupName:(NSString *)name success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

name

Group name

success

Success block

failure

Failure block

Discussion

Rename the group name 修改群组名称

Declared In

TuyaSmartGroup.h

– updateIcon:success:failure:

Edit group icon. 修改群组图片

- (void)updateIcon:(UIImage *)icon success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

icon

icon

success

Success block

failure

Failure block

Discussion

Edit group icon. 修改群组图片

Declared In

TuyaSmartGroup.h

– updateGroupRelations:success:failure:

Modify the device list of the group 修改群组设备列表

- (void)updateGroupRelations:(NSArray<NSString*> *)devList success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

devList

Device list

success

Success block

failure

Failure block

Discussion

Modify the device list of the group 修改群组设备列表

Declared In

TuyaSmartGroup.h

– dismissGroup:failure:

Remove Group 解散群组

- (void)dismissGroup:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Remove Group 解散群组

Declared In

TuyaSmartGroup.h

+ createGroupWithName:homeId:gwId:productId:success:failure:

Create groups of zigBee devices 创建 zigbee 设备群组

+ (void)createGroupWithName:(NSString *)name homeId:(long long)homeId gwId:(NSString *)gwId productId:(NSString *)productId success:(nullable void ( ^ ) ( TuyaSmartGroup *))success failure:(nullable TYFailureError)failure

Parameters

name

Group name

homeId

Home ID

gwId

Gateway ID

productId

Product ID

success

Success block

failure

Failure block

Discussion

Create groups of zigBee devices 创建 zigbee 设备群组

Declared In

TuyaSmartGroup.h

+ getDevListWithProductId:gwId:homeId:success:failure:

Get a list of ZigBee subdevices for the corresponding support group based on productId and gwId 根据 productId 和 gwId 获取对应的支持群组的 zigbee 子设备列表

+ (void)getDevListWithProductId:(NSString *)productId gwId:(NSString *)gwId homeId:(long long)homeId success:(nullable void ( ^ ) ( NSArray<TuyaSmartGroupDevListModel*> *))success failure:(nullable TYFailureError)failure

Parameters

productId

Product ID

gwId

Gateway ID

homeId

Home ID

success

Success block

failure

Failure block

Discussion

Get a list of ZigBee subdevices for the corresponding support group based on productId and gwId 根据 productId 和 gwId 获取对应的支持群组的 zigbee 子设备列表

Declared In

TuyaSmartGroup.h

– addZigbeeDeviceWithNodeList:success:failure:

Add ZigBee devices to groups (interacting locally with gateways) 添加zigbee设备到群组(和网关本地交互)

- (void)addZigbeeDeviceWithNodeList:(NSArray<NSString*> *)nodeList success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeList

Zigbee subdevce nodeId list

success

Success block

failure

Failure block

Discussion

Add ZigBee devices to groups (interacting locally with gateways) 添加zigbee设备到群组(和网关本地交互)

Declared In

TuyaSmartGroup.h

– removeZigbeeDeviceWithNodeList:success:failure:

Remove ZigBee devices from groups (interacting locally with gateways) 把zigbee设备从群组移除(和网关本地交互)

- (void)removeZigbeeDeviceWithNodeList:(NSArray<NSString*> *)nodeList success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nodeList

Zigbee subdevce nodeId list

success

Success block

failure

Failure block

Discussion

Remove ZigBee devices from groups (interacting locally with gateways) 把zigbee设备从群组移除(和网关本地交互)

Declared In

TuyaSmartGroup.h

– cancelRequest

Cancel Request

- (void)cancelRequest

Discussion

Cancel Request

Declared In

TuyaSmartGroup.h

DpCode Methods

+ createDpCodeGroupWithName:homeId:categoryCode:devIdList:success:failure:

Creating Groups of Wifi Standard Code Devices 创建标准DPCode wifi 设备群组

+ (void)createDpCodeGroupWithName:(NSString *)name homeId:(long long)homeId categoryCode:(NSString *)categoryCode devIdList:(NSArray<NSString*> *)devIdList success:(nullable void ( ^ ) ( TuyaSmartGroup *group ))success failure:(nullable TYFailureError)failure

Parameters

name

Group name

homeId

Home ID

categoryCode

category Code

devIdList

DeviceId list

success

Success block

failure

Failure block

Discussion

Creating Groups of Wifi Standard Code Devices 创建标准DPCode wifi 设备群组

Declared In

TuyaSmartGroup+DpCode.h

+ getDpCodeDevListWithHomeId:categoryCode:success:failure:

Get list of WiFi devices that support standard code groups based on category code 根据 categoryCode 获取对应的支持标准DPCode群组的 wifi 设备列表

+ (void)getDpCodeDevListWithHomeId:(long long)homeId categoryCode:(NSString *)categoryCode success:(nullable void ( ^ ) ( NSArray<TuyaSmartGroupDevListModel*> *list ))success failure:(nullable TYFailureError)failure

Parameters

homeId

Home ID

categoryCode

category Code

success

Success block

failure

Failure block

Discussion

Get list of WiFi devices that support standard code groups based on category code 根据 categoryCode 获取对应的支持标准DPCode群组的 wifi 设备列表

Declared In

TuyaSmartGroup+DpCode.h

– getDpCodeDevListWithSuccess:failure:

Get the device list for the group based 获取群组下支持的设备列表

- (void)getDpCodeDevListWithSuccess:(nullable void ( ^ ) ( NSArray<TuyaSmartGroupDevListModel*> *list ))success failure:(nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Get the device list for the group based 获取群组下支持的设备列表

Declared In

TuyaSmartGroup+DpCode.h

– updateDpCodeGroupRelationsWithDevList:success:failure:

Modify the device list of the group 修改群组设备列表

- (void)updateDpCodeGroupRelationsWithDevList:(NSArray<NSString*> *)devList success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

devList

Device list

success

Success block

failure

Failure block

Discussion

Modify the device list of the group 修改群组设备列表

Declared In

TuyaSmartGroup+DpCode.h

– publishDpCodes:success:failure:

Group control command issuance 群组dp Code命令下发

- (void)publishDpCodes:(NSDictionary *)dpCodes success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

dpCodes

dp Codes

success

Success block

failure

Failure block

Discussion

Group control command issuance 群组dp Code命令下发

Declared In

TuyaSmartGroup+DpCode.h