bump version
This commit is contained in:
parent
ff337bf8b6
commit
f0e8e5a609
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,3 +1,8 @@
|
|||||||
|
nymea (0.15.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
|
||||||
|
-- Michael Zanetti <michael.zanetti@guh.io> Tue, 09 Jul 2019 02:08:05 +0200
|
||||||
|
|
||||||
nymea (0.14.0) xenial; urgency=medium
|
nymea (0.14.0) xenial; urgency=medium
|
||||||
[ Michael Zanetti ]
|
[ Michael Zanetti ]
|
||||||
* Bump minimum required TLS version to 1.2
|
* Bump minimum required TLS version to 1.2
|
||||||
|
|||||||
@ -46,17 +46,21 @@
|
|||||||
|
|
||||||
#include "ruleaction.h"
|
#include "ruleaction.h"
|
||||||
|
|
||||||
/*! Constructs a RuleAction with the given by \a actionTypeId, \a deviceId and \a params. */
|
/*! Constructs a RuleAction with the given by \a actionTypeId, \a deviceId and \a params.
|
||||||
|
* Use this to create a RuleAction for regular actions, that is, identifying the Action by deviceId and actionTypeId.
|
||||||
|
*/
|
||||||
RuleAction::RuleAction(const ActionTypeId &actionTypeId, const DeviceId &deviceId, const RuleActionParamList ¶ms):
|
RuleAction::RuleAction(const ActionTypeId &actionTypeId, const DeviceId &deviceId, const RuleActionParamList ¶ms):
|
||||||
m_id(ActionId::createActionId()),
|
m_id(ActionId::createActionId()),
|
||||||
m_actionTypeId(actionTypeId),
|
|
||||||
m_deviceId(deviceId),
|
m_deviceId(deviceId),
|
||||||
|
m_actionTypeId(actionTypeId),
|
||||||
m_ruleActionParams(params)
|
m_ruleActionParams(params)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Constructs a RuleAction with the given by \a interface and \a interfaceAction. */
|
/*! Constructs a RuleAction with the given by \a interface and \a interfaceAction.
|
||||||
|
* This will create an interface based RuleAction. Meaning, the Action is idenfified by an interface and and interfaceAction.
|
||||||
|
*/
|
||||||
RuleAction::RuleAction(const QString &interface, const QString &interfaceAction, const RuleActionParamList ¶ms) :
|
RuleAction::RuleAction(const QString &interface, const QString &interfaceAction, const RuleActionParamList ¶ms) :
|
||||||
m_interface(interface),
|
m_interface(interface),
|
||||||
m_interfaceAction(interfaceAction),
|
m_interfaceAction(interfaceAction),
|
||||||
@ -65,11 +69,22 @@ RuleAction::RuleAction(const QString &interface, const QString &interfaceAction,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! Constructs a RuleAction with the given by \a interface and \a interfaceAction.
|
||||||
|
* Use this to create a RuleAction for executing browser items.
|
||||||
|
*/
|
||||||
|
RuleAction::RuleAction(const DeviceId &deviceId, const QString &browserItemId):
|
||||||
|
m_deviceId(deviceId),
|
||||||
|
m_browserItemId(browserItemId)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*! Constructs a copy of the given \a other RuleAction. */
|
/*! Constructs a copy of the given \a other RuleAction. */
|
||||||
RuleAction::RuleAction(const RuleAction &other) :
|
RuleAction::RuleAction(const RuleAction &other) :
|
||||||
m_id(other.id()),
|
m_id(other.id()),
|
||||||
m_actionTypeId(other.actionTypeId()),
|
|
||||||
m_deviceId(other.deviceId()),
|
m_deviceId(other.deviceId()),
|
||||||
|
m_actionTypeId(other.actionTypeId()),
|
||||||
|
m_browserItemId(other.browserItemId()),
|
||||||
m_interface(other.interface()),
|
m_interface(other.interface()),
|
||||||
m_interfaceAction(other.interfaceAction()),
|
m_interfaceAction(other.interfaceAction()),
|
||||||
m_ruleActionParams(other.ruleActionParams())
|
m_ruleActionParams(other.ruleActionParams())
|
||||||
@ -86,13 +101,25 @@ ActionId RuleAction::id() const
|
|||||||
/*! Return true, if the actionTypeId and the deviceId of this RuleAction are valid (set).*/
|
/*! Return true, if the actionTypeId and the deviceId of this RuleAction are valid (set).*/
|
||||||
bool RuleAction::isValid() const
|
bool RuleAction::isValid() const
|
||||||
{
|
{
|
||||||
return (!m_actionTypeId.isNull() && !m_deviceId.isNull()) || (!m_interface.isEmpty() && !m_interfaceAction.isEmpty());
|
return (!m_actionTypeId.isNull() && !m_deviceId.isNull())
|
||||||
|
|| (!m_interface.isEmpty() && !m_interfaceAction.isEmpty())
|
||||||
|
|| (!m_deviceId.isNull() && !m_browserItemId.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Returns whether this RuleAction is targetting a specific device or rather an interface. */
|
/*! Returns whether this RuleAction is targetting a specific device or rather an interface. */
|
||||||
RuleAction::Type RuleAction::type() const
|
RuleAction::Type RuleAction::type() const
|
||||||
{
|
{
|
||||||
return (!m_actionTypeId.isNull() && !m_deviceId.isNull()) ? TypeDevice : TypeInterface;
|
if (!m_deviceId.isNull() && !m_actionTypeId.isNull()) {
|
||||||
|
return TypeDevice;
|
||||||
|
}
|
||||||
|
if (!m_deviceId.isNull() && m_browserItemId.isEmpty()) {
|
||||||
|
return TypeBrowser;
|
||||||
|
}
|
||||||
|
if (!m_interface.isEmpty() && !m_interfaceAction.isEmpty()) {
|
||||||
|
return TypeInterface;
|
||||||
|
}
|
||||||
|
// uhmm... invalid...
|
||||||
|
return TypeDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Return true, if this RuleAction contains a \l{RuleActionParam} which is based on an EventTypeId.*/
|
/*! Return true, if this RuleAction contains a \l{RuleActionParam} which is based on an EventTypeId.*/
|
||||||
@ -129,6 +156,13 @@ Action RuleAction::toAction() const
|
|||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! Converts this \l{RuleAction} to a \l{BrowserItemAction}.
|
||||||
|
* \sa BrowserItemAction, */
|
||||||
|
BrowserItemAction RuleAction::toBrowserItemAction() const
|
||||||
|
{
|
||||||
|
return BrowserItemAction(m_deviceId, m_browserItemId);
|
||||||
|
}
|
||||||
|
|
||||||
/*! Returns the actionTypeId of this RuleAction. */
|
/*! Returns the actionTypeId of this RuleAction. */
|
||||||
ActionTypeId RuleAction::actionTypeId() const
|
ActionTypeId RuleAction::actionTypeId() const
|
||||||
{
|
{
|
||||||
@ -204,7 +238,7 @@ void RuleAction::operator=(const RuleAction &other)
|
|||||||
/*! Print a RuleAction including RuleActionParams to QDebug. */
|
/*! Print a RuleAction including RuleActionParams to QDebug. */
|
||||||
QDebug operator<<(QDebug dbg, const RuleAction &ruleAction)
|
QDebug operator<<(QDebug dbg, const RuleAction &ruleAction)
|
||||||
{
|
{
|
||||||
dbg.nospace() << "RuleAction(ActionTypeId:" << ruleAction.actionTypeId().toString() << ", DeviceId:" << ruleAction.deviceId().toString() << ", Interface:" << ruleAction.interface() << ", InterfaceAction:" << ruleAction.interfaceAction() << ")" << endl;
|
dbg.nospace() << "RuleAction(ActionTypeId:" << ruleAction.actionTypeId().toString() << ", DeviceId:" << ruleAction.deviceId().toString() << ", Interface:" << ruleAction.interface() << ", InterfaceAction:" << ruleAction.interfaceAction() << ", BrowserItemId:" << ruleAction.browserItemId() << ")" << endl;
|
||||||
for (int i = 0; i < ruleAction.ruleActionParams().count(); i++) {
|
for (int i = 0; i < ruleAction.ruleActionParams().count(); i++) {
|
||||||
dbg.nospace() << " " << i << ": " << ruleAction.ruleActionParams().at(i) << endl;
|
dbg.nospace() << " " << i << ": " << ruleAction.ruleActionParams().at(i) << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,16 +27,19 @@
|
|||||||
#include "libnymea.h"
|
#include "libnymea.h"
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "ruleactionparam.h"
|
#include "ruleactionparam.h"
|
||||||
|
#include "browseritemaction.h"
|
||||||
|
|
||||||
class LIBNYMEA_EXPORT RuleAction
|
class LIBNYMEA_EXPORT RuleAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
TypeDevice,
|
TypeDevice,
|
||||||
TypeInterface
|
TypeInterface,
|
||||||
|
TypeBrowser
|
||||||
};
|
};
|
||||||
explicit RuleAction(const ActionTypeId &actionTypeId = ActionTypeId(), const DeviceId &deviceId = DeviceId(), const RuleActionParamList ¶ms = RuleActionParamList());
|
explicit RuleAction(const ActionTypeId &actionTypeId = ActionTypeId(), const DeviceId &deviceId = DeviceId(), const RuleActionParamList ¶ms = RuleActionParamList());
|
||||||
explicit RuleAction(const QString &interface, const QString &interfaceAction, const RuleActionParamList ¶ms = RuleActionParamList());
|
explicit RuleAction(const QString &interface, const QString &interfaceAction, const RuleActionParamList ¶ms = RuleActionParamList());
|
||||||
|
explicit RuleAction(const DeviceId &deviceId, const QString &browserItemId);
|
||||||
RuleAction(const RuleAction &other);
|
RuleAction(const RuleAction &other);
|
||||||
|
|
||||||
ActionId id() const;
|
ActionId id() const;
|
||||||
@ -48,9 +51,11 @@ public:
|
|||||||
bool isStateBased() const;
|
bool isStateBased() const;
|
||||||
|
|
||||||
Action toAction() const;
|
Action toAction() const;
|
||||||
|
BrowserItemAction toBrowserItemAction() const;
|
||||||
|
|
||||||
ActionTypeId actionTypeId() const;
|
|
||||||
DeviceId deviceId() const;
|
DeviceId deviceId() const;
|
||||||
|
ActionTypeId actionTypeId() const;
|
||||||
|
QString browserItemId() const;
|
||||||
|
|
||||||
QString interface() const;
|
QString interface() const;
|
||||||
QString interfaceAction() const;
|
QString interfaceAction() const;
|
||||||
@ -64,8 +69,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ActionId m_id;
|
ActionId m_id;
|
||||||
ActionTypeId m_actionTypeId;
|
|
||||||
DeviceId m_deviceId;
|
DeviceId m_deviceId;
|
||||||
|
ActionTypeId m_actionTypeId;
|
||||||
|
QString m_browserItemId;
|
||||||
QString m_interface;
|
QString m_interface;
|
||||||
QString m_interfaceAction;
|
QString m_interfaceAction;
|
||||||
RuleActionParamList m_ruleActionParams;
|
RuleActionParamList m_ruleActionParams;
|
||||||
|
|||||||
Reference in New Issue
Block a user