Schrack: Add firmware version state

master
Michael Zanetti 2023-03-02 17:52:14 +01:00
parent 9096691950
commit 776736b8e4
3 changed files with 18 additions and 0 deletions

View File

@ -171,6 +171,16 @@
"readSchedule": "init",
"description": "DIP switch states",
"access": "R"
},
{
"id": "firmwareVersion",
"address": 832,
"size": 16,
"type": "string",
"registerType": "holdingRegister",
"readSchedule": "init",
"description": "Firmware version",
"access": "R"
}
]
}

View File

@ -111,6 +111,7 @@ void IntegrationPluginSchrack::setupThing(ThingSetupInfo *info)
qCDebug(dcSchrack) << "DIP switche states:" << cionConnection->dipSwitches();
m_cionConnections.insert(thing, cionConnection);
info->finish(Thing::ThingErrorNoError);
info->thing()->setStateValue(cionCurrentVersionStateTypeId, cionConnection->firmwareVersion());
} else {
delete cionConnection;
info->finish(Thing::ThingErrorHardwareNotAvailable);

View File

@ -89,6 +89,13 @@
"displayNameEvent": "Charging started or stopped",
"type": "bool",
"defaultValue": false
},
{
"id": "33780b19-4855-4b5c-bd84-cec8400309be",
"name": "currentVersion",
"displayName": "Firmware version",
"type": "QString",
"defaultValue": ""
}
]
}