From b7c6f3612a4af34c72db46eab6fcc10d6d831b50 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 28 Jul 2014 23:07:08 +0200 Subject: [PATCH] cleanup hue plugin when a device is removed. Fixes #19 --- .../philipshue/devicepluginphilipshue.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/deviceplugins/philipshue/devicepluginphilipshue.cpp b/plugins/deviceplugins/philipshue/devicepluginphilipshue.cpp index cb8f2c9a..401f86fc 100644 --- a/plugins/deviceplugins/philipshue/devicepluginphilipshue.cpp +++ b/plugins/deviceplugins/philipshue/devicepluginphilipshue.cpp @@ -239,6 +239,17 @@ QPair DevicePluginPhilipsHue::setupDe return reportDeviceSetup(DeviceManager::DeviceSetupStatusAsync); } +void DevicePluginPhilipsHue::deviceRemoved(Device *device) +{ + if (!m_lights.values().contains(device)) { + return; + } + + Light *light = m_lights.key(device); + m_lights.remove(light); + m_unconfiguredLights.append(light); +} + QPair DevicePluginPhilipsHue::confirmPairing(const QUuid &pairingTransactionId, const DeviceClassId &deviceClassId, const ParamList ¶ms) { Param ipParam;