diff --git a/libnymea/plugin/device.cpp b/libnymea/plugin/device.cpp index 128443f1..70a4f55d 100644 --- a/libnymea/plugin/device.cpp +++ b/libnymea/plugin/device.cpp @@ -96,7 +96,10 @@ QString Device::name() const /*! Set the \a name for this Device. This is visible to the user.*/ void Device::setName(const QString &name) { - m_name = name; + if (m_name != name) { + m_name = name; + emit nameChanged(); + } } /*! Returns the parameter of this Device. It must match the parameter description in the associated \l{DeviceClass}. */ diff --git a/libnymea/plugin/device.h b/libnymea/plugin/device.h index 69c2479b..0bac6471 100644 --- a/libnymea/plugin/device.h +++ b/libnymea/plugin/device.h @@ -73,6 +73,7 @@ public: signals: void stateValueChanged(const QUuid &stateTypeId, const QVariant &value); + void nameChanged(); private: Device(const PluginId &pluginId, const DeviceId &id, const DeviceClassId &deviceClassId, QObject *parent = nullptr);