Keba: Add a phase count setting to the Keba germany edition

master
Michael Zanetti 2022-06-27 23:59:21 +02:00
parent 5b57ae2faa
commit a1db958f56
2 changed files with 31 additions and 0 deletions

View File

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

View File

@ -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",