diff --git a/doc/jsonrpc-api.qdoc b/doc/jsonrpc-api.qdoc index 11737a89..a1b0d5b8 100644 --- a/doc/jsonrpc-api.qdoc +++ b/doc/jsonrpc-api.qdoc @@ -230,8 +230,6 @@ See also: \l{ParamDescriptor} "id": "Uuid", "index": "Int", "name": "String", - "o:graphRelevant": "Bool", - "o:ruleRelevant": "Bool", "paramTypes": [ "$ref:ParamType" ] @@ -580,13 +578,11 @@ See also: \l{StateEvaluator}, \l{StateDescriptor}, \l{StateOperator} "id": "Uuid", "index": "Int", "name": "String", - "o:graphRelevant": "Bool", "o:maxValue": "Variant", "o:minValue": "Variant", "o:possibleValues": [ "Variant" ], - "o:ruleRelevant": "Bool", "o:unit": "$ref:Unit", "type": "$ref:BasicType" } @@ -3491,8 +3487,6 @@ See also: \l{Tag} "id": "Uuid", "index": "Int", "name": "String", - "o:graphRelevant": "Bool", - "o:ruleRelevant": "Bool", "paramTypes": [ "$ref:ParamType" ] @@ -3742,13 +3736,11 @@ See also: \l{Tag} "id": "Uuid", "index": "Int", "name": "String", - "o:graphRelevant": "Bool", "o:maxValue": "Variant", "o:minValue": "Variant", "o:possibleValues": [ "Variant" ], - "o:ruleRelevant": "Bool", "o:unit": "$ref:Unit", "type": "$ref:BasicType" }, diff --git a/doc/plugin-json.qdoc b/doc/plugin-json.qdoc index 49e6323b..4dc9eec2 100644 --- a/doc/plugin-json.qdoc +++ b/doc/plugin-json.qdoc @@ -431,9 +431,6 @@ A \l{StateType} has following parameters: "type": "DataType", "defaultValue": "The state will be initialized with this value." "o:cached": "bool", - "o:ruleRelevant": "bool", - "o:eventRuleRelevant": "bool", - "o:graphRelevant": "bool", "o:unit": "The unit of the state value.", "o:minValue": "Numeric minimum value for this state.", "o:maxValue": "Numeric maximum value for this state.", @@ -492,23 +489,6 @@ A \l{StateType} has following parameters: \li Indicates if a state value should be cached over reboot of the server. The value will be initialized with the last known value. By default all states get chached. If you want to disable that behaviour you can set this property to \tt{false}. In that case the value will be initialized with the default value of the State. - \row - \li \tt ruleRelevant - \li \b O - \li bool - \li Since not all \l{State}{States} make sense for the user in a rule, with this flag can be specified if this state should be visible - in the rule engine for the user or not. This flag has no effect to the ruleengine mechanism and is only ment to filter out not - interesting \l{State}{States}. By default, every state is rule relevant. - \row - \li \tt eventRuleRelevant - \li \b O - \li bool - \li Deprecated: please use \l{Interfaces for DeviceClasses}{interfaces} instead. - \row - \li \tt graphRelevant - \li \b O - \li bool - \li Deprecated: please use \l{Interfaces for DeviceClasses}{interfaces} instead. \row \li \tt unit \li \b O @@ -665,8 +645,6 @@ A \l{StateType} has following parameters: "id": "uuid", "name": "eventName", "displayName": "Name of the event (translatable)", - "o:ruleRelevant": "bool", - "o:graphRelevant": "bool", "o:paramTypes": [ ... ] @@ -700,18 +678,6 @@ A \l{StateType} has following parameters: \li A list of \l{ParamType}{ParamTypes} which define the parameters of this event \unicode{0x2192} \l{EventType::paramTypes()}. \b{See also:} \l{The ParamType definition}" - \row - \li \tt ruleRelevant - \li \b O - \li bool - \li Since not all \l{Event}{Events} make sense for the user in a rule, with this flag can be specidied if this event should be visible in the rule engine - for the user or not. This flag has no effect to the ruleengine mechanism and is only ment to filter out not interesting \l{Event}{Events}. By default, - every event is rule relevant. - \row - \li \tt graphRelevant - \li \b O - \li bool - \li Deprecated: please use \l{Interfaces for DeviceClasses}{interfaces} instead. \endtable */ diff --git a/libnymea-core/jsonrpc/jsontypes.cpp b/libnymea-core/jsonrpc/jsontypes.cpp index 65036248..8daf0a52 100644 --- a/libnymea-core/jsonrpc/jsontypes.cpp +++ b/libnymea-core/jsonrpc/jsontypes.cpp @@ -199,8 +199,6 @@ void JsonTypes::init() s_stateType.insert("index", basicTypeToString(Int)); s_stateType.insert("defaultValue", basicTypeToString(Variant)); s_stateType.insert("o:unit", unitRef()); - s_stateType.insert("o:ruleRelevant", basicTypeToString(Bool)); - s_stateType.insert("o:graphRelevant", basicTypeToString(Bool)); s_stateType.insert("o:minValue", basicTypeToString(Variant)); s_stateType.insert("o:maxValue", basicTypeToString(Variant)); s_stateType.insert("o:possibleValues", QVariantList() << basicTypeToString(Variant)); @@ -229,8 +227,6 @@ void JsonTypes::init() s_eventType.insert("displayName", basicTypeToString(String)); s_eventType.insert("index", basicTypeToString(Int)); s_eventType.insert("paramTypes", QVariantList() << paramTypeRef()); - s_eventType.insert("o:ruleRelevant", basicTypeToString(Bool)); - s_eventType.insert("o:graphRelevant", basicTypeToString(Bool)); // Event s_event.insert("eventTypeId", basicTypeToString(Uuid)); @@ -496,11 +492,6 @@ QVariantMap JsonTypes::packEventType(const EventType &eventType, const PluginId variant.insert("name", eventType.name()); variant.insert("displayName", NymeaCore::instance()->deviceManager()->translator()->translate(pluginId, eventType.displayName(), locale)); variant.insert("index", eventType.index()); - if (!eventType.ruleRelevant()) - variant.insert("ruleRelevant", false); - - if (eventType.graphRelevant()) - variant.insert("graphRelevant", true); QVariantList paramTypes; foreach (const ParamType ¶mType, eventType.paramTypes()) @@ -631,12 +622,6 @@ QVariantMap JsonTypes::packStateType(const StateType &stateType, const PluginId variantMap.insert("type", basicTypeToString(stateType.type())); variantMap.insert("defaultValue", stateType.defaultValue()); - if (!stateType.ruleRelevant()) - variantMap.insert("ruleRelevant", false); - - if (stateType.graphRelevant()) - variantMap.insert("graphRelevant", true); - if (stateType.maxValue().isValid()) variantMap.insert("maxValue", stateType.maxValue()); diff --git a/libnymea/plugin/deviceplugin.cpp b/libnymea/plugin/deviceplugin.cpp index f257ba70..8a767b4f 100644 --- a/libnymea/plugin/deviceplugin.cpp +++ b/libnymea/plugin/deviceplugin.cpp @@ -698,12 +698,6 @@ void DevicePlugin::loadMetaData() if (st.contains("maxValue")) stateType.setMaxValue(st.value("maxValue").toVariant()); - if (st.contains("ruleRelevant")) - stateType.setRuleRelevant(st.value("ruleRelevant").toBool()); - - if (st.contains("graphRelevant")) - stateType.setGraphRelevant(st.value("graphRelevant").toBool()); - if (st.contains("possibleValues")) { QVariantList possibleValues; foreach (const QJsonValue &possibleValueJson, st.value("possibleValues").toArray()) { @@ -726,9 +720,6 @@ void DevicePlugin::loadMetaData() // Events for state changed EventType eventType(EventTypeId(stateType.id().toString())); - if (st.contains("eventRuleRelevant")) - eventType.setRuleRelevant(st.value("eventRuleRelevant").toBool()); - eventType.setName(st.value("name").toString()); eventType.setDisplayName(st.value("displayNameEvent").toString()); ParamType paramType(ParamTypeId(stateType.id().toString()), st.value("name").toString(), stateType.type()); @@ -816,11 +807,6 @@ void DevicePlugin::loadMetaData() eventType.setName(et.value("name").toString()); eventType.setDisplayName(et.value("displayName").toString()); eventType.setIndex(index++); - if (et.contains("ruleRelevant")) - eventType.setRuleRelevant(et.value("ruleRelevant").toBool()); - - if (et.contains("graphRelevant")) - eventType.setGraphRelevant(et.value("graphRelevant").toBool()); QPair > paramVerification = parseParamTypes(et.value("paramTypes").toArray()); if (!paramVerification.first) { diff --git a/libnymea/types/eventtype.cpp b/libnymea/types/eventtype.cpp index 31468899..b7a10fa1 100644 --- a/libnymea/types/eventtype.cpp +++ b/libnymea/types/eventtype.cpp @@ -36,9 +36,7 @@ /*! Constructs a EventType object with the given \a id. */ EventType::EventType(const EventTypeId &id): m_id(id), - m_index(0), - m_ruleRelevant(true), - m_graphRelevant(false) + m_index(0) { } @@ -100,30 +98,6 @@ void EventType::setParamTypes(const ParamTypes ¶mTypes) m_paramTypes = paramTypes; } -/*! Returns true if this EventType is relevant for the rule from a user perspective. */ -bool EventType::ruleRelevant() const -{ - return m_ruleRelevant; -} - -/*! Sets this EventType relevant for the rule from a user perspective to \a ruleRelevant. */ -void EventType::setRuleRelevant(const bool &ruleRelevant) -{ - m_ruleRelevant = ruleRelevant; -} - -/*! Returns true if this EventType is interesting to visualize the logs in a graph/chart from a user perspective. */ -bool EventType::graphRelevant() const -{ - return m_graphRelevant; -} - -/*! Sets this EventType \a graphRelevant to inform the client application if this \l{EventType} is interesting to visualize the logs in a graph/chart. */ -void EventType::setGraphRelevant(const bool &graphRelevant) -{ - m_graphRelevant = graphRelevant; -} - /*! Returns true if this EventType has a valid id and name */ bool EventType::isValid() const { @@ -133,7 +107,7 @@ bool EventType::isValid() const /*! Returns a list of all valid JSON properties a EventType JSON definition can have. */ QStringList EventType::typeProperties() { - return QStringList() << "id" << "name" << "displayName" << "paramTypes" << "ruleRelevant" << "graphRelevant"; + return QStringList() << "id" << "name" << "displayName" << "paramTypes"; } /*! Returns a list of mandatory JSON properties a EventType JSON definition must have. */ diff --git a/libnymea/types/eventtype.h b/libnymea/types/eventtype.h index e0a06162..c50ec651 100644 --- a/libnymea/types/eventtype.h +++ b/libnymea/types/eventtype.h @@ -49,12 +49,6 @@ public: ParamTypes paramTypes() const; void setParamTypes(const ParamTypes ¶mTypes); - bool ruleRelevant() const; - void setRuleRelevant(const bool &ruleRelevant); - - bool graphRelevant() const; - void setGraphRelevant(const bool &graphRelevant); - bool isValid() const; static QStringList typeProperties(); @@ -66,8 +60,6 @@ private: QString m_displayName; int m_index; QList m_paramTypes; - bool m_ruleRelevant; - bool m_graphRelevant; }; class EventTypes: public QList diff --git a/libnymea/types/statetype.cpp b/libnymea/types/statetype.cpp index cad8e0d4..acbd55c9 100644 --- a/libnymea/types/statetype.cpp +++ b/libnymea/types/statetype.cpp @@ -160,30 +160,6 @@ void StateType::setUnit(const Types::Unit &unit) m_unit = unit; } -/*! Returns true if this StateType is relevant for the rule from a user perspective. */ -bool StateType::ruleRelevant() const -{ - return m_ruleRelevant; -} - -/*! Sets this StateType relevant for the rule from a user perspective to \a ruleRelevant. */ -void StateType::setRuleRelevant(const bool &ruleRelevant) -{ - m_ruleRelevant = ruleRelevant; -} - -/*! Returns true if this StateType is interesting to visualize the logs in a graph/chart from a user perspective. */ -bool StateType::graphRelevant() const -{ - return m_graphRelevant; -} - -/*! Sets this StateType \a graphRelevant to inform the client application if this \l{StateType} is interesting to visualize the logs in a graph/chart. */ -void StateType::setGraphRelevant(const bool &graphRelevant) -{ - m_graphRelevant = graphRelevant; -} - /*! 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. */ bool StateType::cached() const { @@ -200,8 +176,8 @@ void StateType::setCached(bool cached) QStringList StateType::typeProperties() { return QStringList() << "id" << "name" << "displayName" << "displayNameEvent" << "type" << "defaultValue" - << "cached" << "ruleRelevant" << "eventRuleRelevant" << "graphRelevant" << "unit" - << "minValue" << "maxValue" << "possibleValues" << "writable" << "displayNameAction"; + << "cached" << "unit" << "minValue" << "maxValue" << "possibleValues" << "writable" + << "displayNameAction"; } /*! Returns a list of mandatory properties a DeviceClass definition must have. */ diff --git a/libnymea/types/statetype.h b/libnymea/types/statetype.h index 278c4ac3..88d65a16 100644 --- a/libnymea/types/statetype.h +++ b/libnymea/types/statetype.h @@ -64,12 +64,6 @@ public: Types::Unit unit() const; void setUnit(const Types::Unit &unit); - bool ruleRelevant() const; - void setRuleRelevant(const bool &ruleRelevant); - - bool graphRelevant() const; - void setGraphRelevant(const bool &graphRelevant); - bool cached() const; void setCached(bool cached); @@ -87,8 +81,6 @@ private: QVariant m_maxValue; QVariantList m_possibleValues; Types::Unit m_unit = Types::UnitNone; - bool m_ruleRelevant = true; - bool m_graphRelevant = false; bool m_cached = true; }; diff --git a/plugins/mock/devicepluginmock.json b/plugins/mock/devicepluginmock.json index 6278cd82..bfc78cd4 100644 --- a/plugins/mock/devicepluginmock.json +++ b/plugins/mock/devicepluginmock.json @@ -72,7 +72,6 @@ "displayName": "Dummy int state", "displayNameEvent": "Dummy int state changed", "defaultValue": 10, - "graphRelevant": true, "type": "int" }, { @@ -128,8 +127,7 @@ { "id": "45bf3752-0fc6-46b9-89fd-ffd878b5b22b", "name": "mockEvent1", - "displayName": "Mock Event 1", - "graphRelevant": true + "displayName": "Mock Event 1" }, { "id": "863d5920-b1cf-4eb9-88bd-8f7b8583b1cf", @@ -224,7 +222,6 @@ "displayName": "Dummy int state", "displayNameEvent": "Dummy int state changed", "defaultValue": 10, - "graphRelevant": true, "type": "int" }, { @@ -328,8 +325,6 @@ "displayNameAction": "Set color", "type": "QColor", "defaultValue": "#000000", - "ruleRelevant": false, - "eventRuleRelevant": false, "writable": true }, { @@ -341,7 +336,6 @@ "type": "int", "unit": "Percentage", "defaultValue": 0, - "ruleRelevant": false, "minValue": 0, "maxValue": 100, "writable": true @@ -431,8 +425,6 @@ "displayNameAction": "Set color", "type": "QColor", "defaultValue": "#000000", - "ruleRelevant": false, - "eventRuleRelevant": false, "writable": true }, { @@ -444,7 +436,6 @@ "type": "int", "unit": "Percentage", "defaultValue": 0, - "ruleRelevant": false, "minValue": 0, "maxValue": 100, "writable": true