fix: retain Symcon webhook registration and show configured view title

This commit is contained in:
jhartworks committed 2026-11-10 12:39:30 +01:00
1 parent 28dd3880b5
commit 0fed9dc5e5
6 files changed
+103 -33

No files matched your search

+15 -8
View File
@@ -1,7 +1,7 @@
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */ /*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
var k={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=r=>r===void 0?r:JSON.parse(JSON.stringify(r)));var Mn=globalThis,An=Mn.ShadowRoot&&(Mn.ShadyCSS===void 0||Mn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lr=Symbol(),Mi=new WeakMap,Ot=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Lr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(An&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Mi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Mi.set(t,e))}return e}toString(){return this.cssText}},Ai=r=>new Ot(typeof r=="string"?r:r+"",void 0,Lr),ne=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[i+1],r[0]);return new Ot(t,r,Lr)},Ei=(r,e)=>{if(An)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),o=Mn.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}},Br=An?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Ai(t)})(r):r;var{is:cu,defineProperty:uu,getOwnPropertyDescriptor:du,getOwnPropertyNames:hu,getOwnPropertySymbols:mu,getPrototypeOf:pu}=Object,En=globalThis,Ri=En.trustedTypes,fu=Ri?Ri.emptyScript:"",gu=En.reactiveElementPolyfillSupport,Wt=(r,e)=>r,Vr={toAttribute(r,e){switch(e){case Boolean:r=r?fu:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Ti=(r,e)=>!cu(r,e),zi={attribute:!0,type:String,converter:Vr,reflect:!1,useDefault:!1,hasChanged:Ti};Symbol.metadata??=Symbol("metadata"),En.litPropertyMetadata??=new WeakMap;var Ae=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=zi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),o=this.getPropertyDescriptor(e,n,t);o!==void 0&&uu(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){let{get:o,set:i}=du(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:o,set(s){let a=o?.call(this);i?.call(this,s),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??zi}static _$Ei(){if(this.hasOwnProperty(Wt("elementProperties")))return;let e=pu(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Wt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wt("properties"))){let t=this.properties,n=[...hu(t),...mu(t)];for(let o of n)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,o]of t)this.elementProperties.set(n,o)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let o=this._$Eu(t,n);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let o of n)t.unshift(Br(o))}else e!==void 0&&t.push(Br(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shaLine truncated var k={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=r=>r===void 0?r:JSON.parse(JSON.stringify(r)));var Mn=globalThis,An=Mn.ShadowRoot&&(Mn.ShadyCSS===void 0||Mn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lr=Symbol(),Mi=new WeakMap,Ot=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Lr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(An&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Mi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Mi.set(t,e))}return e}toString(){return this.cssText}},Ai=r=>new Ot(typeof r=="string"?r:r+"",void 0,Lr),ne=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[i+1],r[0]);return new Ot(t,r,Lr)},Ei=(r,e)=>{if(An)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),o=Mn.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}},Br=An?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Ai(t)})(r):r;var{is:cu,defineProperty:uu,getOwnPropertyDescriptor:du,getOwnPropertyNames:hu,getOwnPropertySymbols:mu,getPrototypeOf:pu}=Object,En=globalThis,Ri=En.trustedTypes,fu=Ri?Ri.emptyScript:"",gu=En.reactiveElementPolyfillSupport,Wt=(r,e)=>r,Vr={toAttribute(r,e){switch(e){case Boolean:r=r?fu:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Ti=(r,e)=>!cu(r,e),zi={attribute:!0,type:String,converter:Vr,reflect:!1,useDefault:!1,hasChanged:Ti};Symbol.metadata??=Symbol("metadata"),En.litPropertyMetadata??=new WeakMap;var Ae=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=zi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),o=this.getPropertyDescriptor(e,n,t);o!==void 0&&uu(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){let{get:o,set:i}=du(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:o,set(s){let a=o?.call(this);i?.call(this,s),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??zi}static _$Ei(){if(this.hasOwnProperty(Wt("elementProperties")))return;let e=pu(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Wt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wt("properties"))){let t=this.properties,n=[...hu(t),...mu(t)];for(let o of n)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,o]of t)this.elementProperties.set(n,o)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let o=this._$Eu(t,n);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let o of n)t.unshift(Br(o))}else e!==void 0&&t.push(Br(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shaLine truncated
\f\r]`,Lt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pi=/-->/g,Hi=/>/g,Je=RegExp(`>|${Kr}(?:([^\\s"'>=/]+)(${Kr}*=${Kr}*(?:[^ \f\r]`,Lt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pi=/-->/g,Hi=/>/g,Je=RegExp(`>|${Kr}(?:([^\\s"'>=/]+)(${Kr}*=${Kr}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ii=/'/g,Ci=/"/g,Li=/^(?:script|style|textarea|title)$/i,Qr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),p=Qr(1),Q=Qr(2),Xp=Qr(3),et=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ni=new WeakMap,Qe=Xe.createTreeWalker(Xe,129);function Bi(r,e){if(!Jr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fi!==void 0?Fi.createHTML(e):e}var vu=(r,e)=>{let t=r.length-1,n=[],o,i=e===2?"<svg>":e===3?"<math>":"",s=Lt;for(let a=0;a<t;a++){let l=r[a],c,u,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,u=s.exec(l),u!==null);)m=s.lastIndex,s===Lt?u[1]==="!--"?s=Pi:u[1]!==void 0?s=Hi:u[2]!==void 0?(Li.test(u[2])&&(o=RegExp("</"+u[2],"g")),s=Je):u[3]!==void 0&&(s=Je):s===Je?u[0]===">"?(s=o??Lt,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?Je:u[3]==='"'?Ci:Ii):s===Ci||s===Ii?s=Je:s===Pi||s===Hi?s=Lt:(s=Je,o=void 0);let d=s===Je&&r[a+1].startsWith("/>")?" ":"";i+=s===Lt?l+_u:h>=0?(n.push(c),l.slice(0,h)+Oi+l.slice(h)+Le+d):l+Le+(h===-2?a:d)}return[Bi(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Kt=class r{constructor({strings:e,_$litType$:t},n){let o;this.parts=[];let i=0,s=0,a=e.length-1,l=this.parts,[c,u]=vu(e,t);if(this.el=r.createElement(c,n),Qe.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(o=Qe.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let h of o.getAttributeNames())if(h.endsWith(Oi)){let m=u[s++],d=o.getAttribute(h).split(Le),_=/([.?@])?(.*)/.exec(m);l.push({type:1,index:i,name:_[2],strings:d,ctor:_[1]==="."?Ur:_[1]==="?"?jr:_[1]==="@"?qr:pt}),o.removeAttribute(h)}else h.startsWith(Le)&&(l.push({type:6,index:i}),o.removeAttribute(h));if(Li.test(o.tagName)){let h=o.textContent.split(Le),m=h.length-1;if(m>0){o.textContent=Rn?Rn.emptyScript:"";for(let d=0;d<m;d++)o.append(h[d],Bt()),Qe.nextNode(),l.push({type:2,index:++i});o.append(h[m],Bt())}}}else if(o.nodeType===8)if(o.data===Wi)l.push({type:2,index:i});else{let h=-1;for(;(h=o.data.indexOf(Le,h+1))!==-1;)l.push({type:7,index:i}),h+=Le.length-1}i++}}static createElement(e,t){let n=Xe.createElement("template");return n.innerHTML=e,n}};function mt(r,e,t=r,n){if(e===et)return e;let o=n!==void 0?t._$Co?.[n]:t._$Cl,i=Vt(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(r),o._$AT(r,t,n)),n!==void 0?(t._$Co??=[])[n]=o:t._$Cl=o),o!==void 0&&(e=mt(r,o._$AS(r,e.values),o,n)),e}var Gr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,o=(e?.creationScope??Xe).importNode(t,!0);Qe.currentNode=o;let i=Qe.nextNode(),s=0,a=0,l=n[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new Gt(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new Zr(i,this,e)),this._$AV.push(c),l=n[++a]}s!==l?.index&&(i=Qe.nextNode(),s++)}return Qe.currentNode=Xe,o}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Gt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,o){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=mt(this,e,t),Vt(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==et&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):bu(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&Vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xe.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,o=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Kt.createElement(Bi(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new Gr(o,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=Ni.get(e.strings);return t===void 0&&Ni.set(e.strings,t=new Kt(e)),t}k(e){Jr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,o=0;for(let i of e)o===t.length?t.push(n=new r(this.O(Bt()),this.O(Bt()),this,this.options)):n=t[o],n._$AI(i),o++;o<t.length&&(this._$AR(n&&n._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Di(e).nextSibling;Di(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},pt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,o,i){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._Line truncated \f\r"'\`<>=]|("|')|))|$)`,"g"),Ii=/'/g,Ci=/"/g,Li=/^(?:script|style|textarea|title)$/i,Qr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),p=Qr(1),Q=Qr(2),Xp=Qr(3),et=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ni=new WeakMap,Qe=Xe.createTreeWalker(Xe,129);function Bi(r,e){if(!Jr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fi!==void 0?Fi.createHTML(e):e}var vu=(r,e)=>{let t=r.length-1,n=[],o,i=e===2?"<svg>":e===3?"<math>":"",s=Lt;for(let a=0;a<t;a++){let l=r[a],c,u,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,u=s.exec(l),u!==null);)m=s.lastIndex,s===Lt?u[1]==="!--"?s=Pi:u[1]!==void 0?s=Hi:u[2]!==void 0?(Li.test(u[2])&&(o=RegExp("</"+u[2],"g")),s=Je):u[3]!==void 0&&(s=Je):s===Je?u[0]===">"?(s=o??Lt,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?Je:u[3]==='"'?Ci:Ii):s===Ci||s===Ii?s=Je:s===Pi||s===Hi?s=Lt:(s=Je,o=void 0);let d=s===Je&&r[a+1].startsWith("/>")?" ":"";i+=s===Lt?l+_u:h>=0?(n.push(c),l.slice(0,h)+Oi+l.slice(h)+Le+d):l+Le+(h===-2?a:d)}return[Bi(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Kt=class r{constructor({strings:e,_$litType$:t},n){let o;this.parts=[];let i=0,s=0,a=e.length-1,l=this.parts,[c,u]=vu(e,t);if(this.el=r.createElement(c,n),Qe.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(o=Qe.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let h of o.getAttributeNames())if(h.endsWith(Oi)){let m=u[s++],d=o.getAttribute(h).split(Le),_=/([.?@])?(.*)/.exec(m);l.push({type:1,index:i,name:_[2],strings:d,ctor:_[1]==="."?Ur:_[1]==="?"?jr:_[1]==="@"?qr:pt}),o.removeAttribute(h)}else h.startsWith(Le)&&(l.push({type:6,index:i}),o.removeAttribute(h));if(Li.test(o.tagName)){let h=o.textContent.split(Le),m=h.length-1;if(m>0){o.textContent=Rn?Rn.emptyScript:"";for(let d=0;d<m;d++)o.append(h[d],Bt()),Qe.nextNode(),l.push({type:2,index:++i});o.append(h[m],Bt())}}}else if(o.nodeType===8)if(o.data===Wi)l.push({type:2,index:i});else{let h=-1;for(;(h=o.data.indexOf(Le,h+1))!==-1;)l.push({type:7,index:i}),h+=Le.length-1}i++}}static createElement(e,t){let n=Xe.createElement("template");return n.innerHTML=e,n}};function mt(r,e,t=r,n){if(e===et)return e;let o=n!==void 0?t._$Co?.[n]:t._$Cl,i=Vt(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(r),o._$AT(r,t,n)),n!==void 0?(t._$Co??=[])[n]=o:t._$Cl=o),o!==void 0&&(e=mt(r,o._$AS(r,e.values),o,n)),e}var Gr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,o=(e?.creationScope??Xe).importNode(t,!0);Qe.currentNode=o;let i=Qe.nextNode(),s=0,a=0,l=n[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new Gt(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new Zr(i,this,e)),this._$AV.push(c),l=n[++a]}s!==l?.index&&(i=Qe.nextNode(),s++)}return Qe.currentNode=Xe,o}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Gt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,o){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=mt(this,e,t),Vt(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==et&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):bu(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&Vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xe.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,o=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Kt.createElement(Bi(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new Gr(o,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=Ni.get(e.strings);return t===void 0&&Ni.set(e.strings,t=new Kt(e)),t}k(e){Jr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,o=0;for(let i of e)o===t.length?t.push(n=new r(this.O(Bt()),this.O(Bt()),this,this.options)):n=t[o],n._$AI(i),o++;o<t.length&&(this._$AR(n&&n._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Di(e).nextSibling;Di(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},pt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,o,i){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._Line truncated
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt: Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p Line truncated {url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p Line truncated
@@ -3370,10 +3370,17 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
white-space: nowrap; white-space: nowrap;
} }
.nf-mark { .nf-mark {
flex: none;
width: 26px; width: 26px;
height: 28px; height: 28px;
color: var(--nf-accent); color: var(--nf-accent);
} }
.nf-view-title {
min-width: 0;
max-width: min(340px, 45vw);
overflow: hidden;
text-overflow: ellipsis;
}
.nf-notices { .nf-notices {
display: grid; display: grid;
gap: 6px; gap: 6px;
@@ -3858,15 +3865,15 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
<button aria-pressed=${e.readable} title=${this.t("readable_hint")} @click=${()=>this.setPref("readable",!e.readable)}>Aa ${this.t("readable")}</button> <button aria-pressed=${e.readable} title=${this.t("readable_hint")} @click=${()=>this.setPref("readable",!e.readable)}>Aa ${this.t("readable")}</button>
<button aria-pressed=${e.stats} title=${this.t("fps_title")} @click=${()=>this.setPref("stats",!e.stats)}>${this.t("fps")}</button> <button aria-pressed=${e.stats} title=${this.t("fps_title")} @click=${()=>this.setPref("stats",!e.stats)}>${this.t("fps")}</button>
</div> </div>
</div>`}async reloadVariables(){if(!(this._variablesLoading||!this.hass.symconRefresh)){this._variablesLoading=!0,this._variablesNotice="",this._variablesError=!1;try{await this.hass.symconRefresh(),this._variablesNotice=this.t("symcon_variables_loaded")}catch(e){this._variablesError=!0,this._variablesNotice=this.t("symcon_variables_error",{error:e instanceof Error?e.message:String(e)})}finally{this._variablesLoading=!1}}}renderHeader(e){let t=this.data.saveState,n=(i,s,a="")=>p`<button role="tab" class=${a} aria-pressed=${this._mode===i} @click=${()=>this.setMode(i)}>${s}</button>`,o=t==="saving"?"saving":t==="saved"?"saved":"save_error";return p`<header class="nf-header"> </div>`}async reloadVariables(){if(!(this._variablesLoading||!this.hass.symconRefresh)){this._variablesLoading=!0,this._variablesNotice="",this._variablesError=!1;try{await this.hass.symconRefresh(),this._variablesNotice=this.t("symcon_variables_loaded")}catch(e){this._variablesError=!0,this._variablesNotice=this.t("symcon_variables_error",{error:e instanceof Error?e.message:String(e)})}finally{this._variablesLoading=!1}}}renderHeader(e){let t=this.hass?.symconTitle?.trim()||"NextFloor",n=this.data.saveState,o=(s,a,l="")=>p`<button role="tab" class=${l} aria-pressed=${this._mode===s} @click=${()=>this.setMode(s)}>${a}</button>`,i=n==="saving"?"saving":n==="saved"?"saved":"save_error";return p`<header class="nf-header">
<ha-menu-button .hass=${this.hass} .narrow=${this.narrow}></ha-menu-button> <ha-menu-button .hass=${this.hass} .narrow=${this.narrow}></ha-menu-button>
<h1>${Qc}NextFloor</h1> <h1 title=${t}>${Qc}<span class="nf-view-title">${t}</span></h1>
${this.isAdmin?p`<div class="nf-seg" role="tablist">${n("view",this.t("view"))}${n("editor",this.t("editor"))}${n("extensions",`\u2726 ${this.t("ext_tab")}`,"nf-tab-ext")}</div>`:f} ${this.isAdmin?p`<div class="nf-seg" role="tablist">${o("view",this.t("view"))}${o("editor",this.t("editor"))}${o("extensions",`\u2726 ${this.t("ext_tab")}`,"nf-tab-ext")}</div>`:f}
<span class="nf-grow"></span> <span class="nf-grow"></span>
${this._mode==="view"&&e?.floors.some(i=>i.rooms.length)?p`<button class="nf-chip nf-room-names-toggle" aria-pressed=${this._prefs.roomNames} title=${this.t("room_names_toggle_hint")} @click=${()=>this.setPref("roomNames",!this._prefs.roomNames)}>${this.t("room_names_short")}</button>`:f} ${this._mode==="view"&&e?.floors.some(s=>s.rooms.length)?p`<button class="nf-chip nf-room-names-toggle" aria-pressed=${this._prefs.roomNames} title=${this.t("room_names_toggle_hint")} @click=${()=>this.setPref("roomNames",!this._prefs.roomNames)}>${this.t("room_names_short")}</button>`:f}
${this.isAdmin&&this.hass.symconRefresh?p`<button class="nf-btn nf-reload-variables" ?disabled=${this._variablesLoading} aria-busy=${this._variablesLoading} @click=${()=>{this.reloadVariables()}}>↻ ${this.t(this._variablesLoading?"symcon_variables_loading":"symcon_variables_reload")}</button>`:f} ${this.isAdmin&&this.hass.symconRefresh?p`<button class="nf-btn nf-reload-variables" ?disabled=${this._variablesLoading} aria-busy=${this._variablesLoading} @click=${()=>{this.reloadVariables()}}>↻ ${this.t(this._variablesLoading?"symcon_variables_loading":"symcon_variables_reload")}</button>`:f}
${this._mode==="view"&&e?.floors.some(i=>i.rooms.length)?this.renderViewOptions():f} ${this._mode==="view"&&e?.floors.some(s=>s.rooms.length)?this.renderViewOptions():f}
${this._mode==="editor"&&t!=="idle"?p`<span class="nf-save nf-save-${t}">${this.t(o)}</span>`:f} ${this._mode==="editor"&&n!=="idle"?p`<span class="nf-save nf-save-${n}">${this.t(i)}</span>`:f}
<span class="nf-version" title=${this.t("version_hint",{backend:this.data.backendVersion??"?"})}>v${this.data.frontendVersion}</span> <span class="nf-version" title=${this.t("version_hint",{backend:this.data.backendVersion??"?"})}>v${this.data.frontendVersion}</span>
</header>`}renderNotices(){let e=this.data,t=[];if(this._variablesNotice&&t.push(p`<div class="nf-notice ${this._variablesError?"nf-notice-error":""}" role=${this._variablesError?"alert":"status"}>${this._variablesNotice}</div>`),e.needsRestart&&t.push(e.versionGap==="frontend"?p`<div class="nf-notice nf-notice-warn"> </header>`}renderNotices(){let e=this.data,t=[];if(this._variablesNotice&&t.push(p`<div class="nf-notice ${this._variablesError?"nf-notice-error":""}" role=${this._variablesError?"alert":"status"}>${this._variablesNotice}</div>`),e.needsRestart&&t.push(e.versionGap==="frontend"?p`<div class="nf-notice nf-notice-warn">
${this.t("needs_reload",{frontend:e.frontendVersion,backend:e.backendVersion??"?"})} ${this.t("needs_reload",{frontend:e.frontendVersion,backend:e.backendVersion??"?"})}
@@ -4220,7 +4227,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
${n.showBar&&e?this.renderBar(n):f} ${n.showBar&&e?this.renderBar(n):f}
${this.renderCorners()} ${this.renderCorners()}
</div> </div>
</ha-card>`}static styles=[$e,Ue,su,_r]};if(!customElements.get("nextfloor-card")){customElements.define("nextfloor-card",Si);let r=window;r.customCards=r.customCards??[],r.customCards.push({type:"nextfloor-card",name:M(void 0,"card_name"),description:M(void 0,"card_description"),preview:!1})}io();var Lp="nextfloor-chunks-v1";async function $i(r,e,t){let n=await fetch(`${r.endpoint}/api?token=${encodeURIComponent(r.token)}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"same-origin",body:JSON.stringify({...t,action:e,transport:Lp})}),o=await n.text(),i;try{i=JSON.parse(o)}catch{throw/Output-Buffer exceeds Limit/i.test(o)?new Error("Symcon hat die Antwort wegen seiner Ausgabebegrenzung abgebrochen. Bitte das NextFloor-Modul aktualisieren und den Designer neu laden."):new Error(`Symcon liefert ${o.trim()?"kein g\xFCltiges JSON":"eine leere Antwort"} f\xFCr \u201E${e}\u201C (HTTP ${n.status}).`)}if(!n.ok||!i||typeof i!="object"||"error"in i){let s=i&&typeof i=="object"&&"error"in i?i.error:`HTTP ${n.status}`;throw new Error(String(s))}return i}async function Nt(r,e,t={}){let n=await $i(r,e,t);if(!("_nextfloor_transfer"in n))return n;let o=n._nextfloor_transfer;if(!o||!/^[a-f0-9]{32}$/.test(o.id)||!Number.isSafeInteger(o.bytes)||o.bytes<=0||o.bytes>67108864||!Number.isSafeInteger(o.chunk_bytes)||o.chunk_bytes<=0||o.chunk_bytes>128*1024||o.chunks!==Math.ceil(o.bytes/o.chunk_bytes)||o.chunks>512)throw new Error("Symcon hat eine ung\xFCltige Daten\xFCbertragung angek\xFCndigt.");try{let i=new TextDecoder("utf-8",{fatal:!0}),s=[];for(let a=0;a<o.chunks;a++){let l=await $i(r,"transport/read",{transfer_id:o.id,index:a});if(l.index!==a||typeof l.data!="string")throw new Error("Ein Symcon-Datenpaket fehlt oder ist ung\xFCltig.");let c=Uint8Array.from(atob(l.data),u=>u.charCodeAt(0));if(c.length!==Math.min(o.chunk_bytes,o.bytes-a*o.chunk_bytes))throw new Error("Ein Symcon-Datenpaket wurde unvollst\xE4ndig \xFCbertragen.");s.push(i.decode(c,{stream:!0}))}return s.push(i.decode()),JSON.parse(s.join(""))}finally{await $i(r,"transport/release",{transfer_id:o.id}).catch(()=>{})}}function Bp(){let r=window.__NEXTFLOOR_SYMCON__;if(!r?.endpoint||!r.token)throw new Error("NextFloor Symcon host configuration is missing");return r}var Wr=class{settings=Bp();changeListeners=new Set;buildingListeners=new Set;timer;stateRevision=-1;buildingRevision=-1;objectsSignature="";refreshTask;states={};entities={};areas={};facade={language:this.settings.language||navigator.language||"de",user:{is_admin:!0,name:this.settings.title||"IP-Symcon"},states:this.states,entities:this.entities,areas:this.areas,symconObjects:[],symconRefresh:()=>this.refresh(!0),config:{unit_system:{temperature:"\xB0C"}},themes:{darkMode:window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0},services:{},connection:{subscribeMessage:async(e,t)=>{if(t.type==="nextfloor/building/subscribe"){let n=o=>e({revision:o});return this.buildingListeners.add(n),async()=>{this.buildingListeners.delete(n)}}return async()=>{}}},callWS:e=>this.callWS(e),callService:(e,t,n)=>this.callService(e,t,n),fetchWithAuth:(e,t)=>this.fetchWithToken(e,t),hassUrl:(e="")=>new URL(e,window.location.origin).href};async start(){let e=await Nt(this.settings,"bootstrap");return this.apply(e),this.stateRevision=e.state_revision,this.buildingRevision=e.building_revision,this.timer=setInterval(()=>{this.refresh().catch(()=>{})},800),this.snapshot()}stop(){this.timer&&clearInterval(this.timer),this.timer=void 0}onChange(e){return this.changeListeners.add(e),()=>this.changeListeners.delete(e)}snapshot(){return{...this.facade,states:{...this.states},entities:{...this.entities},areas:{...this.areas}}}refresh(e=!1){if(this.refreshTask)return e?this.refreshTask.catch(()=>{}).then(()=>this.refresh(!0)):this.refreshTask;let t=this.loadSnapshot(e).finally(()=>{this.refreshTask===t&&(this.refreshTask=void 0)});return this.refreshTask=t,t}async loadSnapshot(e){let t=e?await Nt(this.settings,"bootstrap"):await Nt(this.settings,"variables/snapshot",{revision:this.stateRevision});if((e||t.state_revision!==this.stateRevision)&&t.variables){this.stateRevision=t.state_revision,this.apply({variables:t.variables,areas:t.areas,objects:t.objects});for(let n of this.changeListeners)n()}if(t.building_revision!==this.buildingRevision){this.buildingRevision=t.building_revision;for(let n of this.buildingListeners)n(t.building_revision)}}apply(e){this.states=Object.fromEntries(e.variables.map(t=>[t.entity_id,{entity_id:t.entity_id,state:t.state,attributes:{...t.attributes,friendly_name:t.name,symcon_path:t.path}}])),this.entities=Object.fromEntries(e.variables.map(t=>[t.entity_id,{entity_id:t.entity_id,name:t.name,area_id:t.area_id??null,device_id:t.device_id??null}]));for(let t of Object.values(this.states))for(let n of["light","cover"]){let o=Fs(t,n);!o||o.entity_id===t.entity_id||this.states[o.entity_id]||(this.states[o.entity_id]=o,this.entities[o.entity_id]={...thiLine truncated </ha-card>`}static styles=[$e,Ue,su,_r]};if(!customElements.get("nextfloor-card")){customElements.define("nextfloor-card",Si);let r=window;r.customCards=r.customCards??[],r.customCards.push({type:"nextfloor-card",name:M(void 0,"card_name"),description:M(void 0,"card_description"),preview:!1})}io();var Lp="nextfloor-chunks-v1";async function $i(r,e,t){let n=await fetch(`${r.endpoint}/api?token=${encodeURIComponent(r.token)}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"same-origin",body:JSON.stringify({...t,action:e,transport:Lp})}),o=await n.text(),i;try{i=JSON.parse(o)}catch{throw/Output-Buffer exceeds Limit/i.test(o)?new Error("Symcon hat die Antwort wegen seiner Ausgabebegrenzung abgebrochen. Bitte das NextFloor-Modul aktualisieren und den Designer neu laden."):new Error(`Symcon liefert ${o.trim()?"kein g\xFCltiges JSON":"eine leere Antwort"} f\xFCr \u201E${e}\u201C (HTTP ${n.status}).`)}if(!n.ok||!i||typeof i!="object"||"error"in i){let s=i&&typeof i=="object"&&"error"in i?i.error:`HTTP ${n.status}`;throw new Error(String(s))}return i}async function Nt(r,e,t={}){let n=await $i(r,e,t);if(!("_nextfloor_transfer"in n))return n;let o=n._nextfloor_transfer;if(!o||!/^[a-f0-9]{32}$/.test(o.id)||!Number.isSafeInteger(o.bytes)||o.bytes<=0||o.bytes>67108864||!Number.isSafeInteger(o.chunk_bytes)||o.chunk_bytes<=0||o.chunk_bytes>128*1024||o.chunks!==Math.ceil(o.bytes/o.chunk_bytes)||o.chunks>512)throw new Error("Symcon hat eine ung\xFCltige Daten\xFCbertragung angek\xFCndigt.");try{let i=new TextDecoder("utf-8",{fatal:!0}),s=[];for(let a=0;a<o.chunks;a++){let l=await $i(r,"transport/read",{transfer_id:o.id,index:a});if(l.index!==a||typeof l.data!="string")throw new Error("Ein Symcon-Datenpaket fehlt oder ist ung\xFCltig.");let c=Uint8Array.from(atob(l.data),u=>u.charCodeAt(0));if(c.length!==Math.min(o.chunk_bytes,o.bytes-a*o.chunk_bytes))throw new Error("Ein Symcon-Datenpaket wurde unvollst\xE4ndig \xFCbertragen.");s.push(i.decode(c,{stream:!0}))}return s.push(i.decode()),JSON.parse(s.join(""))}finally{await $i(r,"transport/release",{transfer_id:o.id}).catch(()=>{})}}function Bp(){let r=window.__NEXTFLOOR_SYMCON__;if(!r?.endpoint||!r.token)throw new Error("NextFloor Symcon host configuration is missing");return r}var Wr=class{settings=Bp();changeListeners=new Set;buildingListeners=new Set;timer;stateRevision=-1;buildingRevision=-1;objectsSignature="";refreshTask;states={};entities={};areas={};facade={language:this.settings.language||navigator.language||"de",user:{is_admin:!0,name:this.settings.title||"IP-Symcon"},states:this.states,entities:this.entities,areas:this.areas,symconObjects:[],symconTitle:this.settings.title?.trim()||"NextFloor",symconRefresh:()=>this.refresh(!0),config:{unit_system:{temperature:"\xB0C"}},themes:{darkMode:window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0},services:{},connection:{subscribeMessage:async(e,t)=>{if(t.type==="nextfloor/building/subscribe"){let n=o=>e({revision:o});return this.buildingListeners.add(n),async()=>{this.buildingListeners.delete(n)}}return async()=>{}}},callWS:e=>this.callWS(e),callService:(e,t,n)=>this.callService(e,t,n),fetchWithAuth:(e,t)=>this.fetchWithToken(e,t),hassUrl:(e="")=>new URL(e,window.location.origin).href};async start(){let e=await Nt(this.settings,"bootstrap");return this.apply(e),this.stateRevision=e.state_revision,this.buildingRevision=e.building_revision,this.timer=setInterval(()=>{this.refresh().catch(()=>{})},800),this.snapshot()}stop(){this.timer&&clearInterval(this.timer),this.timer=void 0}onChange(e){return this.changeListeners.add(e),()=>this.changeListeners.delete(e)}snapshot(){return{...this.facade,states:{...this.states},entities:{...this.entities},areas:{...this.areas}}}refresh(e=!1){if(this.refreshTask)return e?this.refreshTask.catch(()=>{}).then(()=>this.refresh(!0)):this.refreshTask;let t=this.loadSnapshot(e).finally(()=>{this.refreshTask===t&&(this.refreshTask=void 0)});return this.refreshTask=t,t}async loadSnapshot(e){let t=e?await Nt(this.settings,"bootstrap"):await Nt(this.settings,"variables/snapshot",{revision:this.stateRevision});if((e||t.state_revision!==this.stateRevision)&&t.variables){this.stateRevision=t.state_revision,this.apply({variables:t.variables,areas:t.areas,objects:t.objects});for(let n of this.changeListeners)n()}if(t.building_revision!==this.buildingRevision){this.buildingRevision=t.building_revision;for(let n of this.buildingListeners)n(t.building_revision)}}apply(e){this.states=Object.fromEntries(e.variables.map(t=>[t.entity_id,{entity_id:t.entity_id,state:t.state,attributes:{...t.attributes,friendly_name:t.name,symcon_path:t.path}}])),this.entities=Object.fromEntries(e.variables.map(t=>[t.entity_id,{entity_id:t.entity_id,name:t.name,area_id:t.area_id??null,device_id:t.device_id??null}]));for(let t of Object.values(this.states))for(let n of["light","cover"]){let o=Fs(t,n);!o||o.entity_id===t.entity_id||this.states[o.entity_id]||(this.staLine truncated
/*! Bundled license information: /*! Bundled license information:
@lit/reactive-element/css-tag.js: @lit/reactive-element/css-tag.js:
-4
View File
@@ -5,10 +5,6 @@
"type": "ValidationTextBox", "type": "ValidationTextBox",
"name": "Title", "name": "Title",
"caption": "Name der Visualisierung" "caption": "Name der Visualisierung"
},
{
"type": "Label",
"label": "Der Designer wird als eigener Tab in der IP-Symcon-Konsole geöffnet. Variablen werden dort ausschließlich über den Objektbaum ausgewählt; Objekt-IDs müssen nicht eingegeben werden."
} }
], ],
"actions": [ "actions": [
+35 -13
View File
@@ -18,6 +18,8 @@ class NextFloor extends IPSModuleStrict
private const TRANSFER_CHUNK_BYTES = 128 * 1024; private const TRANSFER_CHUNK_BYTES = 128 * 1024;
private const MAX_TRANSFER_BYTES = 64 * 1024 * 1024; private const MAX_TRANSFER_BYTES = 64 * 1024 * 1024;
private const TRANSFER_TTL = 120; private const TRANSFER_TTL = 120;
private const HOOK_RETRY_MS = 5000;
private const HOOK_MAINTENANCE_MS = 30000;
public function Create(): void public function Create(): void
{ {
@@ -34,16 +36,19 @@ class NextFloor extends IPSModuleStrict
$this->RegisterAttributeInteger('BuildingRevision', 0); $this->RegisterAttributeInteger('BuildingRevision', 0);
$this->RegisterAttributeInteger('StateRevision', 0); $this->RegisterAttributeInteger('StateRevision', 0);
$this->RegisterMessage(0, IPS_KERNELSTARTED); $this->RegisterMessage(0, IPS_KERNELSTARTED);
$this->RegisterMessage(0, KR_READY);
$this->RegisterTimer('WebHookRetry', 0, 'NFSC_RetryWebHook($_IPS[\'TARGET\']);'); $this->RegisterTimer('WebHookRetry', 0, 'NFSC_RetryWebHook($_IPS[\'TARGET\']);');
$this->ensureAccessToken(); $this->ensureAccessToken();
$this->SetVisualizationType(1); $this->SetVisualizationType(1);
$this->ensureWebHook(); $this->ensureWebHook(true);
} }
public function ApplyChanges(): void public function ApplyChanges(): void
{ {
parent::ApplyChanges(); parent::ApplyChanges();
$this->RegisterMessage(0, IPS_KERNELSTARTED);
$this->RegisterMessage(0, KR_READY);
$this->SetVisualizationType(1); $this->SetVisualizationType(1);
$this->ensureWebHook(); $this->ensureWebHook();
} }
@@ -51,12 +56,12 @@ class NextFloor extends IPSModuleStrict
public function MessageSink(int $TimeStamp, int $SenderID, int $Message, array $Data): void public function MessageSink(int $TimeStamp, int $SenderID, int $Message, array $Data): void
{ {
parent::MessageSink($TimeStamp, $SenderID, $Message, $Data); parent::MessageSink($TimeStamp, $SenderID, $Message, $Data);
if ($SenderID === 0 && $Message === IPS_KERNELSTARTED) { if ($SenderID === 0 && ($Message === KR_READY || $Message === IPS_KERNELSTARTED)) {
$this->ensureWebHook(); $this->ensureWebHook();
} }
} }
/** Timer callback; stops itself as soon as the volatile hook has been restored. */ /** Keep the volatile route registered, including resets after successful startup or module reload. */
public function RetryWebHook(): void public function RetryWebHook(): void
{ {
$this->ensureWebHook(); $this->ensureWebHook();
@@ -95,8 +100,9 @@ class NextFloor extends IPSModuleStrict
. htmlspecialchars($this->hookErrorMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</div>'; . htmlspecialchars($this->hookErrorMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</div>';
} }
$src = htmlspecialchars($this->designerUrl('tile'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); $src = htmlspecialchars($this->designerUrl('tile'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
$title = htmlspecialchars($this->viewTitle(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
return '<style>html,body{margin:0;width:100%;height:100%;overflow:hidden}iframe{display:block;width:100%;height:100%;min-height:260px;border:0;background:#111}</style>' return '<style>html,body{margin:0;width:100%;height:100%;overflow:hidden}iframe{display:block;width:100%;height:100%;min-height:260px;border:0;background:#111}</style>'
. '<iframe title="NextFloor" src="' . $src . '" loading="eager" allow="fullscreen"></iframe>'; . '<iframe title="' . $title . '" src="' . $src . '" loading="eager" allow="fullscreen"></iframe>';
} }
/** IP-Symcon calls this for /hook/nextfloor/<instance id>/... */ /** IP-Symcon calls this for /hook/nextfloor/<instance id>/... */
@@ -140,13 +146,14 @@ class NextFloor extends IPSModuleStrict
// --------------------------------------------------------------------- WebHook pages // --------------------------------------------------------------------- WebHook pages
private function ensureWebHook(): bool private function ensureWebHook(bool $duringCreate = false): bool
{ {
// Native hooks are volatile. Create/ApplyChanges can run before WebHook Control is ready; // Register in Create as documented, even while Symcon initializes. Re-register after
// register again after the kernel has started and whenever a designer/tile link is requested. // startup/update and keep maintaining the route: WebHook Control can reset later too.
if (IPS_GetKernelRunlevel() !== KR_READY) { $ready = IPS_GetKernelRunlevel() === KR_READY;
if (!$ready && !$duringCreate) {
$this->SetStatus(104); $this->SetStatus(104);
$this->SetTimerInterval('WebHookRetry', 5000); $this->SetTimerInterval('WebHookRetry', self::HOOK_RETRY_MS);
return false; return false;
} }
try { try {
@@ -156,17 +163,27 @@ class NextFloor extends IPSModuleStrict
throw new RuntimeException('Symcon hat die Registrierung von /hook/' . $this->hookPath() . ' abgelehnt.'); throw new RuntimeException('Symcon hat die Registrierung von /hook/' . $this->hookPath() . ' abgelehnt.');
} }
} catch (Throwable $error) { } catch (Throwable $error) {
if (!$ready) {
$this->SetStatus(104);
$this->SetTimerInterval('WebHookRetry', self::HOOK_RETRY_MS);
return false;
}
$message = $error->getMessage(); $message = $error->getMessage();
if ($message !== $this->ReadAttributeString('HookError')) { if ($message !== $this->ReadAttributeString('HookError')) {
$this->LogMessage('WebHook-Registrierung fehlgeschlagen: ' . $message, KL_ERROR); $this->LogMessage('WebHook-Registrierung fehlgeschlagen: ' . $message, KL_ERROR);
} }
$this->WriteAttributeString('HookError', $message); $this->WriteAttributeString('HookError', $message);
$this->SetStatus(200); $this->SetStatus(200);
$this->SetTimerInterval('WebHookRetry', 5000); $this->SetTimerInterval('WebHookRetry', self::HOOK_RETRY_MS);
return false;
}
if (!$ready) {
$this->SetStatus(104);
$this->SetTimerInterval('WebHookRetry', self::HOOK_RETRY_MS);
return false; return false;
} }
$this->WriteAttributeString('HookError', ''); $this->WriteAttributeString('HookError', '');
$this->SetTimerInterval('WebHookRetry', 0); $this->SetTimerInterval('WebHookRetry', self::HOOK_MAINTENANCE_MS);
$this->SetStatus(102); $this->SetStatus(102);
return true; return true;
} }
@@ -192,6 +209,11 @@ class NextFloor extends IPSModuleStrict
return 'nextfloor/' . $this->InstanceID; return 'nextfloor/' . $this->InstanceID;
} }
private function viewTitle(): string
{
return trim($this->ReadPropertyString('Title')) ?: 'NextFloor';
}
private function designerUrl(string $mode): string private function designerUrl(string $mode): string
{ {
return '/hook/' . $this->hookPath() . '/designer?mode=' . rawurlencode($mode) . '&token=' . rawurlencode($this->ensureAccessToken()); return '/hook/' . $this->hookPath() . '/designer?mode=' . rawurlencode($mode) . '&token=' . rawurlencode($this->ensureAccessToken());
@@ -243,7 +265,7 @@ class NextFloor extends IPSModuleStrict
'endpoint' => '/hook/' . $this->hookPath(), 'endpoint' => '/hook/' . $this->hookPath(),
'token' => $this->ensureAccessToken(), 'token' => $this->ensureAccessToken(),
'language' => 'de', 'language' => 'de',
'title' => $this->ReadPropertyString('Title') ?: 'NextFloor' 'title' => $this->viewTitle()
]; ];
$asset = '/hook/' . $this->hookPath() . '/assets/nextfloor-designer.js?v=' . rawurlencode($this->moduleVersion()) $asset = '/hook/' . $this->hookPath() . '/assets/nextfloor-designer.js?v=' . rawurlencode($this->moduleVersion())
. '&token=' . rawurlencode($this->ensureAccessToken()); . '&token=' . rawurlencode($this->ensureAccessToken());
@@ -253,7 +275,7 @@ class NextFloor extends IPSModuleStrict
. '<title>' . htmlspecialchars($config['title'], ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</title>' . '<title>' . htmlspecialchars($config['title'], ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</title>'
. '<style>html,body{width:100%;height:100%;margin:0;background:#111;color:#e1e1e1}body>nextfloor-panel,body>nextfloor-card{display:block;width:100%;height:100%}</style>' . '<style>html,body{width:100%;height:100%;margin:0;background:#111;color:#e1e1e1}body>nextfloor-panel,body>nextfloor-card{display:block;width:100%;height:100%}</style>'
. '</head><body><p style="padding:1rem;font-family:system-ui">NextFloor wird geladen …</p>' . '</head><body><p style="padding:1rem;font-family:system-ui">NextFloor wird geladen …</p>'
. '<script>window.__NEXTFLOOR_SYMCON__=' . json_encode($config, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ';</script>' . '<script>window.__NEXTFLOOR_SYMCON__=' . json_encode($config, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) . ';</script>'
. '<script type="module" src="' . htmlspecialchars($asset, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '"></script></body></html>'; . '<script type="module" src="' . htmlspecialchars($asset, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '"></script></body></html>';
} }
+11 -1
View File
@@ -16,7 +16,7 @@ In **Kerninstanzen → Modules** wird dieses Repository verwendet:
Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen. Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen.
`main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek. `main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek.
Nach der Aktualisierung auf **0.2.11 / Build 14** die Konsole neu laden. Unter Nach der Aktualisierung auf **0.2.12 / Build 15** die Konsole neu laden. Unter
**Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**. **Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**.
### Für die Entwicklung ### Für die Entwicklung
@@ -46,6 +46,16 @@ Die Dateien unter `NextFloor/assets/` und `NextFloor/packs/` werden durch
Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur. Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur.
Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen. Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen.
## Änderungen in 0.2.12
- Der konfigurierte **Name der Visualisierung** erscheint oben links statt „NextFloor“,
außerdem im Browser-Titel und als Titel des Kachel-Iframes.
- Der WebHook wird bereits in `Create`, bei `KR_READY`, nach dem Kernelstart und bei
Modulaktualisierungen registriert. Eine laufende Nachregistrierung alle 30 Sekunden
stellt ihn auch nach einem späteren Zurücksetzen wieder her; bei Fehlern wird alle
5 Sekunden erneut versucht. URL, Zugangs-Token und Projektdaten bleiben erhalten.
- Der erklärende Text im Symcon-Konfigurationsformular wurde entfernt.
## Änderungen in 0.2.11 ## Änderungen in 0.2.11
- Die schwebenden Raumklimakarten werden in **Alle Etagen** ausgeblendet. Beim Öffnen - Die schwebenden Raumklimakarten werden in **Alle Etagen** ausgeblendet. Beim Öffnen
+2 -2
View File
@@ -6,7 +6,7 @@
"compatibility": { "compatibility": {
"version": "9.0" "version": "9.0"
}, },
"version": "0.2.11", "version": "0.2.12",
"build": 14, "build": 15,
"date": 1794297600 "date": 1794297600
} }
+40 -5
View File
@@ -25,6 +25,7 @@ class IPSModuleStrict
public int $status = 101; public int $status = 101;
public ?bool $registrationResult = true; public ?bool $registrationResult = true;
public bool $registrationThrows = false; public bool $registrationThrows = false;
public array $registrationRunlevels = [];
public function __construct(int $id) { $this->InstanceID = $id; } public function __construct(int $id) { $this->InstanceID = $id; }
public function Create(): void {} public function Create(): void {}
@@ -53,7 +54,7 @@ class IPSModuleStrict
protected function RegisterHook(string $path): ?bool protected function RegisterHook(string $path): ?bool
{ {
global $nativeHooks; global $nativeHooks;
check(IPS_GetKernelRunlevel() === KR_READY, 'Do not depend on WebHook Control before the kernel is ready'); $this->registrationRunlevels[] = IPS_GetKernelRunlevel();
if ($this->registrationThrows) throw new RuntimeException('WebHook Control unavailable'); if ($this->registrationThrows) throw new RuntimeException('WebHook Control unavailable');
if ($this->registrationResult !== false) $nativeHooks['/hook/' . $path] = $this->InstanceID; if ($this->registrationResult !== false) $nativeHooks['/hook/' . $path] = $this->InstanceID;
return $this->registrationResult; return $this->registrationResult;
@@ -62,26 +63,48 @@ class IPSModuleStrict
require __DIR__ . '/../NextFloor/module.php'; require __DIR__ . '/../NextFloor/module.php';
$module = new NextFloor(12345); $module = new NextFloor(12345);
$hook = '/hook/nextfloor/12345';
$module->Create(); $module->Create();
check($nativeHooks === [] && $module->status === 104, 'Startup must wait instead of reporting a nonexistent hook as ready'); check(($nativeHooks[$hook] ?? null) === 12345 && $module->status === 104, 'Create registers the native hook early without reporting the initializing kernel as ready');
check($module->registrationRunlevels === [KR_INIT], 'Create must register hooks during initialization, as required by the native lifecycle');
check(in_array([0, IPS_KERNELSTARTED], $module->messages, true), 'Module must listen for the completed kernel startup'); check(in_array([0, IPS_KERNELSTARTED], $module->messages, true), 'Module must listen for the completed kernel startup');
check(in_array([0, KR_READY], $module->messages, true), 'Module also restores its route as soon as the kernel becomes ready');
check($module->timers['WebHookRetry']['interval'] === 5000, 'Startup recovery must be scheduled'); check($module->timers['WebHookRetry']['interval'] === 5000, 'Startup recovery must be scheduled');
$kernelRunlevel = KR_READY; $kernelRunlevel = KR_READY;
$nativeHooks = [];
$module->MessageSink(1, 0, KR_READY, []);
check(isset($nativeHooks[$hook]), 'KR_READY restores routes cleared after Create');
$nativeHooks = [];
$module->MessageSink(1, 0, IPS_KERNELSTARTED, []); $module->MessageSink(1, 0, IPS_KERNELSTARTED, []);
$hook = '/hook/nextfloor/12345';
check(($nativeHooks[$hook] ?? null) === 12345 && $module->status === 102, 'Kernel startup must restore the instance hook'); check(($nativeHooks[$hook] ?? null) === 12345 && $module->status === 102, 'Kernel startup must restore the instance hook');
check($module->timers['WebHookRetry']['interval'] === 0, 'Successful registration stops the retry timer'); check($module->timers['WebHookRetry']['interval'] === 30000, 'Successful registration keeps maintenance active for delayed resets');
$token = $module->attributes['AccessToken']; $token = $module->attributes['AccessToken'];
$module->attributes['Building'] = '{"preserved_project":true}'; $module->attributes['Building'] = '{"preserved_project":true}';
$module->properties['Title'] = ' Haus & Büro <West> ';
$nativeHooks = []; $nativeHooks = [];
$link = $module->OpenDesigner(); $link = $module->OpenDesigner();
check(isset($nativeHooks[$hook]) && str_starts_with($link, 'link:' . $hook . '/designer?'), 'Opening the designer repairs a lost route before returning its URL'); check(isset($nativeHooks[$hook]) && str_starts_with($link, 'link:' . $hook . '/designer?'), 'Opening the designer repairs a lost route before returning its URL');
$nativeHooks = []; $nativeHooks = [];
check(str_contains($module->GetVisualizationTile(), '<iframe') && isset($nativeHooks[$hook]), 'Opening a tile also repairs its route'); check(str_contains($module->GetVisualizationTile(), '<iframe') && isset($nativeHooks[$hook]), 'Opening a tile also repairs its route');
check(str_contains($module->GetVisualizationTile(), 'title="Haus &amp; Büro &lt;West&gt;"'), 'Tile iframe uses the escaped configured view name');
$module->ApplyChanges(); $module->ApplyChanges();
check(isset($nativeHooks[$hook]), 'ApplyChanges restores hooks after module reload'); check(isset($nativeHooks[$hook]), 'ApplyChanges restores hooks after module reload');
for ($reload = 0; $reload < 3; $reload++) {
unset($nativeHooks[$hook]); // WebHook Control resets after our successful ApplyChanges.
$module->RetryWebHook();
check(isset($nativeHooks[$hook]) && $module->status === 102, 'Maintenance restores delayed hook loss without opening a designer or tile');
check($module->timers['WebHookRetry']['interval'] === 30000, 'Maintenance must survive every successful recovery');
}
$kernelRunlevel = KR_INIT;
$nativeHooks = [];
$module->Create();
$module->ApplyChanges();
check($module->status === 104, 'Restart initialization must not report ready');
$kernelRunlevel = KR_READY;
$module->MessageSink(2, 0, IPS_KERNELSTARTED, []);
check(isset($nativeHooks[$hook]) && $module->attributes['AccessToken'] === $token, 'A full restart restores the same route and retains the original access token');
$module->registrationResult = false; $module->registrationResult = false;
$module->ApplyChanges(); $module->ApplyChanges();
@@ -110,6 +133,15 @@ check($module->attributes['AccessToken'] === $token && $module->attributes['Buil
$other = new NextFloor(54321); $other = new NextFloor(54321);
$other->Create(); $other->Create();
check(isset($nativeHooks[$hook]) && isset($nativeHooks['/hook/nextfloor/54321']), 'Instances must keep independent routes'); check(isset($nativeHooks[$hook]) && isset($nativeHooks['/hook/nextfloor/54321']), 'Instances must keep independent routes');
$kernelRunlevel = KR_INIT;
$earlyFailure = new NextFloor(34567);
$earlyFailure->registrationThrows = true;
$earlyFailure->Create();
check($earlyFailure->status === 104 && $earlyFailure->timers['WebHookRetry']['interval'] === 5000 && $earlyFailure->logs === [], 'An early startup registration failure waits and retries without an error log');
$kernelRunlevel = KR_READY;
$earlyFailure->registrationThrows = false;
$earlyFailure->RetryWebHook();
check(isset($nativeHooks['/hook/nextfloor/34567']) && $earlyFailure->status === 102, 'Unavailable early WebHook Control must recover automatically');
// Verify that returned URLs reach the real dispatcher, including Symcon's SCRIPT_NAME fallback. // Verify that returned URLs reach the real dispatcher, including Symcon's SCRIPT_NAME fallback.
parse_str((string) parse_url(substr($link, 5), PHP_URL_QUERY), $_GET); parse_str((string) parse_url(substr($link, 5), PHP_URL_QUERY), $_GET);
@@ -119,6 +151,9 @@ ob_start();
$process->invoke($module); $process->invoke($module);
$html = ob_get_clean(); $html = ob_get_clean();
check(str_contains($html, 'window.__NEXTFLOOR_SYMCON__=') && str_contains($html, 'assets/nextfloor-designer.js'), 'Designer route must serve its host page'); check(str_contains($html, 'window.__NEXTFLOOR_SYMCON__=') && str_contains($html, 'assets/nextfloor-designer.js'), 'Designer route must serve its host page');
check(str_contains($html, '<title>Haus &amp; Büro &lt;West&gt;</title>'), 'Browser title uses the escaped configured view name');
preg_match('/window\.__NEXTFLOOR_SYMCON__=(.*?);<\/script>/s', $html, $hostConfig);
check(json_decode($hostConfig[1], true)['title'] === 'Haus & Büro <West>', 'Frontend receives the configured title as plain text');
$version = json_decode((string) file_get_contents(__DIR__ . '/../library.json'), true)['version']; $version = json_decode((string) file_get_contents(__DIR__ . '/../library.json'), true)['version'];
check(str_contains($html, 'nextfloor-designer.js?v=' . $version), 'A module update must invalidate the cached designer entry bundle'); check(str_contains($html, 'nextfloor-designer.js?v=' . $version), 'A module update must invalidate the cached designer entry bundle');
unset($_SERVER['REQUEST_URI']); unset($_SERVER['REQUEST_URI']);
@@ -133,4 +168,4 @@ $process->invoke($module);
$unauthorized = ob_get_clean(); $unauthorized = ob_get_clean();
check(http_response_code() === 403 && str_contains($unauthorized, 'forbidden'), 'Recovery must not bypass hook authentication'); check(http_response_code() === 403 && str_contains($unauthorized, 'forbidden'), 'Recovery must not bypass hook authentication');
echo "OK: kernel startup, reload, designer/tile recovery, failed registration, retry, repair, data preservation, routing and authentication\n"; echo "OK: early registration, startup/update and delayed reset recovery, ongoing maintenance, titles, data preservation, routing and authentication\n";