myio-js-library 0.1.154 → 0.1.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -4862,6 +4862,8 @@ function normalizeParams(params) {
|
|
|
4862
4862
|
enableSelection: Boolean(params.enableSelection),
|
|
4863
4863
|
enableDragDrop: Boolean(params.enableDragDrop),
|
|
4864
4864
|
useNewComponents: Boolean(params.useNewComponents),
|
|
4865
|
+
// RFC-0091: Configurable delay time for connection status check (default 15 minutes)
|
|
4866
|
+
delayTimeConnectionInMins: params.delayTimeConnectionInMins ?? 15,
|
|
4865
4867
|
callbacks: {
|
|
4866
4868
|
handleActionDashboard: params.handleActionDashboard,
|
|
4867
4869
|
handleActionReport: params.handleActionReport,
|
|
@@ -5107,23 +5109,23 @@ function buildDOM(state) {
|
|
|
5107
5109
|
root.appendChild(footer);
|
|
5108
5110
|
return root;
|
|
5109
5111
|
}
|
|
5110
|
-
function verifyOfflineStatus(entityObject) {
|
|
5112
|
+
function verifyOfflineStatus(entityObject, delayTimeInMins = 15) {
|
|
5111
5113
|
const lastConnectionTime = new Date(entityObject.lastConnectTime || 0);
|
|
5112
5114
|
const lastDisconnectTime = new Date(entityObject.lastDisconnectTime || 0);
|
|
5113
5115
|
const now = /* @__PURE__ */ new Date();
|
|
5114
|
-
const
|
|
5116
|
+
const delayTimeInMs = delayTimeInMins * 60 * 1e3;
|
|
5115
5117
|
const timeSinceConnection = now.getTime() - lastConnectionTime.getTime();
|
|
5116
5118
|
if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
|
|
5117
5119
|
return false;
|
|
5118
5120
|
}
|
|
5119
|
-
if (timeSinceConnection <
|
|
5121
|
+
if (timeSinceConnection < delayTimeInMs) {
|
|
5120
5122
|
return false;
|
|
5121
5123
|
}
|
|
5122
5124
|
return true;
|
|
5123
5125
|
}
|
|
5124
5126
|
function paint(root, state) {
|
|
5125
|
-
const { entityObject, i18n } = state;
|
|
5126
|
-
if (verifyOfflineStatus(entityObject) === false) {
|
|
5127
|
+
const { entityObject, i18n, delayTimeConnectionInMins } = state;
|
|
5128
|
+
if (verifyOfflineStatus(entityObject, delayTimeConnectionInMins) === false) {
|
|
5127
5129
|
entityObject.deviceStatus = DeviceStatusType.NO_INFO;
|
|
5128
5130
|
}
|
|
5129
5131
|
const stateClass = getCardStateClass(entityObject.deviceStatus);
|
package/dist/index.js
CHANGED
|
@@ -4754,6 +4754,8 @@ function normalizeParams(params) {
|
|
|
4754
4754
|
enableSelection: Boolean(params.enableSelection),
|
|
4755
4755
|
enableDragDrop: Boolean(params.enableDragDrop),
|
|
4756
4756
|
useNewComponents: Boolean(params.useNewComponents),
|
|
4757
|
+
// RFC-0091: Configurable delay time for connection status check (default 15 minutes)
|
|
4758
|
+
delayTimeConnectionInMins: params.delayTimeConnectionInMins ?? 15,
|
|
4757
4759
|
callbacks: {
|
|
4758
4760
|
handleActionDashboard: params.handleActionDashboard,
|
|
4759
4761
|
handleActionReport: params.handleActionReport,
|
|
@@ -4999,23 +5001,23 @@ function buildDOM(state) {
|
|
|
4999
5001
|
root.appendChild(footer);
|
|
5000
5002
|
return root;
|
|
5001
5003
|
}
|
|
5002
|
-
function verifyOfflineStatus(entityObject) {
|
|
5004
|
+
function verifyOfflineStatus(entityObject, delayTimeInMins = 15) {
|
|
5003
5005
|
const lastConnectionTime = new Date(entityObject.lastConnectTime || 0);
|
|
5004
5006
|
const lastDisconnectTime = new Date(entityObject.lastDisconnectTime || 0);
|
|
5005
5007
|
const now = /* @__PURE__ */ new Date();
|
|
5006
|
-
const
|
|
5008
|
+
const delayTimeInMs = delayTimeInMins * 60 * 1e3;
|
|
5007
5009
|
const timeSinceConnection = now.getTime() - lastConnectionTime.getTime();
|
|
5008
5010
|
if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
|
|
5009
5011
|
return false;
|
|
5010
5012
|
}
|
|
5011
|
-
if (timeSinceConnection <
|
|
5013
|
+
if (timeSinceConnection < delayTimeInMs) {
|
|
5012
5014
|
return false;
|
|
5013
5015
|
}
|
|
5014
5016
|
return true;
|
|
5015
5017
|
}
|
|
5016
5018
|
function paint(root, state) {
|
|
5017
|
-
const { entityObject, i18n } = state;
|
|
5018
|
-
if (verifyOfflineStatus(entityObject) === false) {
|
|
5019
|
+
const { entityObject, i18n, delayTimeConnectionInMins } = state;
|
|
5020
|
+
if (verifyOfflineStatus(entityObject, delayTimeConnectionInMins) === false) {
|
|
5019
5021
|
entityObject.deviceStatus = DeviceStatusType.NO_INFO;
|
|
5020
5022
|
}
|
|
5021
5023
|
const stateClass = getCardStateClass(entityObject.deviceStatus);
|
|
@@ -4746,6 +4746,8 @@
|
|
|
4746
4746
|
enableSelection: Boolean(params.enableSelection),
|
|
4747
4747
|
enableDragDrop: Boolean(params.enableDragDrop),
|
|
4748
4748
|
useNewComponents: Boolean(params.useNewComponents),
|
|
4749
|
+
// RFC-0091: Configurable delay time for connection status check (default 15 minutes)
|
|
4750
|
+
delayTimeConnectionInMins: params.delayTimeConnectionInMins ?? 15,
|
|
4749
4751
|
callbacks: {
|
|
4750
4752
|
handleActionDashboard: params.handleActionDashboard,
|
|
4751
4753
|
handleActionReport: params.handleActionReport,
|
|
@@ -4991,23 +4993,23 @@
|
|
|
4991
4993
|
root.appendChild(footer);
|
|
4992
4994
|
return root;
|
|
4993
4995
|
}
|
|
4994
|
-
function verifyOfflineStatus(entityObject) {
|
|
4996
|
+
function verifyOfflineStatus(entityObject, delayTimeInMins = 15) {
|
|
4995
4997
|
const lastConnectionTime = new Date(entityObject.lastConnectTime || 0);
|
|
4996
4998
|
const lastDisconnectTime = new Date(entityObject.lastDisconnectTime || 0);
|
|
4997
4999
|
const now = /* @__PURE__ */ new Date();
|
|
4998
|
-
const
|
|
5000
|
+
const delayTimeInMs = delayTimeInMins * 60 * 1e3;
|
|
4999
5001
|
const timeSinceConnection = now.getTime() - lastConnectionTime.getTime();
|
|
5000
5002
|
if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
|
|
5001
5003
|
return false;
|
|
5002
5004
|
}
|
|
5003
|
-
if (timeSinceConnection <
|
|
5005
|
+
if (timeSinceConnection < delayTimeInMs) {
|
|
5004
5006
|
return false;
|
|
5005
5007
|
}
|
|
5006
5008
|
return true;
|
|
5007
5009
|
}
|
|
5008
5010
|
function paint(root, state) {
|
|
5009
|
-
const { entityObject, i18n } = state;
|
|
5010
|
-
if (verifyOfflineStatus(entityObject) === false) {
|
|
5011
|
+
const { entityObject, i18n, delayTimeConnectionInMins } = state;
|
|
5012
|
+
if (verifyOfflineStatus(entityObject, delayTimeConnectionInMins) === false) {
|
|
5011
5013
|
entityObject.deviceStatus = DeviceStatusType.NO_INFO;
|
|
5012
5014
|
}
|
|
5013
5015
|
const stateClass = getCardStateClass(entityObject.deviceStatus);
|