From cb9f4a82364801529a303699dd4a93e37300c1cd Mon Sep 17 00:00:00 2001 From: "l.heizinger" Date: Sat, 5 Mar 2022 14:50:17 +0100 Subject: [PATCH] Fixed SG ready action --- stiebeleltron/integrationpluginstiebeleltron.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/stiebeleltron/integrationpluginstiebeleltron.cpp b/stiebeleltron/integrationpluginstiebeleltron.cpp index 6f8a7dc..7d58501 100644 --- a/stiebeleltron/integrationpluginstiebeleltron.cpp +++ b/stiebeleltron/integrationpluginstiebeleltron.cpp @@ -346,14 +346,19 @@ void IntegrationPluginStiebelEltron::executeAction(ThingActionInfo *info) { qCDebug(dcStiebelEltron()) << "Execute action" << info->action().actionTypeId().toString() << info->action().params(); StiebelEltronModbusConnection::SmartGridState sgReadyState; - if (sgReadyModeString == "Mode 1") { + if (sgReadyModeString == "Off") { sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeOne; - } else if (sgReadyModeString == "Mode 2") { + } else if (sgReadyModeString == "Low") { sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeTwo; - } else if (sgReadyModeString == "Mode 3") { + } else if (sgReadyModeString == "Standard") { sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeThree; - } else { + } else if (sgReadyModeString == "High") { sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeFour; + } else { + qCWarning(dcStiebelEltron()) + << "Failed to set SG Ready mode. An unknown SG Ready mode was passed: " << sgReadyModeString; + info->finish(Thing::ThingErrorHardwareFailure); // TODO better matching error type? + return; } QModbusReply *reply = connection->setSgReadyState(sgReadyState);