Tuya iOS Smart Life App SDK 5.15.0
ThingSmartSceneConditionExprBuilder Class Reference

Create ThingSmartSceneExprModel by difference type values. More...

#import <ThingSmartSceneConditionExprBuilder.h>

Inheritance diagram for ThingSmartSceneConditionExprBuilder:

Class Methods

(ThingSmartSceneExprModel *) + createBoolExprWithType:isTrue:exprType:
 
(ThingSmartSceneExprModel *) + createEnumExprWithType:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createValueExprWithType:operater:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createRawExprWithType:exprType:
 
(ThingSmartSceneExprModel *) + createTimerExprWithTimeZoneId:loops:date:time:
 
(ThingSmartSceneExprModel *) + createSunsetriseTimerExprWithCity:type:deltaMinutes:
 
(ThingSmartSceneExprModel *) + buildGeofenceExprWithType:
 
(ThingSmartSceneExprModel *) + buildCalculateExprWithDpId:dpType:selectedValue:
 
(ThingSmartSceneExprModel *) + buildMemberBackHomeExprWithMemberIds:
 
(ThingSmartSceneExprModel *) + createBoolExprWithType:isTrue:exprType:
 
(ThingSmartSceneExprModel *) + createEnumExprWithType:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createValueExprWithType:operater:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createRawExprWithType:exprType:
 
(ThingSmartSceneExprModel *) + createTimerExprWithTimeZoneId:loops:date:time:
 
(ThingSmartSceneExprModel *) + createSunsetriseTimerExprWithCity:type:deltaMinutes:
 
(ThingSmartSceneExprModel *) + buildGeofenceExprWithType:
 
(ThingSmartSceneExprModel *) + buildCalculateExprWithDpId:dpType:selectedValue:
 
(ThingSmartSceneExprModel *) + buildMemberBackHomeExprWithMemberIds:
 
(ThingSmartSceneExprModel *) + createBoolExprWithType:isTrue:exprType:
 
(ThingSmartSceneExprModel *) + createEnumExprWithType:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createValueExprWithType:operater:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createRawExprWithType:exprType:
 
(ThingSmartSceneExprModel *) + createTimerExprWithTimeZoneId:loops:date:time:
 
(ThingSmartSceneExprModel *) + createSunsetriseTimerExprWithCity:type:deltaMinutes:
 
(ThingSmartSceneExprModel *) + buildGeofenceExprWithType:
 
(ThingSmartSceneExprModel *) + buildCalculateExprWithDpId:dpType:selectedValue:
 
(ThingSmartSceneExprModel *) + buildMemberBackHomeExprWithMemberIds:
 
(ThingSmartSceneExprModel *) + createBoolExprWithType:isTrue:exprType:
 
(ThingSmartSceneExprModel *) + createEnumExprWithType:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createValueExprWithType:operater:chooseValue:exprType:
 
(ThingSmartSceneExprModel *) + createRawExprWithType:exprType:
 
(ThingSmartSceneExprModel *) + createTimerExprWithTimeZoneId:loops:date:time:
 
(ThingSmartSceneExprModel *) + createSunsetriseTimerExprWithCity:type:deltaMinutes:
 
(ThingSmartSceneExprModel *) + buildGeofenceExprWithType:
 
(ThingSmartSceneExprModel *) + buildCalculateExprWithDpId:dpType:selectedValue:
 
(ThingSmartSceneExprModel *) + buildMemberBackHomeExprWithMemberIds:
 

Detailed Description

Create ThingSmartSceneExprModel by difference type values.

Definition at line 15 of file ThingSmartSceneConditionExprBuilder.h.

Method Documentation

◆ buildCalculateExprWithDpId:dpType:selectedValue: [1/4]

+ (ThingSmartSceneExprModel *) buildCalculateExprWithDpId: (NSString *)  dpId
dpType: (NSString *)  dpType
selectedValue: (id)  selectedValue 

Create a calculate condition's expression for device.

Parameters
dpIdThe dpId of device to be controlled.
dpTypeThe type of datapoint. You can only pass bool or enum.
selectedValueThe selected value for datapoint.

◆ buildCalculateExprWithDpId:dpType:selectedValue: [2/4]

+ (ThingSmartSceneExprModel *) buildCalculateExprWithDpId: (NSString *)  dpId
dpType: (NSString *)  dpType
selectedValue: (id)  selectedValue 

Create a calculate condition's expression for device.

Parameters
dpIdThe dpId of device to be controlled.
dpTypeThe type of datapoint. You can only pass bool or enum.
selectedValueThe selected value for datapoint.

◆ buildCalculateExprWithDpId:dpType:selectedValue: [3/4]

