diff --git a/keba/integrationpluginkeba.cpp b/keba/integrationpluginkeba.cpp index 1e976f5d..24306474 100644 --- a/keba/integrationpluginkeba.cpp +++ b/keba/integrationpluginkeba.cpp @@ -432,6 +432,16 @@ void IntegrationPluginKeba::setupKeba(ThingSetupInfo *info, const QHostAddress & thing->setStateValue("hostAddress", address.toString()); thing->setStateValue("firmware", report.firmware); thing->setStateValue("uptime", report.seconds / 60); + + if (thing->thingClassId() == kebaSimpleThingClassId) { + thing->setStateValue(kebaSimplePhaseCountStateTypeId, thing->setting(kebaSimpleThingClassId)); + } + + connect(thing, &Thing::settingChanged, thing, [thing](const ParamTypeId &settingsTypeId, const QVariant &value){ + if (settingsTypeId == kebaSimpleSettingsPhaseCountParamTypeId) { + thing->setStateValue(kebaSimplePhaseCountStateTypeId, value); + } + }); }); keba->getReport1(); diff --git a/keba/integrationpluginkeba.json b/keba/integrationpluginkeba.json index 35434757..44af0a97 100644 --- a/keba/integrationpluginkeba.json +++ b/keba/integrationpluginkeba.json @@ -429,6 +429,17 @@ "readOnly": true } ], + "settingsTypes": [ + { + "id": "42f32882-ae1c-455e-a044-3f589056a148", + "name": "phaseCount", + "displayName": "Phase count", + "type": "uint", + "minValue": 1, + "maxValue": 3, + "defaultValue": 3 + } + ], "stateTypes": [ { "id": "995f2ccf-2082-434e-a46d-c506862e6d6a", @@ -458,6 +469,16 @@ "type": "bool", "defaultValue": false }, + { + "id": "2473e39b-9641-4236-be56-e706d7797161", + "name": "phaseCount", + "displayName": "Number of connected phases", + "displayNameEvent": "Number of connected phases changed", + "type": "uint", + "minValue": 1, + "maxValue": 3, + "defaultValue": 3 + }, { "id": "955ffd64-42f6-4000-94c5-c7f862daa438", "name": "activity",