+
-
Channels
+
Reboot
@@ -61,26 +117,6 @@
-
-
-
@@ -107,6 +143,15 @@ export default {
getNodeLongName: (nodeId) => NodeUtils.getNodeLongName(nodeId),
getNodeColour: (nodeId) => NodeUtils.getNodeColour(nodeId),
getNodeTextColour: (nodeId) => NodeUtils.getNodeTextColour(nodeId),
+ async getDeviceFirmwareVersion(nodeId) {
+ try {
+ const response = await NodeAPI.remoteAdminGetDeviceMetadata(nodeId);
+ const firmwareVersion = response.firmwareVersion;
+ alert(firmwareVersion ?? "Unknown Firmware Version");
+ } catch(e) {
+ DialogUtils.showErrorAlert(e);
+ }
+ },
async reboot(nodeId) {
// confirm user wants to reboot node
diff --git a/src/js/NodeAPI.js b/src/js/NodeAPI.js
index e16bf5d..e084e30 100644
--- a/src/js/NodeAPI.js
+++ b/src/js/NodeAPI.js
@@ -481,6 +481,26 @@ class NodeAPI {
}
+ /**
+ * Sends an admin request to get device metadata from the provided node id
+ * @param nodeId
+ * @returns {Promise<*>}
+ */
+ static async remoteAdminGetDeviceMetadata(nodeId) {
+
+ // create admin message packet
+ const adminMessageRequest = Protobuf.Admin.AdminMessage.fromJson({
+ getDeviceMetadataRequest: true,
+ });
+
+ // send packet and wait for response
+ const adminMessageResponse = await this.sendAdminPacketAndWaitForResponse(nodeId, adminMessageRequest, true);
+
+ // return device metadata from admin response
+ return adminMessageResponse.payloadVariant.value;
+
+ }
+
}
export default NodeAPI;