// Generated by json_to_model

@import Foundation;


#import "JDJSONModel.h"
#import "ItemModel.h"

typedef NS_ENUM(NSInteger, CmdClsType) {
    CmdClsTypeFirmwareVersion = 0,
    CmdClsTypeSwitchBinary,
    CmdClsTypeSwitchMultiLevel,
    CmdClsTypeSwitchColor,
    CmdClsTypeSensorBinary,
    CmdClsTypeSensorMultiLevel,
    CmdClsTypeThermostatMode,
    CmdClsTypeThermostatFanMode,
    CmdClsTypeThermostatSetPoint,   //hold
    CmdClsTypeLock,
    CmdClsTypeMeterCurrent,
    CmdClsTypeMeterTotal,
    CmdClsTypeAVControlPlayback,   //12
    CmdClsTypeHomeMode,
    CmdClsTypeCameraStream,
    CmdClsTypeCameraPT,
    CmdClsTypeSpeedControl,
    CmdClsTypeMeterCurrentForDAWON, //17
    CmdClsTypeMeterTotalForDAWON,
};

#define ksDeviceTypeControllerPrimary @"CONTROLLER_PRIMARY"
#define ksDeviceTypeSlave @"SLAVE"

#define ksDeviceProfileIdUnknown @"20001"

@protocol CmdClsValueModel;
@interface CmdClsValueModel : JDJSONModel

@property (copy, nonatomic) NSString *cmdclsValue;
@property (copy, nonatomic) NSString *cmdclsValueMsg;

@end


@protocol DeviceModel;
@interface DeviceModel : ItemSubModel

@property (copy, nonatomic) NSString *deviceId;
@property (copy, nonatomic) NSString *deviceName;
@property (copy, nonatomic) NSString *deviceProfileId;
@property (copy, nonatomic) NSString *profileName;
@property (copy, nonatomic) NSString *imageFileName;
@property (copy, nonatomic) NSString *nodeId;
@property (copy, nonatomic) NSString *nodeName;
@property (copy, nonatomic) NSString *cmdclsTypeId;
@property (copy, nonatomic) NSString *cmdclsTypeName;
@property (copy, nonatomic) NSString *cmdclsTypeSystemName;
@property (copy, nonatomic) NSString *createDatetime;
@property (copy, nonatomic) NSString *updateDatetime;
@property (copy, nonatomic) NSString *cmdclsCode;
@property (copy, nonatomic) NSString *cmdclsCount;
@property (copy, nonatomic) NSString *contentValue;
@property (copy, nonatomic) NSString *networkYn;
@property (copy, nonatomic) NSString *deviceType;


//detail
@property (copy, nonatomic) NSString *prdName;
@property (copy, nonatomic) NSString *deviceModelId;
@property (copy, nonatomic) NSString *deviceMfId;
@property (copy, nonatomic) NSString *firmwareVersion;
@property (copy, nonatomic) NSString *deviceProtocolType;   //연결타입
@property (copy, nonatomic) NSString *removableYn;          //장치삭제 가능 여부
@property (copy, nonatomic) NSString *activationCode;       //장치 인증 코드

//predefine devices property
@property (copy, nonatomic) NSString *controlMinValue;
@property (copy, nonatomic) NSString *controlMaxValue;
@property (copy, nonatomic) NSString *controlStep;
@property (copy, nonatomic) NSString *unit;

//camera
@property (copy, nonatomic) NSString *ip;
@property (copy, nonatomic) NSString *port;
@property (copy, nonatomic) NSString *cameraId;
@property (copy, nonatomic) NSString *cameraPassword;

//Command
@property (copy, nonatomic) NSString *commandId;
@property (copy, nonatomic) NSString *status;


@property (copy, nonatomic) NSArray<CmdClsValueModel> *cmdclsValueList;

@property (assign, nonatomic) CmdClsType cmdclsType;
@property (assign, nonatomic) BOOL enable;
@property (assign, nonatomic, readonly) NSInteger cmdclsValueMsgLength;
@property (strong, nonatomic) NSString<Ignore> *cmdclsValueMsgLongest;

- (instancetype)initWithSubItem:(ItemSubModel *)subItem;

@end

@interface DeviceListModel : JDJSONModel
@property (copy, nonatomic) NSArray<DeviceModel> *list;
@end

@interface NodeModel : DeviceModel
//@property (copy, nonatomic) NSString *deviceId;
//@property (copy, nonatomic) NSString *nodeId;
//@property (copy, nonatomic) NSString *nodeName;
//@property (copy, nonatomic) NSString *cmdclsTypeId;
//@property (copy, nonatomic) NSString *cmdclsTypeName;
//@property (copy, nonatomic) NSString *cmdclsTypeSystemName;
//@property (copy, nonatomic) NSString *createDatetime;
//@property (copy, nonatomic) NSString *cmdclsCode;
//
//@property (assign, nonatomic) CmdClsType cmdclsType;

@end

@interface DeviceDetailModel : DeviceModel

@property (copy, nonatomic) NSArray<DeviceModel> *nodes;
@property (copy, nonatomic) NSArray<DeviceModel> *relateDevice;

@end


@protocol ItemModel;
@protocol PredefinedDeviceModel;
@interface PredefinedDeviceModel : DeviceModel

- (instancetype)initWithSubItem:(ItemSubModel *)subItem;
@end

@interface PredefinedDeviceListModel : JDJSONModel

@property (strong, nonatomic) NSArray<PredefinedDeviceModel> *list;

@end


@protocol GroupsModel;
@interface GroupsModel : JDJSONModel

@property (copy, nonatomic) NSString *dvcgrpId;
@property (copy, nonatomic) NSString *dvcgrpName;
@property (copy, nonatomic) NSString *deviceCount;
@property (copy, nonatomic) NSString *defaultYn;

@property (copy, nonatomic) NSArray<DeviceModel> *devices;

//UI용으로 사용
@property (assign, nonatomic) BOOL expanded;
@property (assign, nonatomic) BOOL unfold;

@end


@interface GroupsListModel : JDJSONModel

@property (copy, nonatomic) NSArray<GroupsModel> *groups;
@end

@protocol DeviceIconModel;
@interface DeviceIconModel : JDJSONModel

@property (copy, nonatomic) NSString *imageSequence;
@property (copy, nonatomic) NSString *imageFileName;

@end

@interface DeviceIconListModel : JDJSONModel

@property (copy, nonatomic) NSArray<DeviceIconModel> *list;

@end