+ (ThingSmartSceneExprModel *) buildCalculateExprWithDpId: (NSString *)  dpId
dpType: (NSString *)  dpType
selectedValue: (id)  selectedValue 

Create a calculate condition's expression for device.

Parameters
dpIdThe dpId of device to be controlled.
dpTypeThe type of datapoint. You can only pass bool or enum.
selectedValueThe selected value for datapoint.

◆ buildCalculateExprWithDpId:dpType:selectedValue: [4/4]

+ (ThingSmartSceneExprModel *) buildCalculateExprWithDpId: (NSString *)  dpId
dpType: (NSString *)  dpType
selectedValue: (id)  selectedValue 

Create a calculate condition's expression for device.

Parameters
dpIdThe dpId of device to be controlled.
dpTypeThe type of datapoint. You can only pass bool or enum.
selectedValueThe selected value for datapoint.

◆ buildGeofenceExprWithType: [1/4]

+ (ThingSmartSceneExprModel *) buildGeofenceExprWithType: (GeoFenceType)  type

create a geofence condition's expression.

Parameters
typeThe geofence type.
Returns
A ThingSmartExprModel object.

◆ buildGeofenceExprWithType: [2/4]

+ (ThingSmartSceneExprModel *) buildGeofenceExprWithType: (GeoFenceType)  type

create a geofence condition's expression.

Parameters
typeThe geofence type.
Returns
A ThingSmartExprModel object.

◆ buildGeofenceExprWithType: [3/4]

+ (ThingSmartSceneExprModel *) buildGeofenceExprWithType: (GeoFenceType)  type

create a geofence condition's expression.

Parameters
typeThe geofence type.
Returns
A ThingSmartExprModel object.

◆ buildGeofenceExprWithType: [4/4]

+ (ThingSmartSceneExprModel *) buildGeofenceExprWithType: (GeoFenceType)  type

create a geofence condition's expression.

Parameters
typeThe geofence type.
Returns
A ThingSmartExprModel object.

◆ buildMemberBackHomeExprWithMemberIds: [1/4]

+ (ThingSmartSceneExprModel *) buildMemberBackHomeExprWithMemberIds: (NSString *)  memberIds

Generate member back to home condition's expression.

Parameters
memberIdsAll the name of member, separated by a comma.
Returns
Expression object, additional data be required in member back to home condition.

◆ buildMemberBackHomeExprWithMemberIds: [2/4]

+ (ThingSmartSceneExprModel *) buildMemberBackHomeExprWithMemberIds: (NSString *)  memberIds

Generate member back to home condition's expression.

Parameters
memberIdsAll the name of member, separated by a comma.
Returns
Expression object, additional data be required in member back to home condition.

◆ buildMemberBackHomeExprWithMemberIds: [3/4]

+ (ThingSmartSceneExprModel *) buildMemberBackHomeExprWithMemberIds: (NSString *)  memberIds

Generate member back to home condition's expression.

Parameters
memberIdsAll the name of member, separated by a comma.
Returns
Expression object, additional data be required in member back to home condition.

◆ buildMemberBackHomeExprWithMemberIds: [4/4]

+ (ThingSmartSceneExprModel *) buildMemberBackHomeExprWithMemberIds: (NSString *)  memberIds

Generate member back to home condition's expression.

Parameters
memberIdsAll the name of member, separated by a comma.
Returns
Expression object, additional data be required in member back to home condition.

◆ createBoolExprWithType:isTrue:exprType: [1/4]

+ (ThingSmartSceneExprModel *) createBoolExprWithType: (NSString *)  type
isTrue: (BOOL)  isTrue
exprType: (ExprType)  exprType 

Create a exprModel with bool value and condition type.

Parameters
typeWhether type or device's dpId.
isTrueBOOL value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createBoolExprWithType:isTrue:exprType: [2/4]

+ (ThingSmartSceneExprModel *) createBoolExprWithType: (NSString *)  type
isTrue: (BOOL)  isTrue
exprType: (ExprType)  exprType 

Create a exprModel with bool value and condition type.

Parameters
typeWhether type or device's dpId.
isTrueBOOL value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createBoolExprWithType:isTrue:exprType: [3/4]

+ (ThingSmartSceneExprModel *) createBoolExprWithType: (NSString *)  type
isTrue: (BOOL)  isTrue
exprType: (ExprType)  exprType 

Create a exprModel with bool value and condition type.

Parameters
typeWhether type or device's dpId.
isTrueBOOL value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createBoolExprWithType:isTrue:exprType: [4/4]

+ (ThingSmartSceneExprModel *) createBoolExprWithType: (NSString *)  type
isTrue: (BOOL)  isTrue
exprType: (ExprType)  exprType 

Create a exprModel with bool value and condition type.

Parameters
typeWhether type or device's dpId.
isTrueBOOL value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createEnumExprWithType:chooseValue:exprType: [1/4]

