Fixed SG ready action
This commit is contained in:
parent
e8a8a060d0
commit
cb9f4a8236
@ -346,14 +346,19 @@ void IntegrationPluginStiebelEltron::executeAction(ThingActionInfo *info) {
|
|||||||
qCDebug(dcStiebelEltron()) << "Execute action" << info->action().actionTypeId().toString()
|
qCDebug(dcStiebelEltron()) << "Execute action" << info->action().actionTypeId().toString()
|
||||||
<< info->action().params();
|
<< info->action().params();
|
||||||
StiebelEltronModbusConnection::SmartGridState sgReadyState;
|
StiebelEltronModbusConnection::SmartGridState sgReadyState;
|
||||||
if (sgReadyModeString == "Mode 1") {
|
if (sgReadyModeString == "Off") {
|
||||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeOne;
|
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeOne;
|
||||||
} else if (sgReadyModeString == "Mode 2") {
|
} else if (sgReadyModeString == "Low") {
|
||||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeTwo;
|
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeTwo;
|
||||||
} else if (sgReadyModeString == "Mode 3") {
|
} else if (sgReadyModeString == "Standard") {
|
||||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeThree;
|
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeThree;
|
||||||
} else {
|
} else if (sgReadyModeString == "High") {
|
||||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeFour;
|
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);
|
QModbusReply *reply = connection->setSgReadyState(sgReadyState);
|
||||||
|
|||||||
Reference in New Issue
Block a user