Disable netatmo timer only if there is no device left
This commit is contained in:
parent
3f13275722
commit
21a83b5dac
@ -117,12 +117,6 @@ void DevicePluginNetatmo::deviceRemoved(Device *device)
|
||||
OAuth2 * authentication = m_authentications.key(device);
|
||||
m_authentications.remove(authentication);
|
||||
authentication->deleteLater();
|
||||
|
||||
if (m_pluginTimer) {
|
||||
m_pluginTimer->deleteLater();
|
||||
m_pluginTimer = nullptr;
|
||||
}
|
||||
|
||||
} else if (device->deviceClassId() == indoorDeviceClassId) {
|
||||
NetatmoBaseStation *indoor = m_indoorDevices.key(device);
|
||||
m_indoorDevices.remove(indoor);
|
||||
@ -132,6 +126,11 @@ void DevicePluginNetatmo::deviceRemoved(Device *device)
|
||||
m_outdoorDevices.remove(outdoor);
|
||||
outdoor->deleteLater();
|
||||
}
|
||||
|
||||
if (myDevices().isEmpty() && m_pluginTimer) {
|
||||
m_pluginTimer->deleteLater();
|
||||
m_pluginTimer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
DeviceManager::DeviceError DevicePluginNetatmo::executeAction(Device *device, const Action &action)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user