Describes the Type of a State from Device. More...
Header: | #include <StateType> |
StateType(const StateTypeId & id) | |
bool | cached() const |
QVariant | defaultValue() const |
QString | displayName() const |
StateTypeId | id() const |
int | index() const |
QVariant | maxValue() const |
QVariant | minValue() const |
QString | name() const |
QVariantList | possibleValues() const |
void | setCached(bool cached) |
void | setDefaultValue(const QVariant & defaultValue) |
void | setDisplayName(const QString & displayName) |
void | setIndex(const int & index) |
void | setMaxValue(const QVariant & maxValue) |
void | setMinValue(const QVariant & minValue) |
void | setName(const QString & name) |
void | setPossibleValues(const QVariantList & possibleValues) |
void | setType(const QVariant::Type & type) |
void | setUnit(const Types::Unit & unit) |
QVariant::Type | type() const |
Types::Unit | unit() const |
QStringList | mandatoryTypeProperties() |
QStringList | typeProperties() |
See also State and StateDescriptor.
Constructs a StateType with the given id. When creating a DevicePlugin generate a new uuid for each StateType you define and hardcode it into the plugin json file.
Returns true if this StateType is to be cached. This means, the last state value will be stored to disk upon shutdown and restored on reboot. If this is false, states will be initialized with the default value on each boot. By default all states are cached by the system.
See also setCached().
Returns the default value of this StateType (e.g. 21.5).
See also setDefaultValue().
Returns the displayName of the StateType. This is visible to the user (e.g. "Color temperature").
See also setDisplayName().
Returns the id of the StateType.
Returns the index of this StateType. The index of an StateType indicates the order in the DeviceClass. This guarantees that a Device will look always the same (State order).
See also setIndex().
[static]
QStringList StateType::mandatoryTypeProperties()Returns a list of mandatory properties a DeviceClass definition must have.
Returns the maximum value of this StateType. If this value is not set, the QVariant will be invalid.
See also setMaxValue().
Returns the minimum value of this StateType. If this value is not set, the QVariant will be invalid.
See also setMinValue().
Returns the name of the StateType. This is used internally, e.g. to match interfaces.
See also setName().
Returns the list of possible values of this StateType. If the list is empty or invalid the State value can take every value.
See also setPossibleValues().
Sets whether this StateType should be cached or not. If a state value gets cached, the state will be initialized with the cached value on start.
See also cached().
Set the default value of this StateType to defaultValue (e.g. 21.5).
See also defaultValue().
Set the displayName of the StateType to displayName. This is visible to the user (e.g. "Color temperature").
See also displayName().
Set the index of this StateType.
See also index().
Set the maximum value of this StateType to maxValue. If this value is not set, there is now upper limit.
See also maxValue().
Set the minimum value of this StateType to minValue. If this value is not set, there is now lower limit.
See also minValue().
Set the name of the StateType to name. This is used internally, e.g. to match interfaces.
See also name().
Set the list of possible values of this StateType to possibleValues.
See also possibleValues().
Set the type fo the StateType to type (e.g. QVariant::Real).
See also type().
Sets the unit of this StateType to the given unit.
See also unit().
Returns the Type of the StateType (e.g. QVariant::Real).
See also setType().
[static]
QStringList StateType::typeProperties()Returns a list of all valid properties a DeviceClass definition can have.
Returns the unit of this StateType.
See also setUnit().