TuyaSmartSceneManager Class Reference

Inherits from NSObject
Declared in TuyaSmartSceneManager.h

+ sharedInstance

单例 Singleton

+ (instancetype)sharedInstance

Return Value

TuyaSmartSceneManager singleton instance.

Discussion

单例 Singleton

Declared In

TuyaSmartSceneManager.h

  delegate

@property (nonatomic, weak) id<TuyaSmartSceneManagerDelegate> delegate

– getSceneListWithHomeId:success:failure:

获取家庭的场景列表,场景和自动化可以通过conditons数组是否为空来区分,conditions大于0说明是一个自动化,否则是普通场景。 Get scene and auto list, scene and automation can be differentiated with property conditons.count, conditons over 0 will be automation.

- (void)getSceneListWithHomeId:(long long)homeId success:(void ( ^ ) ( NSArray<TuyaSmartSceneModel*> *list ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

操作成功回调, 返回场景列表 success callback

failure

failure callback

Discussion

获取家庭的场景列表,场景和自动化可以通过conditons数组是否为空来区分,conditions大于0说明是一个自动化,否则是普通场景。 Get scene and auto list, scene and automation can be differentiated with property conditons.count, conditons over 0 will be automation.

Declared In

TuyaSmartSceneManager.h

– getRecommendedSceneListWithHomeId:success:failure:

获取家庭的推荐场景列表 Get recommended scene list.

- (void)getRecommendedSceneListWithHomeId:(long long)homeId success:(void ( ^ ) ( NSArray<TuyaSmartSceneModel*> *list ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

操作成功回调, 返回场景列表 success callback

failure

failure callback

Discussion

获取家庭的推荐场景列表 Get recommended scene list.

Declared In

TuyaSmartSceneManager.h

– getCollectionSceneListWithHomeId:success:failure:

获取家庭下收藏的场景列表 Get a list of favorite scenes under the family.

- (void)getCollectionSceneListWithHomeId:(long long)homeId success:(TYSuccessList)success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

操作成功回调, 返回场景列表 success callback

failure

failure callback

Discussion

获取家庭下收藏的场景列表 Get a list of favorite scenes under the family.

Declared In

TuyaSmartSceneManager.h

– getConditionListWithFahrenheit:success:failure:

获取自动化支持的气象条件列表 Get weather conditon list which automation support.

- (void)getConditionListWithFahrenheit:(BOOL)fahrenheit success:(void ( ^ ) ( NSArray<TuyaSmartSceneDPModel*> *list ))success failure:(TYFailureError)failure

Parameters

fahrenheit

Unit of temperature,if use fahrenheit, set fahrenheit param to YES.

success

success callback.

failure

failure callback

Discussion

获取自动化支持的气象条件列表 Get weather conditon list which automation support.

Declared In

TuyaSmartSceneManager.h

– getAllConditionListWithFahrenheit:homeId:success:failure:

获取自动化支持的所有条件列表,包括气象条件和可能的其他条件 Get weather conditon list and other condition list which automation support.

- (void)getAllConditionListWithFahrenheit:(BOOL)fahrenheit homeId:(long long)homeId success:(void ( ^ ) ( NSDictionary *dict ))success failure:(TYFailureError)failure

Parameters

fahrenheit

Unit of temperature,if use fahrenheit, set fahrenheit param to YES.

homeId

homeId

success

success callback. key @“envConditions” is whether conditions, @“devConditions” is other condtions.

failure

failure callback

Discussion

获取自动化支持的所有条件列表,包括气象条件和可能的其他条件 Get weather conditon list and other condition list which automation support.

Declared In

TuyaSmartSceneManager.h

– getAllConditionListWithFahrenheit:windSpeedUnit:homeId:success:failure:

获取自动化支持的所有条件列表,包括气象条件和可能的其他条件 Get weather conditon list and other condition list which automation support.

- (void)getAllConditionListWithFahrenheit:(BOOL)fahrenheit windSpeedUnit:(NSString *)speedUnit homeId:(long long)homeId success:(void ( ^ ) ( NSDictionary *dict ))success failure:(TYFailureError)failure

Parameters

fahrenheit

Unit of temperature,if use fahrenheit, set fahrenheit param to YES.

speedUnit

Unit of wind speed,@“mph"、@"m/s"、@"kph"、@"km/h”.

homeId

homeId

success

success callback. key @“envConditions” is whether conditions, @“devConditions” is other condtions.

failure

failure callback

Discussion

获取自动化支持的所有条件列表,包括气象条件和可能的其他条件 Get weather conditon list and other condition list which automation support.

Declared In

TuyaSmartSceneManager.h

– getActionDeviceListWithHomeId:success:failure:

获取场景中支持的任务设备列表 Get devices supported to add to scene’s action in home.

- (void)getActionDeviceListWithHomeId:(long long)homeId success:(void ( ^ ) ( NSArray<TuyaSmartDeviceModel*> *list ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

success callback

failure

failure callback

Discussion

获取场景中支持的任务设备列表 Get devices supported to add to scene’s action in home.

Declared In

TuyaSmartSceneManager.h

– getActionDeviceListWithRoomId:

获取单个房间里面支持作为动作的设备列表 Get devices supported to add to scene’s action in given room.

- (NSArray<TuyaSmartDeviceModel*> *)getActionDeviceListWithRoomId:(long long)roomId

Parameters

roomId

roomId

Discussion

获取单个房间里面支持作为动作的设备列表 Get devices supported to add to scene’s action in given room.

Declared In

TuyaSmartSceneManager.h

– getConditionDeviceListWithHomeId:success:failure:

获取场景中支持作为条件的设备列表 Get devices support to add to scene’s conditon in given home.

- (void)getConditionDeviceListWithHomeId:(long long)homeId success:(void ( ^ ) ( NSArray<TuyaSmartDeviceModel*> *list ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

success callback

failure

failure callback

Discussion

获取场景中支持作为条件的设备列表 Get devices support to add to scene’s conditon in given home.

Declared In

TuyaSmartSceneManager.h

– getConditionDeviceListWithRoomId:

获取房间里面支持作为条件的设备列表 Get devices supported to add to scene’s condtion in given room.

- (NSArray<TuyaSmartDeviceModel*> *)getConditionDeviceListWithRoomId:(long long)roomId

Parameters

roomId

roomId

Discussion

获取房间里面支持作为条件的设备列表 Get devices supported to add to scene’s condtion in given room.

Declared In

TuyaSmartSceneManager.h

– getFaceDeviceListWithHomeId:success:failure:

获取家庭中支持人脸的条件设备列表. Get devices supported to recognize face, which can be set as automation’s conditon.

- (void)getFaceDeviceListWithHomeId:(long long)homeId success:(void ( ^ ) ( NSArray<TuyaSmartDeviceModel*> *list ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

success callback

failure

failure callback

Discussion

获取家庭中支持人脸的条件设备列表. Get devices supported to recognize face, which can be set as automation’s conditon.

Declared In

TuyaSmartSceneManager.h

– getLockDeviceListWithHomeId:success:failure:

获取家庭中支持家人回家联动的门锁设备设备列表. Get lock devices supported to be a smart’s condition.

- (void)getLockDeviceListWithHomeId:(long long)homeId success:(void ( ^ ) ( NSArray<TuyaSmartDeviceModel*> *list ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

success callback

failure

failure callback

Discussion

获取家庭中支持家人回家联动的门锁设备设备列表. Get lock devices supported to be a smart’s condition.

Declared In

TuyaSmartSceneManager.h

– getActionGroupListWithRoomId:

获取单个房间里面可以作为动作的群组列表。 Get groups in specified room which can be used as scene’s action.

- (NSArray<TuyaSmartGroupModel*> *)getActionGroupListWithRoomId:(long long)roomId

Parameters

roomId

homeId

Discussion

获取单个房间里面可以作为动作的群组列表。 Get groups in specified room which can be used as scene’s action.

Declared In

TuyaSmartSceneManager.h

– getActionGroupListAndDeviceListWithHomeId:success:failure:

获取家庭下可作为场景动作的设备群组列表和设备列表 Get groups and devices which can be used as scene’s action in specified hoom.

- (void)getActionGroupListAndDeviceListWithHomeId:(long long)homeId success:(void ( ^ ) ( NSDictionary *dict ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

success

success callback,dict’s keys are “groupList” and “deviceList” and @“extendsDictionary”, extendsDictionary contains some extra infomation for each device.

failure

failure

Discussion

获取家庭下可作为场景动作的设备群组列表和设备列表 Get groups and devices which can be used as scene’s action in specified hoom.

Declared In

TuyaSmartSceneManager.h

– getActionDeviceDPListWithDevId:success:failure:

获取作为动作的设备的DP(数据点)列表。 Get data point list of specified device which can be used as scene’s action.

- (void)getActionDeviceDPListWithDevId:(NSString *)devId success:(void ( ^ ) ( NSArray<TuyaSmartSceneDPModel*> *list ))success failure:(TYFailureError)failure

Parameters

devId

device’s id

success

success callback, return the data point list of given device.

failure

failure callback

Discussion

获取作为动作的设备的DP(数据点)列表。 Get data point list of specified device which can be used as scene’s action.

Declared In

TuyaSmartSceneManager.h

– getCondicationDeviceDPListWithDevId:success:failure:

获取作为条件的设备的DP(数据点)列表。 Get data point list of specified device which can be used as automation’s condition.

- (void)getCondicationDeviceDPListWithDevId:(NSString *)devId success:(void ( ^ ) ( NSArray<TuyaSmartSceneDPModel*> *list ))success failure:(TYFailureError)failure

Parameters

devId

device’s id

success

success callback, return the data point list of given device.

failure

failure callback

Discussion

获取作为条件的设备的DP(数据点)列表。 Get data point list of specified device which can be used as automation’s condition.

Declared In

TuyaSmartSceneManager.h

– getActionGroupDPListWithGroupId:success:failure:

获取作为动作的群组的DP(数据点)列表 Get data point list of specified group which can be used as scene’s action.

- (void)getActionGroupDPListWithGroupId:(NSString *)groupId success:(void ( ^ ) ( NSArray<TuyaSmartSceneDPModel*> *list ))success failure:(TYFailureError)failure

Parameters

groupId

groupId

success

success callback, return the data point list of given group.

failure

failure callback

Discussion

获取作为动作的群组的DP(数据点)列表 Get data point list of specified group which can be used as scene’s action.

Declared In

TuyaSmartSceneManager.h

– getCityListWithCountryCode:success:failure:

获取城市信息列表(国外少部分国家的城市列表不完整,国外用户建议根据经纬度获取城市信息) Get city list. In addition, city list in area out of china may be not completed, so if users are out of china, we suggest you use lantitude and longitude to get the city infomation.

- (void)getCityListWithCountryCode:(NSString *)countryCode success:(void ( ^ ) ( NSArray<TuyaSmartCityModel*> *list ))success failure:(TYFailureError)failure

Parameters

countryCode

country code

success

success callback, return city list.

failure

failure callback

Discussion

获取城市信息列表(国外少部分国家的城市列表不完整,国外用户建议根据经纬度获取城市信息) Get city list. In addition, city list in area out of china may be not completed, so if users are out of china, we suggest you use lantitude and longitude to get the city infomation.

Declared In

TuyaSmartSceneManager.h

– getCityInfoWithLatitude:longitude:success:failure:

根据经纬度获取城市信息。 Get city detail infomation by latitude and longitude.

- (void)getCityInfoWithLatitude:(NSString *)latitude longitude:(NSString *)longitude success:(void ( ^ ) ( TuyaSmartCityModel *model ))success failure:(TYFailureError)failure

Parameters

latitude

latitude

longitude

longitude

success

success callback, return city infomation.

failure

failure callback

Discussion

根据经纬度获取城市信息。 Get city detail infomation by latitude and longitude.

Declared In

TuyaSmartSceneManager.h

– getCityInfoWithCityId:success:failure:

根据城市id获取城市详情 Get city detail infomation with cityId.

- (void)getCityInfoWithCityId:(NSString *)cityId success:(void ( ^ ) ( TuyaSmartCityModel *model ))success failure:(TYFailureError)failure

Parameters

cityId

cityId

success

success callback, return city ditail infomation.

failure

failure callback

Discussion

根据城市id获取城市详情 Get city detail infomation with cityId.

Declared In

TuyaSmartSceneManager.h

– sortSceneWithHomeId:sceneIdList:success:failure:

场景排序 Reorder the scene list.

- (void)sortSceneWithHomeId:(long long)homeId sceneIdList:(NSArray<NSString*> *)sceneIdList success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

homeId

homeId

sceneIdList

Ordered sceneId list

success

success callback

failure

failure callback

Discussion

场景排序 Reorder the scene list.

Declared In

TuyaSmartSceneManager.h

– getSmartSceneBackgroundCoverWithsuccess:failure:

获取场景背景图标url列表 Get scene cover url list.

- (void)getSmartSceneBackgroundCoverWithsuccess:(TYSuccessList)success failure:(TYFailureError)failure

Parameters

success

success callback

failure

failure callback

Discussion

获取场景背景图标url列表 Get scene cover url list.

Declared In

TuyaSmartSceneManager.h

– getSmartSceneCustomStyleListWithSuccess:failure:

获取自定义样式数据列表,包括颜色,图标,背景图,key分别对应coverColors,coverIconList,coverPics。 Get scene custom style resource list. <color,icon,background>, key is <coverColors,coverIconList,coverPics>

- (void)getSmartSceneCustomStyleListWithSuccess:(TYSuccessDict)success failure:(TYFailureError)failure

Parameters

success

success callback

failure

failure callback

Discussion

获取自定义样式数据列表,包括颜色,图标,背景图,key分别对应coverColors,coverIconList,coverPics。 Get scene custom style resource list. <color,icon,background>, key is <coverColors,coverIconList,coverPics>

Declared In

TuyaSmartSceneManager.h

– getSmartSceneLogWithHomeId:startTime:endTime:size:lastId:lastRecordTime:success:failure:

获取场景联动日志列表。 Get scene linkage log list.

- (void)getSmartSceneLogWithHomeId:(long long)homeId startTime:(long long)startTime endTime:(long long)endTime size:(NSInteger)size lastId:(NSString *)lastId lastRecordTime:(long long)lastRecordTime success:(void ( ^ ) ( TuyaSmartSceneLogModel *logModel ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

startTime

startTime

endTime

endTime

size

Number of queries

lastId

last one’s Id

lastRecordTime

lastRecordTime, 0 for Not set

success

success callback

failure

failure callback

Discussion

获取场景联动日志列表。 Get scene linkage log list.

字段 描述 是否可选(optional) 类型 startTime 开始时间 N Long endTime 结束时间 N Long size 查询条数 N Integer lastId 偏移量(eventId) Y String lastRecordTime 偏移量(execTime) Y 0 for not set Long

Declared In

TuyaSmartSceneManager.h

– getSmartSceneLogDetailWithHomeId:eventId:startTime:endTime:returnType:success:failure:

查询联动日志详情。 Query linkage log details.

- (void)getSmartSceneLogDetailWithHomeId:(long long)homeId eventId:(NSString *)eventId startTime:(long long)startTime endTime:(long long)endTime returnType:(long long)returnType success:(void ( ^ ) ( NSArray<TuyaSmartSceneLogDetailModel*> *items ))success failure:(TYFailureError)failure

Parameters

homeId

homeId

eventId

eventId

startTime

startTime

endTime

endTime

success

success callback

failure

failure callback

Discussion

查询联动日志详情。 Query linkage log details.

字段 描述 是否可选 类型 eventId 事件ID N String startTime 开始时间 N Long endTime 结束时间 N Long returnType 返回类型 Y Long 0:返回全部明细 all details, 1:返回失败状态的明细 only error items

Declared In

TuyaSmartSceneManager.h

– removeAllGeoFence

移除所有场景注册在系统中的地理围栏,在当前用户退出登录时调用。 Removes all Geo-fencing registered in the system from the automation and is called when the current user logs out.

- (void)removeAllGeoFence

Discussion

移除所有场景注册在系统中的地理围栏,在当前用户退出登录时调用。 Removes all Geo-fencing registered in the system from the automation and is called when the current user logs out.

Declared In

TuyaSmartSceneManager.h

– cancelRequest

取消正在进行的操作。 Cancel the request being executed.

- (void)cancelRequest

Discussion

取消正在进行的操作。 Cancel the request being executed.

Declared In

TuyaSmartSceneManager.h