bump version
bump api version update StateType
This commit is contained in:
parent
33af5fb5d5
commit
057c1cf065
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
|||||||
|
guh (0.7.0) wily; urgency=medium
|
||||||
|
|
||||||
|
* Add CoAP
|
||||||
|
* Add OAuth2
|
||||||
|
* Parent/child device relation
|
||||||
|
|
||||||
|
-- Simon Stürz <simon.stuerz@guh.guru> Mon, 30 Nov 2015 11:29:03 +0100
|
||||||
|
|
||||||
guh (0.6.0) vivid; urgency=medium
|
guh (0.6.0) vivid; urgency=medium
|
||||||
|
|
||||||
* Add websocket server
|
* Add websocket server
|
||||||
|
|||||||
2
guh.pri
2
guh.pri
@ -2,7 +2,7 @@
|
|||||||
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
|
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
|
||||||
|
|
||||||
# define protocol versions
|
# define protocol versions
|
||||||
JSON_PROTOCOL_VERSION=32
|
JSON_PROTOCOL_VERSION=33
|
||||||
REST_API_VERSION=1
|
REST_API_VERSION=1
|
||||||
|
|
||||||
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \
|
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \
|
||||||
|
|||||||
19
guh.pro
19
guh.pro
@ -34,6 +34,8 @@ test.commands = LD_LIBRARY_PATH=$$top_builddir/libguh:$$top_builddir/tests/libgu
|
|||||||
|
|
||||||
QMAKE_EXTRA_TARGETS += licensecheck doc test
|
QMAKE_EXTRA_TARGETS += licensecheck doc test
|
||||||
|
|
||||||
|
# Inform about guh build
|
||||||
|
message(============================================)
|
||||||
message(Qt version: $$[QT_VERSION])
|
message(Qt version: $$[QT_VERSION])
|
||||||
message("Building guh version $${GUH_VERSION_STRING}")
|
message("Building guh version $${GUH_VERSION_STRING}")
|
||||||
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION}")
|
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION}")
|
||||||
@ -43,6 +45,23 @@ coverage {
|
|||||||
message("Building coverage.")
|
message("Building coverage.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Build tests
|
||||||
|
!disabletesting {
|
||||||
|
message("Building guh with tests")
|
||||||
|
SUBDIRS += tests
|
||||||
|
DEFINES += TESTING_ENABLED
|
||||||
|
} else {
|
||||||
|
message("Building guh without tests")
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bluetooth LE support
|
||||||
|
contains(DEFINES, BLUETOOTH_LE) {
|
||||||
|
message("Bluetooth LE enabled.")
|
||||||
|
} else {
|
||||||
|
message("Bluetooth LE disabled (Qt $${QT_VERSION} < 5.4.0).")
|
||||||
|
}
|
||||||
|
|
||||||
|
# Websocket support
|
||||||
contains(DEFINES, WEBSOCKET){
|
contains(DEFINES, WEBSOCKET){
|
||||||
message("Building guh with websocket.")
|
message("Building guh with websocket.")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -147,7 +147,7 @@ QList<QVariant> ParamType::allowedValues() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! Sets the list of the allowed values of this ParamType to the given List of \a allowedValues. */
|
/*! Sets the list of the allowed values of this ParamType to the given List of \a allowedValues. */
|
||||||
void ParamType::setAllowedValues(const QList<QVariant> allowedValues)
|
void ParamType::setAllowedValues(const QList<QVariant> &allowedValues)
|
||||||
{
|
{
|
||||||
m_allowedValues = allowedValues;
|
m_allowedValues = allowedValues;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public:
|
|||||||
void setLimits(const QVariant &min, const QVariant &max);
|
void setLimits(const QVariant &min, const QVariant &max);
|
||||||
|
|
||||||
QList<QVariant> allowedValues() const;
|
QList<QVariant> allowedValues() const;
|
||||||
void setAllowedValues(const QList<QVariant> allowedValues);
|
void setAllowedValues(const QList<QVariant> &allowedValues);
|
||||||
|
|
||||||
bool readOnly() const;
|
bool readOnly() const;
|
||||||
void setReadOnly(const bool &readOnly);
|
void setReadOnly(const bool &readOnly);
|
||||||
|
|||||||
@ -36,6 +36,10 @@
|
|||||||
* hardcode it into the plugin. */
|
* hardcode it into the plugin. */
|
||||||
StateType::StateType(const StateTypeId &id):
|
StateType::StateType(const StateTypeId &id):
|
||||||
m_id(id),
|
m_id(id),
|
||||||
|
m_defaultValue(QVariant()),
|
||||||
|
m_minValue(QVariant()),
|
||||||
|
m_maxValue(QVariant()),
|
||||||
|
m_possibleValues(QVariantList()),
|
||||||
m_unit(Types::UnitNone)
|
m_unit(Types::UnitNone)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -83,6 +87,45 @@ void StateType::setDefaultValue(const QVariant &defaultValue)
|
|||||||
m_defaultValue = defaultValue;
|
m_defaultValue = defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! Returns the minimum value of this StateType. If this value is not set, the QVariant will be invalid. */
|
||||||
|
QVariant StateType::minValue() const
|
||||||
|
{
|
||||||
|
return m_minValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! Set the minimum value of this StateType to \a minValue. If this value is not set,
|
||||||
|
* there is now lower limit. */
|
||||||
|
void StateType::setMinValue(const QVariant &minValue)
|
||||||
|
{
|
||||||
|
m_minValue = minValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! Returns the maximum value of this StateType. If this value is not set, the QVariant will be invalid. */
|
||||||
|
QVariant StateType::maxValue() const
|
||||||
|
{
|
||||||
|
return m_maxValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! Set the maximum value of this StateType to \a maxValue. If this value is not set,
|
||||||
|
* there is now upper limit. */
|
||||||
|
void StateType::setMaxValue(const QVariant &maxValue)
|
||||||
|
{
|
||||||
|
m_maxValue = maxValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! Returns the list of possible values of this StateType. If the list is empty or invalid the \l{State} value can take every value. */
|
||||||
|
QVariantList StateType::possibleValues() const
|
||||||
|
{
|
||||||
|
return m_possibleValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*! Set the list of possible values of this StateType to \a possibleValues. */
|
||||||
|
void StateType::setPossibleValues(const QVariantList &possibleValues)
|
||||||
|
{
|
||||||
|
m_possibleValues = possibleValues;
|
||||||
|
}
|
||||||
|
|
||||||
/*! Returns the unit of this StateType. */
|
/*! Returns the unit of this StateType. */
|
||||||
Types::Unit StateType::unit() const
|
Types::Unit StateType::unit() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,6 +42,15 @@ public:
|
|||||||
QVariant defaultValue() const;
|
QVariant defaultValue() const;
|
||||||
void setDefaultValue(const QVariant &defaultValue);
|
void setDefaultValue(const QVariant &defaultValue);
|
||||||
|
|
||||||
|
QVariant minValue() const;
|
||||||
|
void setMinValue(const QVariant &minValue);
|
||||||
|
|
||||||
|
QVariant maxValue() const;
|
||||||
|
void setMaxValue(const QVariant &maxValue);
|
||||||
|
|
||||||
|
QVariantList possibleValues() const;
|
||||||
|
void setPossibleValues(const QVariantList &possibleValues);
|
||||||
|
|
||||||
Types::Unit unit() const;
|
Types::Unit unit() const;
|
||||||
void setUnit(const Types::Unit &unit);
|
void setUnit(const Types::Unit &unit);
|
||||||
|
|
||||||
@ -50,6 +59,9 @@ private:
|
|||||||
QString m_name;
|
QString m_name;
|
||||||
QVariant::Type m_type;
|
QVariant::Type m_type;
|
||||||
QVariant m_defaultValue;
|
QVariant m_defaultValue;
|
||||||
|
QVariant m_minValue;
|
||||||
|
QVariant m_maxValue;
|
||||||
|
QVariantList m_possibleValues;
|
||||||
Types::Unit m_unit;
|
Types::Unit m_unit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -130,6 +130,9 @@ void JsonTypes::init()
|
|||||||
s_stateType.insert("type", basicTypeRef());
|
s_stateType.insert("type", basicTypeRef());
|
||||||
s_stateType.insert("defaultValue", basicTypeToString(Variant));
|
s_stateType.insert("defaultValue", basicTypeToString(Variant));
|
||||||
s_stateType.insert("o:unit", unitRef());
|
s_stateType.insert("o:unit", unitRef());
|
||||||
|
s_stateType.insert("o:minValue", basicTypeToString(Variant));
|
||||||
|
s_stateType.insert("o:maxValue", basicTypeToString(Variant));
|
||||||
|
s_stateType.insert("o:possibleValues", QVariantList() << basicTypeToString(Variant));
|
||||||
|
|
||||||
// State
|
// State
|
||||||
s_state.insert("stateTypeId", basicTypeToString(Uuid));
|
s_state.insert("stateTypeId", basicTypeToString(Uuid));
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
32
|
33
|
||||||
{
|
{
|
||||||
"methods": {
|
"methods": {
|
||||||
"Actions.ExecuteAction": {
|
"Actions.ExecuteAction": {
|
||||||
@ -798,6 +798,11 @@
|
|||||||
"defaultValue": "Variant",
|
"defaultValue": "Variant",
|
||||||
"id": "Uuid",
|
"id": "Uuid",
|
||||||
"name": "String",
|
"name": "String",
|
||||||
|
"o:maxValue": "Variant",
|
||||||
|
"o:minValue": "Variant",
|
||||||
|
"o:possibleValues": [
|
||||||
|
"Variant"
|
||||||
|
],
|
||||||
"o:unit": "$ref:Unit",
|
"o:unit": "$ref:Unit",
|
||||||
"type": "$ref:BasicType"
|
"type": "$ref:BasicType"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user