Schrack: Add firmware version state
parent
9096691950
commit
776736b8e4
|
|
@ -171,6 +171,16 @@
|
||||||
"readSchedule": "init",
|
"readSchedule": "init",
|
||||||
"description": "DIP switch states",
|
"description": "DIP switch states",
|
||||||
"access": "R"
|
"access": "R"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "firmwareVersion",
|
||||||
|
"address": 832,
|
||||||
|
"size": 16,
|
||||||
|
"type": "string",
|
||||||
|
"registerType": "holdingRegister",
|
||||||
|
"readSchedule": "init",
|
||||||
|
"description": "Firmware version",
|
||||||
|
"access": "R"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ void IntegrationPluginSchrack::setupThing(ThingSetupInfo *info)
|
||||||
qCDebug(dcSchrack) << "DIP switche states:" << cionConnection->dipSwitches();
|
qCDebug(dcSchrack) << "DIP switche states:" << cionConnection->dipSwitches();
|
||||||
m_cionConnections.insert(thing, cionConnection);
|
m_cionConnections.insert(thing, cionConnection);
|
||||||
info->finish(Thing::ThingErrorNoError);
|
info->finish(Thing::ThingErrorNoError);
|
||||||
|
info->thing()->setStateValue(cionCurrentVersionStateTypeId, cionConnection->firmwareVersion());
|
||||||
} else {
|
} else {
|
||||||
delete cionConnection;
|
delete cionConnection;
|
||||||
info->finish(Thing::ThingErrorHardwareNotAvailable);
|
info->finish(Thing::ThingErrorHardwareNotAvailable);
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,13 @@
|
||||||
"displayNameEvent": "Charging started or stopped",
|
"displayNameEvent": "Charging started or stopped",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"defaultValue": false
|
"defaultValue": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "33780b19-4855-4b5c-bd84-cec8400309be",
|
||||||
|
"name": "currentVersion",
|
||||||
|
"displayName": "Firmware version",
|
||||||
|
"type": "QString",
|
||||||
|
"defaultValue": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue