bump version

bump api version
update StateType
pull/135/head
Simon Stürz 2015-11-30 11:32:55 +01:00 committed by Michael Zanetti
parent 33af5fb5d5
commit 057c1cf065
9 changed files with 94 additions and 4 deletions

8
debian/changelog vendored
View File

@ -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
* Add websocket server

View File

@ -2,7 +2,7 @@
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
# define protocol versions
JSON_PROTOCOL_VERSION=32
JSON_PROTOCOL_VERSION=33
REST_API_VERSION=1
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \

19
guh.pro
View File

@ -34,6 +34,8 @@ test.commands = LD_LIBRARY_PATH=$$top_builddir/libguh:$$top_builddir/tests/libgu
QMAKE_EXTRA_TARGETS += licensecheck doc test
# Inform about guh build
message(============================================)
message(Qt version: $$[QT_VERSION])
message("Building guh version $${GUH_VERSION_STRING}")
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION}")
@ -43,6 +45,23 @@ 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){
message("Building guh with websocket.")
} else {

View File

@ -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. */
void ParamType::setAllowedValues(const QList<QVariant> allowedValues)
void ParamType::setAllowedValues(const QList<QVariant> &allowedValues)
{
m_allowedValues = allowedValues;
}

View File

@ -56,7 +56,7 @@ public:
void setLimits(const QVariant &min, const QVariant &max);
QList<QVariant> allowedValues() const;
void setAllowedValues(const QList<QVariant> allowedValues);
void setAllowedValues(const QList<QVariant> &allowedValues);
bool readOnly() const;
void setReadOnly(const bool &readOnly);

View File

@ -36,6 +36,10 @@
* hardcode it into the plugin. */
StateType::StateType(const StateTypeId &id):
m_id(id),
m_defaultValue(QVariant()),
m_minValue(QVariant()),
m_maxValue(QVariant()),
m_possibleValues(QVariantList()),
m_unit(Types::UnitNone)
{
@ -83,6 +87,45 @@ void StateType::setDefaultValue(const QVariant &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. */
Types::Unit StateType::unit() const
{

View File

@ -42,6 +42,15 @@ public:
QVariant defaultValue() const;
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;
void setUnit(const Types::Unit &unit);
@ -50,6 +59,9 @@ private:
QString m_name;
QVariant::Type m_type;
QVariant m_defaultValue;
QVariant m_minValue;
QVariant m_maxValue;
QVariantList m_possibleValues;
Types::Unit m_unit;
};

View File

@ -130,6 +130,9 @@ void JsonTypes::init()
s_stateType.insert("type", basicTypeRef());
s_stateType.insert("defaultValue", basicTypeToString(Variant));
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
s_state.insert("stateTypeId", basicTypeToString(Uuid));

View File

@ -1,4 +1,4 @@
32
33
{
"methods": {
"Actions.ExecuteAction": {
@ -798,6 +798,11 @@
"defaultValue": "Variant",
"id": "Uuid",
"name": "String",
"o:maxValue": "Variant",
"o:minValue": "Variant",
"o:possibleValues": [
"Variant"
],
"o:unit": "$ref:Unit",
"type": "$ref:BasicType"
},