mirror of https://github.com/nymea/nymea.git
51 lines
1.0 KiB
C++
51 lines
1.0 KiB
C++
/*!
|
|
\class Trigger
|
|
\brief Holds information required to emit a trigger described by a \l{TriggerType}.
|
|
|
|
\ingroup types
|
|
\inmodule libhive
|
|
|
|
It is bound to a \l{Device} and a \l{TriggerType} and holds the parameters
|
|
for the event that happened.
|
|
|
|
The params must match the template as described in \l{TriggerType}.
|
|
|
|
\sa Device TriggerType
|
|
*/
|
|
|
|
#include "trigger.h"
|
|
|
|
Trigger::Trigger(const QUuid &triggerTypeId, const QUuid &deviceId, const QVariantMap ¶ms):
|
|
m_triggerTypeId(triggerTypeId),
|
|
m_deviceId(deviceId),
|
|
m_params(params)
|
|
{
|
|
}
|
|
|
|
QUuid Trigger::triggerTypeId() const
|
|
{
|
|
return m_triggerTypeId;
|
|
}
|
|
|
|
QUuid Trigger::deviceId() const
|
|
{
|
|
return m_deviceId;
|
|
}
|
|
|
|
QVariantMap Trigger::params() const
|
|
{
|
|
return m_params;
|
|
}
|
|
|
|
void Trigger::setParams(const QVariantMap ¶ms)
|
|
{
|
|
m_params = params;
|
|
}
|
|
|
|
bool Trigger::operator ==(const Trigger &other) const
|
|
{
|
|
return m_triggerTypeId == other.triggerTypeId()
|
|
&& m_deviceId == other.deviceId()
|
|
&& m_params == other.params();
|
|
}
|