+ (ThingSmartSceneExprModel *) createEnumExprWithType: (NSString *)  type
chooseValue: (NSString *)  chooseValue
exprType: (ExprType)  exprType 

Create a exprModel with enum string value and condition type.

Parameters
typeWhether type or device's dpId.
chooseValueenum string value, get it in ThingSmartSceneDPModel.dpModel.property.range
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createEnumExprWithType:chooseValue:exprType: [2/4]

+ (ThingSmartSceneExprModel *) createEnumExprWithType: (NSString *)  type
chooseValue: (NSString *)  chooseValue
exprType: (ExprType)  exprType 

Create a exprModel with enum string value and condition type.

Parameters
typeWhether type or device's dpId.
chooseValueenum string value, get it in ThingSmartSceneDPModel.dpModel.property.range
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createEnumExprWithType:chooseValue:exprType: [3/4]

+ (ThingSmartSceneExprModel *) createEnumExprWithType: (NSString *)  type
chooseValue: (NSString *)  chooseValue
exprType: (ExprType)  exprType 

Create a exprModel with enum string value and condition type.

Parameters
typeWhether type or device's dpId.
chooseValueenum string value, get it in ThingSmartSceneDPModel.dpModel.property.range
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createEnumExprWithType:chooseValue:exprType: [4/4]

+ (ThingSmartSceneExprModel *) createEnumExprWithType: (NSString *)  type
chooseValue: (NSString *)  chooseValue
exprType: (ExprType)  exprType 

Create a exprModel with enum string value and condition type.

Parameters
typeWhether type or device's dpId.
chooseValueenum string value, get it in ThingSmartSceneDPModel.dpModel.property.range
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createRawExprWithType:exprType: [1/4]

+ (ThingSmartSceneExprModel *) createRawExprWithType: (NSString *)  type
exprType: (ExprType)  exprType 

Create exprModel like "rawType".

Parameters
typeWhether type or device's dpId.
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createRawExprWithType:exprType: [2/4]

+ (ThingSmartSceneExprModel *) createRawExprWithType: (NSString *)  type
exprType: (ExprType)  exprType 

Create exprModel like "rawType".

Parameters
typeWhether type or device's dpId.
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createRawExprWithType:exprType: [3/4]

+ (ThingSmartSceneExprModel *) createRawExprWithType: (NSString *)  type
exprType: (ExprType)  exprType 

Create exprModel like "rawType".

Parameters
typeWhether type or device's dpId.
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createRawExprWithType:exprType: [4/4]

+ (ThingSmartSceneExprModel *) createRawExprWithType: (NSString *)  type
exprType: (ExprType)  exprType 

Create exprModel like "rawType".

Parameters
typeWhether type or device's dpId.
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createSunsetriseTimerExprWithCity:type:deltaMinutes: [1/4]

+ (ThingSmartSceneExprModel *) createSunsetriseTimerExprWithCity: (ThingSmartCityModel *)  city
type: (SunType)  type
deltaMinutes: (NSInteger)  minutes 

Create a timer condition's expression related to sunrise or sunset times, For example, "x minutes before sunrise". "at sunrise" is still handled as a normal weather condition.

Parameters
cityCity that needs to be set.
typeIdentify sunrise or sunset.
minutesFrom -300 minutes to 300 minutes.
Returns
A ThingSmartSceneExprModel object.

◆ createSunsetriseTimerExprWithCity:type:deltaMinutes: [2/4]

+ (ThingSmartSceneExprModel *) createSunsetriseTimerExprWithCity: (ThingSmartCityModel *)  city
type: (SunType)  type
deltaMinutes: (NSInteger)  minutes 

Create a timer condition's expression related to sunrise or sunset times, For example, "x minutes before sunrise". "at sunrise" is still handled as a normal weather condition.

Parameters
cityCity that needs to be set.
typeIdentify sunrise or sunset.
minutesFrom -300 minutes to 300 minutes.
Returns
A ThingSmartSceneExprModel object.

◆ createSunsetriseTimerExprWithCity:type:deltaMinutes: [3/4]

+ (ThingSmartSceneExprModel *) createSunsetriseTimerExprWithCity: (ThingSmartCityModel *)  city
type: (SunType)  type
deltaMinutes: (NSInteger)  minutes 

Create a timer condition's expression related to sunrise or sunset times, For example, "x minutes before sunrise". "at sunrise" is still handled as a normal weather condition.

Parameters
cityCity that needs to be set.
typeIdentify sunrise or sunset.
minutesFrom -300 minutes to 300 minutes.
Returns
A ThingSmartSceneExprModel object.

◆ createSunsetriseTimerExprWithCity:type:deltaMinutes: [4/4]

