no message

This commit is contained in:
dh
2025-06-24 14:21:07 +02:00
parent b4a9bd12db
commit 8c4430f444
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -14,6 +14,7 @@
</style> </style>
</head> </head>
<body> <body>
<div id="pv_visu"> <div id="pv_visu">
<div class="label" id="prodLabel"></div> <div class="label" id="prodLabel"></div>
<div class="bar-container"> <div class="bar-container">
@@ -37,14 +38,14 @@
} }
function handleMessage(msg) { function handleMessage(msg) {
try { try {
var d = (typeof msg === 'string') ? JSON.parse(msg) : msg; var data = (typeof msg === 'string') ? JSON.parse(msg) : msg;
Apply(d); Apply(data);
} catch (e) { } catch(e) {
console.error('PV_Visu handleMessage error', e, msg); console.error('PV_Visu handleMessage error:', e, msg);
} }
} }
// Register HTML-SDK handler // Bind to HTML-SDK
if (typeof registerMessageHandler === 'function') { if (typeof registerMessageHandler === 'function') {
registerMessageHandler(handleMessage); registerMessageHandler(handleMessage);
} }
</script> </script>
+1 -1
View File
@@ -130,4 +130,4 @@ class PV_Visu extends IPSModule
$values = AC_GetAggregatedValues($archives[0], $varID, 1, $start, $end, 1); $values = AC_GetAggregatedValues($archives[0], $varID, 1, $start, $end, 1);
return empty($values) ? 0.0 : (float) $values[0]['Avg']; return empty($values) ? 0.0 : (float) $values[0]['Avg'];
} }
}a }