poll hue lights using the guhTimer to keep them in sync

This commit is contained in:
Michael Zanetti 2014-06-25 00:23:25 +02:00
parent aaaafb7f39
commit 4211c3ae5c
2 changed files with 10 additions and 1 deletions

View File

@ -160,7 +160,7 @@ QList<DeviceClass> DevicePluginPhilipsHue::supportedDevices() const
DeviceManager::HardwareResources DevicePluginPhilipsHue::requiredHardware() const
{
return DeviceManager::HardwareResourceNone;
return DeviceManager::HardwareResourceTimer;
}
void DevicePluginPhilipsHue::startMonitoringAutoDevices()
@ -267,6 +267,13 @@ QPair<DeviceManager::DeviceSetupStatus, QString> DevicePluginPhilipsHue::confirm
return reportDeviceSetup(DeviceManager::DeviceSetupStatusAsync);
}
void DevicePluginPhilipsHue::guhTimer()
{
foreach (Light *light, m_lights.keys()) {
light->refresh();
}
}
QPair<DeviceManager::DeviceError, QString> DevicePluginPhilipsHue::executeAction(Device *device, const Action &action)
{
qDebug() << "Should execute action in hue plugin";

View File

@ -52,6 +52,8 @@ public:
QPair<DeviceManager::DeviceSetupStatus, QString> confirmPairing(const QUuid &pairingTransactionId, const DeviceClassId &deviceClassId, const QList<Param> &params) override;
void guhTimer() override;
public slots:
QPair<DeviceManager::DeviceError, QString> executeAction(Device *device, const Action &action);