From b9c706cec292df2347faa3f8d367e8ff315deaf5 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Wed, 24 Jan 2024 15:27:01 +0000 Subject: [PATCH] fix amt powerstate again #5722 Signed-off-by: Simon Smith --- amtmanager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/amtmanager.js b/amtmanager.js index 1d522962..4c1d6026 100644 --- a/amtmanager.js +++ b/amtmanager.js @@ -931,8 +931,8 @@ module.exports.CreateAmtManager = function (parent) { if (response.Body.OSPowerSavingState == 2) { meshPowerState = 1; } // Fully powered (S0); else if (response.Body.OSPowerSavingState == 3) { meshPowerState = 2; } // Modern standby (We are going to call this S1); - // Set OS power state - if (meshPowerState >= 0) { parent.SetConnectivityState(dev.meshid, dev.nodeid, Date.now(), 2, meshPowerState, null, { name: dev.name }); } + // Set OS power state - connType: 0 = CIRA, 1 = CIRA-Relay, 2 = CIRA-LMS, 3 = LAN + if (meshPowerState >= 0) { parent.SetConnectivityState(dev.meshid, dev.nodeid, Date.now(), (dev.connType == 3 ? 4 : 2), meshPowerState, null, { name: dev.name }); } }); } else { // Convert the power state @@ -941,8 +941,8 @@ module.exports.CreateAmtManager = function (parent) { var meshPowerState = -1, powerConversionTable = [-1, -1, 1, 2, 3, 6, 6, 5, 6]; if (powerstate < powerConversionTable.length) { meshPowerState = powerConversionTable[powerstate]; } else { powerstate = 6; } - // Set power state - if (meshPowerState >= 0) { parent.SetConnectivityState(dev.meshid, dev.nodeid, Date.now(), 2, meshPowerState, null, { name: dev.name }); } + // Set power state - connType: 0 = CIRA, 1 = CIRA-Relay, 2 = CIRA-LMS, 3 = LAN + if (meshPowerState >= 0) { parent.SetConnectivityState(dev.meshid, dev.nodeid, Date.now(), (dev.connType == 3 ? 4 : 2), meshPowerState, null, { name: dev.name }); } } }); }