diff --git a/lifx/integrationpluginlifx.cpp b/lifx/integrationpluginlifx.cpp
index db94783b..84b26e17 100644
--- a/lifx/integrationpluginlifx.cpp
+++ b/lifx/integrationpluginlifx.cpp
@@ -115,7 +115,7 @@ void IntegrationPluginLifx::startPairing(ThingPairingInfo *info)
if (reply->error() == QNetworkReply::NetworkError::HostNotFoundError) {
info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("LIFX server is not reachable."));
} else {
- info->finish(Thing::ThingErrorNoError, "Please enter your Token and password. Get the token from https://cloud.lifx.com/settings");
+ info->finish(Thing::ThingErrorNoError, QT_TR_NOOP("Please enter your user name and token. Get the token from https://cloud.lifx.com/settings"));
}
});
}
@@ -134,7 +134,7 @@ void IntegrationPluginLifx::confirmPairing(ThingPairingInfo *info, const QString
// check HTTP status code
if (status != 200) {
// Error setting up device with invalid token
- info->finish(Thing::ThingErrorAuthenticationFailure, QT_TR_NOOP("This token is invalid."));
+ info->finish(Thing::ThingErrorAuthenticationFailure, QT_TR_NOOP("The token is invalid."));
return;
}
qCDebug(dcLifx()) << "Confirm pairing successfull";
@@ -237,8 +237,9 @@ void IntegrationPluginLifx::setupThing(ThingSetupInfo *info)
connect(lifxCloud, &LifxCloud::authenticationChanged, this, &IntegrationPluginLifx::onLifxCloudAuthenticationChanged);
lifxCloud->setAuthorizationToken(token);
lifxCloud->listLights();
-
- //TODO try setup again if it failes
+ QTimer::singleShot(2000, info, [this, info] {
+ setupThing(info);
+ });
} else {
Q_ASSERT_X(false, "setupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8());
}
@@ -247,13 +248,12 @@ void IntegrationPluginLifx::setupThing(ThingSetupInfo *info)
void IntegrationPluginLifx::postSetupThing(Thing *thing)
{
if (!m_pluginTimer) {
- m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(60);
+ m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(15);
connect(m_pluginTimer, &PluginTimer::timeout, this, [this]() {
foreach (LifxLan *lifx, m_lifxLanConnections) {
Q_UNUSED(lifx)
//TODO update LAN device states
}
-
foreach (LifxCloud *lifx, m_lifxCloudConnections) {
lifx->listLights();
}
@@ -275,6 +275,7 @@ void IntegrationPluginLifx::executeAction(ThingActionInfo *info)
LifxCloud *lifxCloud;
if (m_lifxLanConnections.contains(thing)) {
+ // Local connection first
lifx = m_lifxLanConnections.value(thing);
} else if (m_lifxCloudConnections.contains(myThings().findById(thing->parentId()))) {
lifxCloud = m_lifxCloudConnections.value(myThings().findById(thing->parentId()));
diff --git a/lifx/lifx.pro b/lifx/lifx.pro
new file mode 100644
index 00000000..20671af6
--- /dev/null
+++ b/lifx/lifx.pro
@@ -0,0 +1,14 @@
+include(../plugins.pri)
+
+QT += network
+
+SOURCES += \
+ integrationpluginlifx.cpp \
+ lifxcloud.cpp \
+ lifxlan.cpp \
+
+HEADERS += \
+ integrationpluginlifx.h \
+ lifxcloud.h \
+ lifxlan.h \
+
diff --git a/lifx/translations/4e00ee30-79e2-447b-8dcc-c34470f41992-de.ts b/lifx/translations/4e00ee30-79e2-447b-8dcc-c34470f41992-de.ts
index 418b72fd..16041dec 100644
--- a/lifx/translations/4e00ee30-79e2-447b-8dcc-c34470f41992-de.ts
+++ b/lifx/translations/4e00ee30-79e2-447b-8dcc-c34470f41992-de.ts
@@ -5,11 +5,11 @@
IntegrationPluginLifxLIFX server is not reachable.
-
+ LIFX Server ist nicht erreichbarThis token is invalid.
-
+ Der Token ist ungültig
@@ -193,41 +193,41 @@ The name of the ActionType ({8bd20350-0e79-45dc-b68a-84da99356863}) of ThingClas
The name of the ParamType (ThingClass: lifxAccount, EventType: connected, ID: {3e7b358b-d7de-4db4-8a3a-b9860eae186f})
----------
The name of the StateType ({3e7b358b-d7de-4db4-8a3a-b9860eae186f}) of ThingClass lifxAccount
-
+ VerbundenConnected changedThe name of the EventType ({3e7b358b-d7de-4db4-8a3a-b9860eae186f}) of ThingClass lifxAccount
-
+ Verbunden geändertLIFX cloud accountThe name of the ThingClass ({387c87f6-3e5b-4d6a-ba4d-372d0efad79f})
-
+ LIFX Cloud-AccountLogged inThe name of the ParamType (ThingClass: lifxAccount, EventType: loggedIn, ID: {0db34069-5de0-4233-baec-27f039228524})
----------
The name of the StateType ({0db34069-5de0-4233-baec-27f039228524}) of ThingClass lifxAccount
-
+ EingeloggedLogged in changedThe name of the EventType ({0db34069-5de0-4233-baec-27f039228524}) of ThingClass lifxAccount
-
+ Eingelogged geändertUser nameThe name of the ParamType (ThingClass: lifxAccount, EventType: userDisplayName, ID: {554afd9b-a2ec-4d28-9065-2b9ab3a9e3b2})
----------
The name of the StateType ({554afd9b-a2ec-4d28-9065-2b9ab3a9e3b2}) of ThingClass lifxAccount
-
+ BenutzernameUser name changedThe name of the EventType ({554afd9b-a2ec-4d28-9065-2b9ab3a9e3b2}) of ThingClass lifxAccount
-
+ Benutzername geändert