Fixed SG ready action

pull/52/head
l.heizinger 2022-03-05 14:50:17 +01:00 committed by Simon Stürz
parent e8a8a060d0
commit cb9f4a8236
1 changed files with 9 additions and 4 deletions

View File

@ -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);