fix: retain Symcon webhook registration and show configured view title
This commit is contained in:
1 parent
8845efdc23
commit
510aece983
14 files changed
+145
-44
No files matched your search
@@ -25,6 +25,7 @@ try {
|
||||
await page.setViewport({ width: 1440, height: 1000 });
|
||||
await page.goto(`http://127.0.0.1:${server.address().port}/preview/index.html`, { waitUntil: "networkidle0" });
|
||||
await page.waitForFunction(() => window.nfPanel?.data.building?.floors.length);
|
||||
assert.equal(await page.evaluate(() => window.nfPanel.shadowRoot.querySelector("h1").textContent.trim()), "NextFloor", "the normal preview retains the default title");
|
||||
await page.evaluate(async () => {
|
||||
const p = window.nfPanel;
|
||||
p._floorId = p.data.building.floors[0].id;
|
||||
@@ -167,13 +168,14 @@ try {
|
||||
if (request.action === "variables/action") { window.actuatorCalls.push(request); return new Response("[]"); }
|
||||
return new Response(JSON.stringify({ state_revision: 1, building_revision: 1, variables, objects, areas: [] }));
|
||||
};
|
||||
window.__NEXTFLOOR_SYMCON__ = { endpoint: "/hook/controls-fixture", token: "fixture-only" };
|
||||
window.__NEXTFLOOR_SYMCON__ = { endpoint: "/hook/controls-fixture", token: "fixture-only", title: "Haus & Büro <West>" };
|
||||
const bridge = new window.SymconAdapter.SymconBridge();
|
||||
const h = await bridge.start();
|
||||
bridge.stop();
|
||||
const p = window.nfPanel;
|
||||
p.hass = { ...p.hass, states: h.states, entities: h.entities, symconObjects: h.symconObjects, callService: h.callService };
|
||||
p.hass = { ...p.hass, states: h.states, entities: h.entities, symconObjects: h.symconObjects, symconTitle: h.symconTitle, callService: h.callService };
|
||||
await p.updateComplete;
|
||||
if (p.shadowRoot.querySelector("h1 .nf-view-title").textContent !== "Haus & Büro <West>" || p.shadowRoot.querySelector("h1 west")) throw new Error("Configured view name must replace the brand text as plain text");
|
||||
const e = window.ed;
|
||||
await e.updateComplete;
|
||||
const f = e._doc.floors[0];
|
||||
|
||||
Reference in new issue
Block a user