add CLAUDE.md and fix MQTT empty message handling
- CLAUDE.md: document project architecture, resilience constraint, workflow and all helper scripts - pool.js: guard against empty MQTT messages before JSON.parse (prevents crash when msg is "") - pool.js: remove stale TODO about force off when duration==0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
10
pool.js
10
pool.js
@@ -299,14 +299,22 @@ MQTT.subscribe(
|
||||
function (topic, msg) {
|
||||
status.tick_mqtt++;
|
||||
print("[POOL] mqtt", topic, msg);
|
||||
<<<<<<< HEAD
|
||||
if (msg == "") {
|
||||
return;
|
||||
}
|
||||
let obj = JSON.parse(msg);
|
||||
if (obj.temperature === undefined) {
|
||||
return;
|
||||
=======
|
||||
if (msg != "") {
|
||||
let obj = JSON.parse(msg);
|
||||
if (obj.temperature === undefined) {
|
||||
return;
|
||||
}
|
||||
update_temp(obj.temperature);
|
||||
>>>>>>> 2d0d8cb (add CLAUDE.md and fix MQTT empty message handling)
|
||||
}
|
||||
update_temp(obj.temperature);
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user