Keba: Add a phase count setting to the Keba germany edition
parent
5b57ae2faa
commit
a1db958f56
|
|
@ -432,6 +432,16 @@ void IntegrationPluginKeba::setupKeba(ThingSetupInfo *info, const QHostAddress &
|
||||||
thing->setStateValue("hostAddress", address.toString());
|
thing->setStateValue("hostAddress", address.toString());
|
||||||
thing->setStateValue("firmware", report.firmware);
|
thing->setStateValue("firmware", report.firmware);
|
||||||
thing->setStateValue("uptime", report.seconds / 60);
|
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();
|
keba->getReport1();
|
||||||
|
|
|
||||||
|
|
@ -429,6 +429,17 @@
|
||||||
"readOnly": true
|
"readOnly": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"settingsTypes": [
|
||||||
|
{
|
||||||
|
"id": "42f32882-ae1c-455e-a044-3f589056a148",
|
||||||
|
"name": "phaseCount",
|
||||||
|
"displayName": "Phase count",
|
||||||
|
"type": "uint",
|
||||||
|
"minValue": 1,
|
||||||
|
"maxValue": 3,
|
||||||
|
"defaultValue": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
"stateTypes": [
|
"stateTypes": [
|
||||||
{
|
{
|
||||||
"id": "995f2ccf-2082-434e-a46d-c506862e6d6a",
|
"id": "995f2ccf-2082-434e-a46d-c506862e6d6a",
|
||||||
|
|
@ -458,6 +469,16 @@
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"defaultValue": false
|
"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",
|
"id": "955ffd64-42f6-4000-94c5-c7f862daa438",
|
||||||
"name": "activity",
|
"name": "activity",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue