diff --git a/simpleheatpump/integrationpluginsimpleheatpump.cpp b/simpleheatpump/integrationpluginsimpleheatpump.cpp index 048e1881..442a1c13 100644 --- a/simpleheatpump/integrationpluginsimpleheatpump.cpp +++ b/simpleheatpump/integrationpluginsimpleheatpump.cpp @@ -69,7 +69,7 @@ void IntegrationPluginSimpleHeatpump::setupThing(ThingSetupInfo *info) } int gpioNumber = thing->paramValue(simpleHeatPumpInterfaceThingGpioNumberParamTypeId).toInt(); - bool initialValue = thing->stateValue(simpleHeatPumpInterfaceBoostStateTypeId).toBool(); + bool initialValue = thing->stateValue(simpleHeatPumpInterfacePowerStateTypeId).toBool(); if (gpioNumber < 0) { qCWarning(dcSimpleHeatPump()) << "Invalid GPIO number" << gpioNumber; @@ -126,15 +126,15 @@ void IntegrationPluginSimpleHeatpump::executeAction(ThingActionInfo *info) return; } - if (info->action().actionTypeId() == simpleHeatPumpInterfaceBoostActionTypeId) { - bool boostEnabled = info->action().paramValue(simpleHeatPumpInterfaceBoostActionBoostParamTypeId).toBool(); - if (!gpio->setValue(boostEnabled ? Gpio::ValueHigh : Gpio::ValueLow)) { - qCWarning(dcSimpleHeatPump()) << "Failed to set the boost mode for" << thing << "to" << boostEnabled; + if (info->action().actionTypeId() == simpleHeatPumpInterfacePowerActionTypeId) { + bool heatPumpEnabled = info->action().paramValue(simpleHeatPumpInterfacePowerActionPowerParamTypeId).toBool(); + if (!gpio->setValue(heatPumpEnabled ? Gpio::ValueHigh : Gpio::ValueLow)) { + qCWarning(dcSimpleHeatPump()) << "Failed to set the power for" << thing << "to" << heatPumpEnabled; info->finish(Thing::ThingErrorHardwareFailure); return; } - thing->setStateValue(simpleHeatPumpInterfaceBoostStateTypeId, boostEnabled); + thing->setStateValue(simpleHeatPumpInterfacePowerStateTypeId, heatPumpEnabled); info->finish(Thing::ThingErrorNoError); } } diff --git a/simpleheatpump/integrationpluginsimpleheatpump.json b/simpleheatpump/integrationpluginsimpleheatpump.json index ebcccf6f..ede890ae 100644 --- a/simpleheatpump/integrationpluginsimpleheatpump.json +++ b/simpleheatpump/integrationpluginsimpleheatpump.json @@ -28,10 +28,10 @@ "stateTypes": [ { "id": "f8bccedf-5eb2-49a0-b892-c398dbd6a18d", - "name": "boost", - "displayName": "Boost production enabled", - "displayNameEvent": "Boost production changed", - "displayNameAction": "Boost production", + "name": "power", + "displayName": "Heat pump enabled", + "displayNameEvent": "Heat pump power changed", + "displayNameAction": "Enable/Disable heat pump power", "type": "bool", "writable": true, "defaultValue": false,