no message

This commit is contained in:
2025-06-24 11:27:43 +02:00
parent 421a73cead
commit c3796d0800
2 changed files with 35 additions and 31 deletions

View File

@@ -35,8 +35,18 @@
document.getElementById('barPV').style.width = data.consPV + '%';
document.getElementById('barGrid').style.width = data.consGrid + '%';
}
function handleMessage(msg) { Apply(msg); }
// Kein requestAction-Aufruf hier nötig
function handleMessage(msg) {
try {
var data = (typeof msg === 'string') ? JSON.parse(msg) : msg;
Apply(data);
} catch(e) {
console.error('PV_Visu handleMessage error:', e, msg);
}
}
// Bind to HTML-SDK
if (typeof registerMessageHandler === 'function') {
registerMessageHandler(handleMessage);
}
</script>
</body>
</html>