v0.13.7
This commit is contained in:
+8
-11
@@ -26,17 +26,14 @@ async function handleWebSocketMessage(event) {
|
||||
try {
|
||||
const message = JSON.parse(event.data);
|
||||
if (message.event === 'bootstrap') {
|
||||
const data = message.data; app.devices = data.devices || []; app.zones = data.zones || []; app.groups = data.groups || []; app.schedules = data.schedules || []; app.automations = data.automations || [];
|
||||
app.flows = data.flows || []; await loadSettingsSections(data.house?.mode || app.settings?.house_mode || 'cool'); app.system = data.system || app.system; app.systemSnapshotAt = Date.now(); app.outdoorTemperature = Number.isFinite(Number(data.outdoor_temperature)) ? Number(data.outdoor_temperature) : app.outdoorTemperature;
|
||||
if (data.control_plan) {
|
||||
app.controlPlan = data.control_plan;
|
||||
app.controlPlanRevision = Number.isFinite(Number(data.control_plan_revision)) ? Number(data.control_plan_revision) : app.controlPlanRevision;
|
||||
app.controlPlanPushReady = true;
|
||||
stopControlPlanFallback();
|
||||
} else {
|
||||
app.controlPlanPushReady = false;
|
||||
}
|
||||
renderAll(); if (!data.control_plan) scheduleControlPlanLoad(0); if (app.settings?.debug?.overlay_enabled) loadDebugBacklog(); return;
|
||||
const data = message.data || {};
|
||||
const hasControlPlan = applyBootstrapSnapshot(data);
|
||||
app.controlPlanPushReady = hasControlPlan;
|
||||
if (hasControlPlan) stopControlPlanFallback();
|
||||
renderAll();
|
||||
if (!hasControlPlan) scheduleControlPlanLoad(0);
|
||||
if (app.settings?.debug?.overlay_enabled) loadDebugBacklog();
|
||||
return;
|
||||
}
|
||||
const data = message.data || {};
|
||||
if (message.event === 'control_plan.updated') { app.controlPlanPushReady = true; stopControlPlanFallback(); applyControlPlan(data.plan, data.revision); }
|
||||
|
||||
Reference in New Issue
Block a user