• DeviceClass
  • DeviceClass Class

    Describes Devices. More...

    Header: #include <DeviceClass>

    Public Types

    enum BasicTag { BasicTagService, BasicTagDevice, BasicTagSensor, BasicTagActuator, ..., BasicTagLock }
    enum CreateMethod { CreateMethodUser, CreateMethodAuto, CreateMethodDiscovery }
    flags CreateMethods
    enum DeviceIcon { DeviceIconNone, DeviceIconBed, DeviceIconBlinds, DeviceIconCeilingLamp, ..., DeviceIconRollerShutter }
    enum SetupMethod { SetupMethodJustAdd, SetupMethodDisplayPin, SetupMethodEnterPin, SetupMethodPushButton }

    Public Functions

    DeviceClass(const PluginId & pluginId = PluginId(), const VendorId & vendorId = VendorId(), const DeviceClassId & id = DeviceClassId())
    ActionTypes actionTypes() const
    QList<BasicTag> basicTags() const
    CreateMethods createMethods() const
    StateTypeId criticalStateTypeId() const
    DeviceIcon deviceIcon() const
    QList<ParamType> discoveryParamTypes() const
    QString displayName() const
    EventTypes eventTypes() const
    StateType getStateType(const StateTypeId & stateTypeId)
    bool hasActionType(const ActionTypeId & actionTypeId)
    bool hasEventType(const EventTypeId & eventTypeId)
    bool hasStateType(const StateTypeId & stateTypeId)
    DeviceClassId id() const
    QStringList interfaces() const
    bool isValid() const
    QString name() const
    QString pairingInfo() const
    QList<ParamType> paramTypes() const
    PluginId pluginId() const
    ActionTypeId primaryActionTypeId() const
    StateTypeId primaryStateTypeId() const
    void setActionTypes(const QList<ActionType> & actionTypes)
    void setBasicTags(const QList<BasicTag> & basicTags)
    void setCreateMethods(CreateMethods createMethods)
    void setCriticalStateTypeId(const StateTypeId & criticalStateTypeId)
    void setDeviceIcon(const DeviceIcon & deviceIcon)
    void setDiscoveryParamTypes(const QList<ParamType> & params)
    void setDisplayName(const QString & displayName)
    void setEventTypes(const QList<EventType> & eventTypes)
    void setInterfaces(const QStringList & interfaces)
    void setName(const QString & name)
    void setPairingInfo(const QString & pairingInfo)
    void setParamTypes(const QList<ParamType> & params)
    void setPrimaryActionTypeId(const ActionTypeId & primaryActionTypeId)
    void setPrimaryStateTypeId(const StateTypeId & primaryStateTypeId)
    void setSetupMethod(SetupMethod setupMethod)
    void setStateTypes(const QList<StateType> & stateTypes)
    SetupMethod setupMethod() const
    StateTypes stateTypes() const
    VendorId vendorId() const
    bool operator==(const DeviceClass & deviceClass) const

    Static Public Members

    QStringList mandatoryTypeProperties()
    QStringList typeProperties()

    Detailed Description

    Describes Devices.

    It holds information general information about devices and their vendors and describes what actions, events and states a device supports. As this is just a description of device and does not represent actual Devices, the actions, events and states are described in form of EventType, StateType and ActionType

    See also Device.

    Member Type Documentation

    enum DeviceClass::BasicTag

    This enum type specifies the basic tags which describe the categories of the DeviceClass. A DeviceClass can have multiple tags.

    ConstantValueDescription
    DeviceClass::BasicTagService0The DeviceClass describes a service.
    DeviceClass::BasicTagDevice1The DeviceClass describes a real device.
    DeviceClass::BasicTagSensor2The DeviceClass describes a sensor. Any device which can measure or detect something is a sensor.
    DeviceClass::BasicTagActuator3The DeviceClass describes an actuator. Any device which can do something is an actuator.
    DeviceClass::BasicTagLighting4The DeviceClass describes a lighting device.
    DeviceClass::BasicTagEnergy5The DeviceClass describes an energy device.
    DeviceClass::BasicTagMultimedia6The DeviceClass describes a multimedia device/service.
    DeviceClass::BasicTagWeather7The DeviceClass describes a weather device/service.
    DeviceClass::BasicTagGateway8The DeviceClass describes a gateway device.
    DeviceClass::BasicTagHeating9The DeviceClass describes a heating device.
    DeviceClass::BasicTagCooling10The DeviceClass describes a cooling device.
    DeviceClass::BasicTagNotification11The DeviceClass describes a notification service.
    DeviceClass::BasicTagSecurity12The DeviceClass describes a security device/service.
    DeviceClass::BasicTagTime13The DeviceClass describes a time device/service.
    DeviceClass::BasicTagShading14The DeviceClass describes a shading device.
    DeviceClass::BasicTagAppliance15The DeviceClass describes an appliance.
    DeviceClass::BasicTagCamera16The DeviceClass describes a camera device.
    DeviceClass::BasicTagLock17The DeviceClass describes a lock device.

    enum DeviceClass::CreateMethod
    flags DeviceClass::CreateMethods

    This enum type specifies the CreateMethod of this DeviceClass

    ConstantValueDescription
    DeviceClass::CreateMethodUser0x01The user will specify the Params.
    DeviceClass::CreateMethodAuto0x02The device will be created automatically.
    DeviceClass::CreateMethodDiscovery0x04The device will be discovered and added by the user by selecting the DeviceDescriptorId from the list of discovered possible ones.

    The CreateMethods type is a typedef for QFlags<CreateMethod>. It stores an OR combination of CreateMethod values.

    enum DeviceClass::DeviceIcon

    This enum type specifies the default device icon of the DeviceClass. Each client should have an icon set containing this list of icon types. If a client want's to offer special icons for a special DeviceClass or device type, he can bring it's own icon for a special DeviceClassId. If there is no special icon defined, he can fallback to the default icon.

    ConstantValueDescription
    DeviceClass::DeviceIconNone0 
    DeviceClass::DeviceIconBed1 
    DeviceClass::DeviceIconBlinds2 
    DeviceClass::DeviceIconCeilingLamp3 
    DeviceClass::DeviceIconCouch4 
    DeviceClass::DeviceIconDeskLamp5 
    DeviceClass::DeviceIconDesk6 
    DeviceClass::DeviceIconHifi7 
    DeviceClass::DeviceIconPower8 
    DeviceClass::DeviceIconEnergy9 
    DeviceClass::DeviceIconRadio10 
    DeviceClass::DeviceIconSmartPhone11 
    DeviceClass::DeviceIconSocket12 
    DeviceClass::DeviceIconStandardLamp13 
    DeviceClass::DeviceIconSun14 
    DeviceClass::DeviceIconTablet15 
    DeviceClass::DeviceIconThermometer16 
    DeviceClass::DeviceIconTune17 
    DeviceClass::DeviceIconTv18 
    DeviceClass::DeviceIconBattery19 
    DeviceClass::DeviceIconDishwasher20 
    DeviceClass::DeviceIconWashingMachine21 
    DeviceClass::DeviceIconLaundryDryer22 
    DeviceClass::DeviceIconIrHeater23 
    DeviceClass::DeviceIconRadiator24 
    DeviceClass::DeviceIconSwitch25 
    DeviceClass::DeviceIconMotionDetectors26 
    DeviceClass::DeviceIconWeather27 
    DeviceClass::DeviceIconTime28 
    DeviceClass::DeviceIconLightBulb29 
    DeviceClass::DeviceIconGateway30 
    DeviceClass::DeviceIconMail31 
    DeviceClass::DeviceIconNetwork32 
    DeviceClass::DeviceIconCloud33 
    DeviceClass::DeviceIconGarage34,
    DeviceClass::DeviceIconRollerShutter35 

    enum DeviceClass::SetupMethod

    This enum type specifies the SetupMethod of this DeviceClass

    ConstantValueDescription
    DeviceClass::SetupMethodJustAdd0The Device will be just added. This is the default value.
    DeviceClass::SetupMethodDisplayPin1During the setup, a pin will be displayed on the Device. The pin will be needed in order to pair the device.
    DeviceClass::SetupMethodEnterPin2During the setup, a pin will be needed in order to pair the Device.
    DeviceClass::SetupMethodPushButton3During the setup, a button has to be pushed in order to pair the Device.

    Member Function Documentation

    DeviceClass::DeviceClass(const PluginId & pluginId = PluginId(), const VendorId & vendorId = VendorId(), const DeviceClassId & id = DeviceClassId())

    Constructs a DeviceClass with the give pluginId ,vendorId and id . When implementing a plugin, create a DeviceClass for each device you support. Generate a new uuid (e.g. uuidgen) and hardode it into the plugin. The id should never change or it will appear as a new DeviceClass in the system.

    ActionTypes DeviceClass::actionTypes() const

    Returns the actionTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also setActionTypes().

    QList<BasicTag> DeviceClass::basicTags() const

    Returns the list of basicTags of this DeviceClass.

    See also setBasicTags() and DeviceClass::BasicTag.

    CreateMethods DeviceClass::createMethods() const

    Returns the DeviceClass::CreateMethods of this DeviceClass.

    See also setCreateMethods().

    StateTypeId DeviceClass::criticalStateTypeId() const

    Returns the critical StateTypeId of this DeviceClass. A critical State describes the state which disables the whole device (i.e. connected, available or reachable).

    See also setCriticalStateTypeId().

    DeviceIcon DeviceClass::deviceIcon() const

    Returns the default DeviceIcon of this DeviceClass.

    See also setDeviceIcon().

    QList<ParamType> DeviceClass::discoveryParamTypes() const

    Returns the discovery params description of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their params matching to this template.

    See also setDiscoveryParamTypes().

    QString DeviceClass::displayName() const

    Returns the displayed name of this DeviceClass. This is visible to the user.

    See also setDisplayName().

    EventTypes DeviceClass::eventTypes() const

    Returns the eventTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their events matching to this template.

    See also setEventTypes().

    StateType DeviceClass::getStateType(const StateTypeId & stateTypeId)

    Returns the StateType with the given stateTypeId of this DeviceClass. If there is no matching StateType, an invalid StateType will be returned.

    bool DeviceClass::hasActionType(const ActionTypeId & actionTypeId)

    Returns true if this DeviceClass has a ActionType with the given actionTypeId.

    bool DeviceClass::hasEventType(const EventTypeId & eventTypeId)

    Returns true if this DeviceClass has a EventType with the given eventTypeId.

    bool DeviceClass::hasStateType(const StateTypeId & stateTypeId)

    Returns true if this DeviceClass has a StateType with the given stateTypeId.

    DeviceClassId DeviceClass::id() const

    Returns the id of this DeviceClass.

    QStringList DeviceClass::interfaces() const

    Returns the interfaces of this DeviceClass.

    See also setInterfaces().

    bool DeviceClass::isValid() const

    Returns true if this DeviceClass id, vendorId and pluginId are valid uuids.

    [static] QStringList DeviceClass::mandatoryTypeProperties()

    Returns a list of mandatory JSON properties a DeviceClass JSON definition must have.

    QString DeviceClass::name() const

    Returns the name of this DeviceClass. This is visible to the user.

    See also setName().

    QString DeviceClass::pairingInfo() const

    Returns the pairing information of this DeviceClass.

    See also setPairingInfo().

    QList<ParamType> DeviceClass::paramTypes() const

    Returns the params description of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their params matching to this template.

    See also setParamTypes().

    PluginId DeviceClass::pluginId() const

    Returns the pluginId this DeviceClass is managed by.

    ActionTypeId DeviceClass::primaryActionTypeId() const

    Returns the primary ActionTypeId of this DeviceClass.

    See also setPrimaryActionTypeId().

    StateTypeId DeviceClass::primaryStateTypeId() const

    Returns the primary StateTypeId of this DeviceClass.

    See also setPrimaryStateTypeId().

    void DeviceClass::setActionTypes(const QList<ActionType> & actionTypes)

    Set the actionTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also actionTypes().

    void DeviceClass::setBasicTags(const QList<BasicTag> & basicTags)

    Set the list of basicTags of this DeviceClass.

    See also basicTags().

    void DeviceClass::setCreateMethods(CreateMethods createMethods)

    Set the createMethods of this DeviceClass.

    See also createMethods() and CreateMethod.

    void DeviceClass::setCriticalStateTypeId(const StateTypeId & criticalStateTypeId)

    Set the criticalStateTypeId of this DeviceClass.

    See also criticalStateTypeId().

    void DeviceClass::setDeviceIcon(const DeviceIcon & deviceIcon)

    Set the deviceIcon of this DeviceClass.

    See also deviceIcon().

    void DeviceClass::setDiscoveryParamTypes(const QList<ParamType> & params)

    Set the params of this DeviceClass for the discovery. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also discoveryParamTypes().

    void DeviceClass::setDisplayName(const QString & displayName)

    Set the displayName of this DeviceClass. This is visible to the user.

    See also displayName().

    void DeviceClass::setEventTypes(const QList<EventType> & eventTypes)

    Set the eventTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their events matching to this template.

    See also eventTypes().

    void DeviceClass::setInterfaces(const QStringList & interfaces)

    Set the interfaces of this DeviceClass.

    Note: You can find information about interfaces here.

    See also interfaces().

    void DeviceClass::setName(const QString & name)

    Set the name of this DeviceClass. This is visible to the user.

    See also name().

    void DeviceClass::setPairingInfo(const QString & pairingInfo)

    Set the pairingInfo of this DeviceClass.

    See also pairingInfo().

    void DeviceClass::setParamTypes(const QList<ParamType> & params)

    Set the params of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also paramTypes().

    void DeviceClass::setPrimaryActionTypeId(const ActionTypeId & primaryActionTypeId)

    Set the primaryActionTypeId of this DeviceClass.

    See also primaryActionTypeId().

    void DeviceClass::setPrimaryStateTypeId(const StateTypeId & primaryStateTypeId)

    Set the primaryStateTypeId of this DeviceClass.

    See also primaryStateTypeId().

    void DeviceClass::setSetupMethod(SetupMethod setupMethod)

    Set the setupMethod of this DeviceClass.

    See also setupMethod() and SetupMethod.

    void DeviceClass::setStateTypes(const QList<StateType> & stateTypes)

    Set the stateTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their states matching to this template.

    See also stateTypes().

    SetupMethod DeviceClass::setupMethod() const

    Returns the DeviceClass::SetupMethod of this DeviceClass.

    StateTypes DeviceClass::stateTypes() const

    Returns the statesTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their states matching to this template.

    See also setStateTypes().

    [static] QStringList DeviceClass::typeProperties()

    Returns a list of all valid JSON properties a DeviceClass JSON definition can have.

    VendorId DeviceClass::vendorId() const

    Returns the VendorId for this DeviceClass

    bool DeviceClass::operator==(const DeviceClass & deviceClass) const

    Compare this deviceClass to another. This is effectively the same as calling a.id() == b.id(). Returns true if the ids match.