+ (ThingSmartSceneExprModel *) createSunsetriseTimerExprWithCity: (ThingSmartCityModel *)  city
type: (SunType)  type
deltaMinutes: (NSInteger)  minutes 

Create a timer condition's expression related to sunrise or sunset times, For example, "x minutes before sunrise". "at sunrise" is still handled as a normal weather condition.

Parameters
cityCity that needs to be set.
typeIdentify sunrise or sunset.
minutesFrom -300 minutes to 300 minutes.
Returns
A ThingSmartSceneExprModel object.

◆ createTimerExprWithTimeZoneId:loops:date:time: [1/4]

+ (ThingSmartSceneExprModel *) createTimerExprWithTimeZoneId: (NSString *)  timeZoneId
loops: (NSString *)  loops
date: (NSString *)  date
time: (NSString *)  time 

Create timer condition.

Parameters
timeZoneIdtimeZoneId like "Asia/Shanghai". @param loops eg: @"0111110", each character represent from Sunday to Monday. @"0000000" represent only once. @param date eg: @"20190501". @param time eg: @"20:40".
Returns
A ThingSmartSceneExprModel object.

◆ createTimerExprWithTimeZoneId:loops:date:time: [2/4]

+ (ThingSmartSceneExprModel *) createTimerExprWithTimeZoneId: (NSString *)  timeZoneId
loops: (NSString *)  loops
date: (NSString *)  date
time: (NSString *)  time 

Create timer condition.

Parameters
timeZoneIdtimeZoneId like "Asia/Shanghai". @param loops eg: @"0111110", each character represent from Sunday to Monday. @"0000000" represent only once. @param date eg: @"20190501". @param time eg: @"20:40".
Returns
A ThingSmartSceneExprModel object.

◆ createTimerExprWithTimeZoneId:loops:date:time: [3/4]

+ (ThingSmartSceneExprModel *) createTimerExprWithTimeZoneId: (NSString *)  timeZoneId
loops: (NSString *)  loops
date: (NSString *)  date
time: (NSString *)  time 

Create timer condition.

Parameters
timeZoneIdtimeZoneId like "Asia/Shanghai". @param loops eg: @"0111110", each character represent from Sunday to Monday. @"0000000" represent only once. @param date eg: @"20190501". @param time eg: @"20:40".
Returns
A ThingSmartSceneExprModel object.

◆ createTimerExprWithTimeZoneId:loops:date:time: [4/4]

+ (ThingSmartSceneExprModel *) createTimerExprWithTimeZoneId: (NSString *)  timeZoneId
loops: (NSString *)  loops
date: (NSString *)  date
time: (NSString *)  time 

Create timer condition.

Parameters
timeZoneIdtimeZoneId like "Asia/Shanghai". @param loops eg: @"0111110", each character represent from Sunday to Monday. @"0000000" represent only once. @param date eg: @"20190501". @param time eg: @"20:40".
Returns
A ThingSmartSceneExprModel object.

◆ createValueExprWithType:operater:chooseValue:exprType: [1/4]

+ (ThingSmartSceneExprModel *) createValueExprWithType: (NSString *)  type
operater: (NSString *)  operateString
chooseValue: (NSInteger)  value
exprType: (ExprType)  exprType 

Create exprModel like "temp <= 40".

Parameters
typeWhether type or device's dpId.
operateString">=",@"<=",@"=="
valueselected value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createValueExprWithType:operater:chooseValue:exprType: [2/4]

+ (ThingSmartSceneExprModel *) createValueExprWithType: (NSString *)  type
operater: (NSString *)  operateString
chooseValue: (NSInteger)  value
exprType: (ExprType)  exprType 

Create exprModel like "temp <= 40".

Parameters
typeWhether type or device's dpId.
operateString">=",@"<=",@"=="
valueselected value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createValueExprWithType:operater:chooseValue:exprType: [3/4]

+ (ThingSmartSceneExprModel *) createValueExprWithType: (NSString *)  type
operater: (NSString *)  operateString
chooseValue: (NSInteger)  value
exprType: (ExprType)  exprType 

Create exprModel like "temp <= 40".

Parameters
typeWhether type or device's dpId.
operateString">=",@"<=",@"=="
valueselected value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

◆ createValueExprWithType:operater:chooseValue:exprType: [4/4]

+ (ThingSmartSceneExprModel *) createValueExprWithType: (NSString *)  type
operater: (NSString *)  operateString
chooseValue: (NSInteger)  value
exprType: (ExprType)  exprType 

Create exprModel like "temp <= 40".

Parameters
typeWhether type or device's dpId.
operateString">=",@"<=",@"=="
valueselected value
exprTypeTo distinguish the entity type.
Returns
A ThingSmartSceneExprModel object.

The documentation for this class was generated from the following files: