Header: | #include <DeviceClass> |
enum | CreateMethod { CreateMethodUser, CreateMethodAuto, CreateMethodDiscovery } |
flags | CreateMethods |
enum | SetupMethod { SetupMethodJustAdd, SetupMethodDisplayPin, SetupMethodEnterPin, SetupMethodPushButton } |
DeviceClass(const PluginId & pluginId = PluginId(), const VendorId & vendorId = VendorId(), const DeviceClassId & id = DeviceClassId()) | |
ActionTypes | actionTypes() const |
CreateMethods | createMethods() 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 |
void | setActionTypes(const QList<ActionType> & actionTypes) |
void | setCreateMethods(CreateMethods createMethods) |
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 | setSetupMethod(SetupMethod setupMethod) |
void | setStateTypes(const QList<StateType> & stateTypes) |
SetupMethod | setupMethod() const |
StateTypes | stateTypes() const |
VendorId | vendorId() const |
bool | operator==(const DeviceClass & deviceClass) const |
QStringList | mandatoryTypeProperties() |
QStringList | typeProperties() |
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.
This enum type specifies the CreateMethod of this DeviceClass
Constant | Value | Description |
---|---|---|
DeviceClass::CreateMethodUser | 0x01 | The user will specify the Params. |
DeviceClass::CreateMethodAuto | 0x02 | The device will be created automatically. |
DeviceClass::CreateMethodDiscovery | 0x04 | The 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.
This enum type specifies the SetupMethod of this DeviceClass
Constant | Value | Description |
---|---|---|
DeviceClass::SetupMethodJustAdd | 0 | The Device will be just added. This is the default value. |
DeviceClass::SetupMethodDisplayPin | 1 | During the setup, a pin will be displayed on the Device. The pin will be needed in order to pair the device. |
DeviceClass::SetupMethodEnterPin | 2 | During the setup, a pin will be needed in order to pair the Device. |
DeviceClass::SetupMethodPushButton | 3 | During the setup, a button has to be pushed in order to pair the Device. |
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.
Returns the actionTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.
See also setActionTypes().
Returns the DeviceClass::CreateMethods of this DeviceClass.
See also setCreateMethods().
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().
Returns the displayed name of this DeviceClass. This is visible to the user.
See also setDisplayName().
Returns the eventTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their events matching to this template.
See also setEventTypes().
Returns the StateType with the given stateTypeId of this DeviceClass. If there is no matching StateType, an invalid StateType will be returned.
Returns true if this DeviceClass has a ActionType with the given actionTypeId.
Returns true if this DeviceClass has a EventType with the given eventTypeId.
Returns true if this DeviceClass has a StateType with the given stateTypeId.
Returns the id of this DeviceClass.
Returns the interfaces of this DeviceClass.
See also setInterfaces().
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.
Returns the name of this DeviceClass. This is visible to the user.
See also setName().
Returns the pairing information of this DeviceClass.
See also setPairingInfo().
Returns the params description of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their params matching to this template.
See also setParamTypes().
Returns the pluginId this DeviceClass is managed by.
Set the actionTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.
See also actionTypes().
Set the createMethods of this DeviceClass.
See also createMethods() and CreateMethod.
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().
Set the displayName of this DeviceClass. This is visible to the user.
See also displayName().
Set the eventTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their events matching to this template.
See also eventTypes().
Set the interfaces of this DeviceClass.
Note: You can find information about interfaces here.
See also interfaces().
Set the name of this DeviceClass. This is visible to the user.
See also name().
Set the pairingInfo of this DeviceClass.
See also pairingInfo().
Set the params of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.
See also paramTypes().
Set the setupMethod of this DeviceClass.
See also setupMethod() and SetupMethod.
Set the stateTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their states matching to this template.
See also stateTypes().
Returns the DeviceClass::SetupMethod of this DeviceClass.
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.
Returns the VendorId for this DeviceClass
Compare this deviceClass to another. This is effectively the same as calling a.id() == b.id(). Returns true if the ids match.