changed variable dialog

This commit is contained in:
jhartworks committed 2026-11-09 12:19:51 +01:00
1 parent 137014a0b8
commit 662763d5a4
6 files changed
+866 -693

No files matched your search

+3 -3
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 */
var S={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 yn=globalThis,xn=yn.ShadowRoot&&(yn.ShadyCSS===void 0||yn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hr=Symbol(),wi=new WeakMap,Pt=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Hr)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(xn&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=wi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&wi.set(t,e))}return e}toString(){return this.cssText}},vi=r=>new Pt(typeof r=="string"?r:r+"",void 0,Hr),te=(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 Pt(t,r,Hr)},yi=(r,e)=>{if(xn)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),o=yn.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}},Ir=xn?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return vi(t)})(r):r;var{is:Zc,defineProperty:Yc,getOwnPropertyDescriptor:Jc,getOwnPropertyNames:Qc,getOwnPropertySymbols:Xc,getPrototypeOf:eu}=Object,kn=globalThis,xi=kn.trustedTypes,tu=xi?xi.emptyScript:"",nu=kn.reactiveElementPolyfillSupport,Ht=(r,e)=>r,Cr={toAttribute(r,e){switch(e){case Boolean:r=r?tu: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}},Si=(r,e)=>!Zc(r,e),ki={attribute:!0,type:String,converter:Cr,reflect:!1,useDefault:!1,hasChanged:Si};Symbol.metadata??=Symbol("metadata"),kn.litPropertyMetadata??=new WeakMap;var $e=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=ki){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&&Yc(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){let{get:o,set:i}=Jc(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)??ki}static _$Ei(){if(this.hasOwnProperty(Ht("elementProperties")))return;let e=eu(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ht("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ht("properties"))){let t=this.properties,n=[...Qc(t),...Xc(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(Ir(o))}else e!==void 0&&t.push(Ir(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]`,It=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ai=/-->/g,Ei=/>/g,qe=RegExp(`>|${Nr}(?:([^\\s"'>=/]+)(${Nr}*=${Nr}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ri=/'/g,zi=/"/g,Pi=/^(?:script|style|textarea|title)$/i,Ur=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),m=Ur(1),J=Ur(2),Hm=Ur(3),Je=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ti=new WeakMap,Ze=Ye.createTreeWalker(Ye,129);function Hi(r,e){if(!Gr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return $i!==void 0?$i.createHTML(e):e}var iu=(r,e)=>{let t=r.length-1,n=[],o,i=e===2?"<svg>":e===3?"<math>":"",s=It;for(let a=0;a<t;a++){let l=r[a],c,u,d=-1,p=0;for(;p<l.length&&(s.lastIndex=p,u=s.exec(l),u!==null);)p=s.lastIndex,s===It?u[1]==="!--"?s=Ai:u[1]!==void 0?s=Ei:u[2]!==void 0?(Pi.test(u[2])&&(o=RegExp("</"+u[2],"g")),s=qe):u[3]!==void 0&&(s=qe):s===qe?u[0]===">"?(s=o??It,d=-1):u[1]===void 0?d=-2:(d=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?qe:u[3]==='"'?zi:Ri):s===zi||s===Ri?s=qe:s===Ai||s===Ei?s=It:(s=qe,o=void 0);let h=s===qe&&r[a+1].startsWith("/>")?" ":"";i+=s===It?l+ru:d>=0?(n.push(c),l.slice(0,d)+Fi+l.slice(d)+Oe+h):l+Oe+(d===-2?a:h)}return[Hi(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Ot=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]=iu(e,t);if(this.el=r.createElement(c,n),Ze.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=Ze.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let d of o.getAttributeNames())if(d.endsWith(Fi)){let p=u[s++],h=o.getAttribute(d).split(Oe),w=/([.?@])?(.*)/.exec(p);l.push({type:1,index:i,name:w[2],strings:h,ctor:w[1]==="."?Wr:w[1]==="?"?Lr:w[1]==="@"?Br:ut}),o.removeAttribute(d)}else d.startsWith(Oe)&&(l.push({type:6,index:i}),o.removeAttribute(d));if(Pi.test(o.tagName)){let d=o.textContent.split(Oe),p=d.length-1;if(p>0){o.textContent=Sn?Sn.emptyScript:"";for(let h=0;h<p;h++)o.append(d[h],Ct()),Ze.nextNode(),l.push({type:2,index:++i});o.append(d[p],Ct())}}}else if(o.nodeType===8)if(o.data===Di)l.push({type:2,index:i});else{let d=-1;for(;(d=o.data.indexOf(Oe,d+1))!==-1;)l.push({type:7,index:i}),d+=Oe.length-1}i++}}static createElement(e,t){let n=Ye.createElement("template");return n.innerHTML=e,n}};function ct(r,e,t=r,n){if(e===Je)return e;let o=n!==void 0?t._$Co?.[n]:t._$Cl,i=Nt(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=ct(r,o._$AS(r,e.values),o,n)),e}var Or=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??Ye).importNode(t,!0);Ze.currentNode=o;let i=Ze.nextNode(),s=0,a=0,l=n[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new Wt(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new Vr(i,this,e)),this._$AV.push(c),l=n[++a]}s!==l?.index&&(i=Ze.nextNode(),s++)}return Ze.currentNode=Ye,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++}},Wt=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=ct(this,e,t),Nt(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==Je&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ou(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&&Nt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ye.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=Ot.createElement(Hi(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new Or(o,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=Ti.get(e.strings);return t===void 0&&Ti.set(e.strings,t=new Ot(e)),t}k(e){Gr(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(Ct()),this.O(Ct()),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=Mi(e).nextSibling;Mi(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ut=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"),Ri=/'/g,zi=/"/g,Pi=/^(?:script|style|textarea|title)$/i,Ur=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),m=Ur(1),J=Ur(2),Hm=Ur(3),Je=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ti=new WeakMap,Ze=Ye.createTreeWalker(Ye,129);function Hi(r,e){if(!Gr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return $i!==void 0?$i.createHTML(e):e}var iu=(r,e)=>{let t=r.length-1,n=[],o,i=e===2?"<svg>":e===3?"<math>":"",s=It;for(let a=0;a<t;a++){let l=r[a],c,u,d=-1,p=0;for(;p<l.length&&(s.lastIndex=p,u=s.exec(l),u!==null);)p=s.lastIndex,s===It?u[1]==="!--"?s=Ai:u[1]!==void 0?s=Ei:u[2]!==void 0?(Pi.test(u[2])&&(o=RegExp("</"+u[2],"g")),s=qe):u[3]!==void 0&&(s=qe):s===qe?u[0]===">"?(s=o??It,d=-1):u[1]===void 0?d=-2:(d=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?qe:u[3]==='"'?zi:Ri):s===zi||s===Ri?s=qe:s===Ai||s===Ei?s=It:(s=qe,o=void 0);let h=s===qe&&r[a+1].startsWith("/>")?" ":"";i+=s===It?l+ru:d>=0?(n.push(c),l.slice(0,d)+Fi+l.slice(d)+Oe+h):l+Oe+(d===-2?a:h)}return[Hi(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Ot=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]=iu(e,t);if(this.el=r.createElement(c,n),Ze.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=Ze.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let d of o.getAttributeNames())if(d.endsWith(Fi)){let p=u[s++],h=o.getAttribute(d).split(Oe),w=/([.?@])?(.*)/.exec(p);l.push({type:1,index:i,name:w[2],strings:h,ctor:w[1]==="."?Wr:w[1]==="?"?Lr:w[1]==="@"?Br:ut}),o.removeAttribute(d)}else d.startsWith(Oe)&&(l.push({type:6,index:i}),o.removeAttribute(d));if(Pi.test(o.tagName)){let d=o.textContent.split(Oe),p=d.length-1;if(p>0){o.textContent=Sn?Sn.emptyScript:"";for(let h=0;h<p;h++)o.append(d[h],Ct()),Ze.nextNode(),l.push({type:2,index:++i});o.append(d[p],Ct())}}}else if(o.nodeType===8)if(o.data===Di)l.push({type:2,index:i});else{let d=-1;for(;(d=o.data.indexOf(Oe,d+1))!==-1;)l.push({type:7,index:i}),d+=Oe.length-1}i++}}static createElement(e,t){let n=Ye.createElement("template");return n.innerHTML=e,n}};function ct(r,e,t=r,n){if(e===Je)return e;let o=n!==void 0?t._$Co?.[n]:t._$Cl,i=Nt(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=ct(r,o._$AS(r,e.values),o,n)),e}var Or=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??Ye).importNode(t,!0);Ze.currentNode=o;let i=Ze.nextNode(),s=0,a=0,l=n[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new Wt(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new Vr(i,this,e)),this._$AV.push(c),l=n[++a]}s!==l?.index&&(i=Ze.nextNode(),s++)}return Ze.currentNode=Ye,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++}},Wt=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=ct(this,e,t),Nt(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==Je&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ou(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&&Nt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ye.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=Ot.createElement(Hi(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new Or(o,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=Ti.get(e.strings);return t===void 0&&Ti.set(e.strings,t=new Ot(e)),t}k(e){Gr(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(Ct()),this.O(Ct()),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=Mi(e).nextSibling;Mi(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ut=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:
{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
@@ -3278,7 +3278,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
inset: auto 16px 16px;
color: var(--nf-danger);
}
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",ui);function se(r,e){return Math.abs(e)>=1e3?`${O(r,e/1e3,1)} kW`:`${Math.round(e)} W`}function ci(r){return r.type==="tv_board"?r.h+.9:r.type==="tv_wall"||r.type==="kitchen_wall"?r.h+.25:r.h+.35}function bm(r,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:ee(r,e)}var Ac;function Ec(){let r=new URL("./nextfloor-editor.js?v=85ae4159b3e8",new URL(import.meta.url)).href;return Ac??=import(r),Ac}var wm=.25,Rc=r=>Math.round(r*1e3)/1e3,zc=(r,e,t)=>r.rooms.find(n=>n.points.length>=3&&H([e,t],n.points));function hi(r,e,t,n,o){let i=zc(r,e,t);if(!i)return[n,o];let s=(a,l)=>H([a,l],i.points);return s(n,o)?[n,o]:s(n,t)?[n,t]:s(e,o)?[e,o]:[e,t]}function vm(r,e,t,n){return r.rooms.some(o=>o.id!==e.id&&o.points.some((i,s)=>{let a=o.points[(s+1)%o.points.length];return Math.abs(oe(Z(i,t),n))<.02&&Math.abs(oe(Z(a,t),n))<.02}))}var di=(r,e)=>Math.abs((r-e+540)%360-180);function Tc(r,e,t,n=wm){let o=zc(r,e.x,e.z);if(!o)return null;let i=o.points,s=et(i)>=0?1:-1,a=null;return i.forEach((l,c)=>{let u=i[(c+1)%i.length],d=Te(Z(u,l));if(d<.3)return;let p=[(u[0]-l[0])/d,(u[1]-l[1])/d],h=[-p[1]*s,p[0]*s],w=oe(Z([e.x,e.z],l),p);if(w<0||w>d)return;let b=vm(r,o,l,h)?t/2:0,g=oe(Z([e.x,e.z],l),h)-b,_=Math.atan2(-h[0],h[1])*180/Math.PI,$=[{rotation:_,extent:e.d/2},{rotation:_+90,extent:e.w/2},{rotation:_-90,extent:e.w/2}].reduce((y,F)=>di(e.rotation,F.rotation)<di(e.rotation,y.rotation)?F:y);if(di(e.rotation,$.rotation)>50)return;let x=g-$.extent;Math.abs(x)>n||a&&Math.abs(x)>=Math.abs(a.gap)||(a={x:Rc(e.x-h[0]*x),z:Rc(e.z-h[1]*x),rotation:(Math.round($.rotation)%360+360)%360,gap:x})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function Er(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.furniture.find(s=>s.id===e);i&&t(i,o)}return n}function Rr(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.placements.find(s=>s.entity_id===e);i&&t(i,o)}return n}function Fc(r,e){let t=structuredClone(r);for(let n of t.floors)n.furniture=n.furniture.filter(o=>o.id!==e);return t}function Dc(r,e){let t=structuredClone(r);for(let n of t.floors)n.placements=n.placements.filter(o=>o.entity_id!==e);return t}function Pc(r,e,t,n){return Rr(r,e,(o,i)=>{[o.x,o.z]=hi(i,o.x,o.z,t,n)})}function Hc(r,e,t,n){let o=r.settings.wall_interior??.12;return Er(r,e,(i,s)=>{[i.x,i.z]=hi(s,i.x,i.z,t,n);let a=Tc(s,i,o);a&&Object.assign(i,a)})}var pi=(r,e)=>((r+e)%360+360)%360,Ic=r=>Number.parseFloat(r.replace(",",".")),wn=(r,e)=>Math.round(r*10**e)/10**e;function mi(r){let{min:e,max:t,accepts:n=()=>!0}=r,o=i=>{let s=Ic(i.target.value);!Number.isFinite(s)||!n(s)||r.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return m`<label class="nf-size" title=${r.title}
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",ui);function se(r,e){return Math.abs(e)>=1e3?`${O(r,e/1e3,1)} kW`:`${Math.round(e)} W`}function ci(r){return r.type==="tv_board"?r.h+.9:r.type==="tv_wall"||r.type==="kitchen_wall"?r.h+.25:r.h+.35}function bm(r,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:ee(r,e)}var Ac;function Ec(){let r=new URL("./nextfloor-editor.js?v=f8af4c57431e",new URL(import.meta.url)).href;return Ac??=import(r),Ac}var wm=.25,Rc=r=>Math.round(r*1e3)/1e3,zc=(r,e,t)=>r.rooms.find(n=>n.points.length>=3&&H([e,t],n.points));function hi(r,e,t,n,o){let i=zc(r,e,t);if(!i)return[n,o];let s=(a,l)=>H([a,l],i.points);return s(n,o)?[n,o]:s(n,t)?[n,t]:s(e,o)?[e,o]:[e,t]}function vm(r,e,t,n){return r.rooms.some(o=>o.id!==e.id&&o.points.some((i,s)=>{let a=o.points[(s+1)%o.points.length];return Math.abs(oe(Z(i,t),n))<.02&&Math.abs(oe(Z(a,t),n))<.02}))}var di=(r,e)=>Math.abs((r-e+540)%360-180);function Tc(r,e,t,n=wm){let o=zc(r,e.x,e.z);if(!o)return null;let i=o.points,s=et(i)>=0?1:-1,a=null;return i.forEach((l,c)=>{let u=i[(c+1)%i.length],d=Te(Z(u,l));if(d<.3)return;let p=[(u[0]-l[0])/d,(u[1]-l[1])/d],h=[-p[1]*s,p[0]*s],w=oe(Z([e.x,e.z],l),p);if(w<0||w>d)return;let b=vm(r,o,l,h)?t/2:0,g=oe(Z([e.x,e.z],l),h)-b,_=Math.atan2(-h[0],h[1])*180/Math.PI,$=[{rotation:_,extent:e.d/2},{rotation:_+90,extent:e.w/2},{rotation:_-90,extent:e.w/2}].reduce((y,F)=>di(e.rotation,F.rotation)<di(e.rotation,y.rotation)?F:y);if(di(e.rotation,$.rotation)>50)return;let x=g-$.extent;Math.abs(x)>n||a&&Math.abs(x)>=Math.abs(a.gap)||(a={x:Rc(e.x-h[0]*x),z:Rc(e.z-h[1]*x),rotation:(Math.round($.rotation)%360+360)%360,gap:x})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function Er(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.furniture.find(s=>s.id===e);i&&t(i,o)}return n}function Rr(r,e,t){let n=structuredClone(r);for(let o of n.floors){let i=o.placements.find(s=>s.entity_id===e);i&&t(i,o)}return n}function Fc(r,e){let t=structuredClone(r);for(let n of t.floors)n.furniture=n.furniture.filter(o=>o.id!==e);return t}function Dc(r,e){let t=structuredClone(r);for(let n of t.floors)n.placements=n.placements.filter(o=>o.entity_id!==e);return t}function Pc(r,e,t,n){return Rr(r,e,(o,i)=>{[o.x,o.z]=hi(i,o.x,o.z,t,n)})}function Hc(r,e,t,n){let o=r.settings.wall_interior??.12;return Er(r,e,(i,s)=>{[i.x,i.z]=hi(s,i.x,i.z,t,n);let a=Tc(s,i,o);a&&Object.assign(i,a)})}var pi=(r,e)=>((r+e)%360+360)%360,Ic=r=>Number.parseFloat(r.replace(",",".")),wn=(r,e)=>Math.round(r*10**e)/10**e;function mi(r){let{min:e,max:t,accepts:n=()=>!0}=r,o=i=>{let s=Ic(i.target.value);!Number.isFinite(s)||!n(s)||r.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return m`<label class="nf-size" title=${r.title}
>${r.label}
<input type="number" inputmode="decimal" step=${r.step} min=${e} max=${t??f} .value=${String(wn(r.value,2))} @change=${o} />
</label>`}var Nc=(r,e)=>m`<button class="nf-chip" @click=${e}>${r.t("height_auto")}</button>`,Cc=(r,e)=>m`<button class="nf-chip" @click=${()=>e(-r)}>↺ ${r}°</button><button class="nf-chip" @click=${()=>e(r)}>↻ ${r}°</button>`;function ym(r,e){let t=r.building.floors.find(s=>s.furniture.some(a=>a.id===e)),n=t?.furniture.find(s=>s.id===e);if(!t||!n)return f;let o=(s,a)=>mi({label:r.t(a),title:r.t(`size_${s}`),value:n[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>r.editFurniture(e,c=>c[s]=wn(l,3))}),i=ms(n)?m`${mi({label:"\u2195",title:r.t("mount_height"),value:n.mount_y??le(t,n),step:.05,min:0,accepts:s=>s>=0,apply:s=>r.editFurniture(e,a=>a.mount_y=wn(s,3))})}
@@ -4192,7 +4192,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
${n.showBar&&e?this.renderBar(n):f}
${this.renderCorners()}
</div>
</ha-card>`}static styles=[Se,Ve,Uc,ur]};if(!customElements.get("nextfloor-card")){customElements.define("nextfloor-card",bi);let r=window;r.customCards=r.customCards??[],r.customCards.push({type:"nextfloor-card",name:R(void 0,"card_name"),description:R(void 0,"card_description"),preview:!1})}Xr();function Sm(){let r=window.__NEXTFLOOR_SYMCON__;if(!r?.endpoint||!r.token)throw new Error("NextFloor Symcon host configuration is missing");return r}async function Dr(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({action:e,...t})}),o=await n.json().catch(()=>({error:`HTTP ${n.status}`}));if(!n.ok||!o||typeof o!="object"||"error"in o){let i=o&&typeof o=="object"&&"error"in o?o.error:`HTTP ${n.status}`;throw new Error(String(i))}return o}var Pr=class{settings=Sm();changeListeners=new Set;buildingListeners=new Set;timer;stateRevision=-1;buildingRevision=-1;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,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 Dr(this.settings,"bootstrap");return this.apply(e),this.stateRevision=e.state_revision,this.buildingRevision=e.building_revision,this.timer=setInterval(()=>{this.refresh()},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}}}async refresh(){try{let e=await Dr(this.settings,"variables/snapshot",{revision:this.stateRevision});if(e.state_revision!==this.stateRevision&&e.variables){this.stateRevision=e.state_revision,this.apply({variables:e.variables,areas:e.areas});for(let t of this.changeListeners)t()}if(e.building_revision!==this.buildingRevision){this.buildingRevision=e.building_revision;for(let t of this.buildingListeners)t(e.building_revision)}}catch{}}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}])),e.areas&&(this.areas=Object.fromEntries(e.areas.map(t=>[t.area_id,t]))),this.facade.states=this.states,this.facade.entities=this.entities,this.facade.areas=this.areas}async callWS(e){let t=String(e.type??"");if(!t.startsWith("nextfloor/"))throw new Error(`Unsupported Symcon websocket command: ${t}`);let{type:n,...o}=e;return Dr(this.settings,t.slice(10),o)}async callService(e,t,n={}){return Dr(this.settings,"variables/action",{domain:e,service:t,data:n})}fetchWithToken(e,t={}){let n=new URL(e,window.location.origin);return n.searchParams.set("token",this.settings.token),fetch(n,{...t,credentials:"same-origin"})}};function Mm(){return new URLSearchParams(window.location.search).get("mode")==="tile"?"tile":"designer"}async function $m(){let r=new Pr,e=await r.start(),t=Mm()==="tile",n=t?document.createElement("nextfloor-card"):document.createElement("nextfloor-panel");n.className=t?"nf-symcon-tile":"nf-symcon-designer",n.hass=e,t?n.setConfig({type:"custom:nextfloor-card",fill:!0,room_buttons:!0,controls:!0,weather:!1,announcements:!1}):n.narrow=!1,document.body.replaceChildren(n),r.onChange(()=>{n.hass=r.snapshot()}),window.addEventListener("pagehide",()=>r.stop(),{once:!0})}$m().catch(r=>{document.body.textContent=`NextFloor konnte nicht geladen werden: ${r instanceof Error?r.message:String(r)}`});
</ha-card>`}static styles=[Se,Ve,Uc,ur]};if(!customElements.get("nextfloor-card")){customElements.define("nextfloor-card",bi);let r=window;r.customCards=r.customCards??[],r.customCards.push({type:"nextfloor-card",name:R(void 0,"card_name"),description:R(void 0,"card_description"),preview:!1})}Xr();function Sm(){let r=window.__NEXTFLOOR_SYMCON__;if(!r?.endpoint||!r.token)throw new Error("NextFloor Symcon host configuration is missing");return r}async function Dr(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({action:e,...t})}),o=await n.json().catch(()=>({error:`HTTP ${n.status}`}));if(!n.ok||!o||typeof o!="object"||"error"in o){let i=o&&typeof o=="object"&&"error"in o?o.error:`HTTP ${n.status}`;throw new Error(String(i))}return o}var Pr=class{settings=Sm();changeListeners=new Set;buildingListeners=new Set;timer;stateRevision=-1;buildingRevision=-1;objectsSignature="";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:[],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 Dr(this.settings,"bootstrap");return this.apply(e),this.stateRevision=e.state_revision,this.buildingRevision=e.building_revision,this.timer=setInterval(()=>{this.refresh()},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}}}async refresh(){try{let e=await Dr(this.settings,"variables/snapshot",{revision:this.stateRevision});if(e.state_revision!==this.stateRevision&&e.variables){this.stateRevision=e.state_revision,this.apply({variables:e.variables,areas:e.areas,objects:e.objects});for(let t of this.changeListeners)t()}if(e.building_revision!==this.buildingRevision){this.buildingRevision=e.building_revision;for(let t of this.buildingListeners)t(e.building_revision)}}catch{}}apply(e){if(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}])),e.areas&&(this.areas=Object.fromEntries(e.areas.map(t=>[t.area_id,t]))),this.facade.states=this.states,this.facade.entities=this.entities,this.facade.areas=this.areas,e.objects){let t=JSON.stringify(e.objects);t!==this.objectsSignature&&(this.facade.symconObjects=e.objects,this.objectsSignature=t)}}async callWS(e){let t=String(e.type??"");if(!t.startsWith("nextfloor/"))throw new Error(`Unsupported Symcon websocket command: ${t}`);let{type:n,...o}=e;return Dr(this.settings,t.slice(10),o)}async callService(e,t,n={}){return Dr(this.settings,"variables/action",{domain:e,service:t,data:n})}fetchWithToken(e,t={}){let n=new URL(e,window.location.origin);return n.searchParams.set("token",this.settings.token),fetch(n,{...t,credentials:"same-origin"})}};function Mm(){return new URLSearchParams(window.location.search).get("mode")==="tile"?"tile":"designer"}async function $m(){let r=new Pr,e=await r.start(),t=Mm()==="tile",n=t?document.createElement("nextfloor-card"):document.createElement("nextfloor-panel");n.className=t?"nf-symcon-tile":"nf-symcon-designer",n.hass=e,t?n.setConfig({type:"custom:nextfloor-card",fill:!0,room_buttons:!0,controls:!0,weather:!1,announcements:!1}):n.narrow=!1,document.body.replaceChildren(n),r.onChange(()=>{n.hass=r.snapshot()}),window.addEventListener("pagehide",()=>r.stop(),{once:!0})}$m().catch(r=>{document.body.textContent=`NextFloor konnte nicht geladen werden: ${r instanceof Error?r.message:String(r)}`});
/*! Bundled license information:
@lit/reactive-element/css-tag.js:
File diff suppressed because it is too large. Load diff
+37 -7
View File
@@ -239,7 +239,8 @@ class NextFloor extends IPSModuleStrict
'state_revision' => $stateRevision,
'building_revision' => $this->ReadAttributeInteger('BuildingRevision'),
'variables' => $objects['variables'],
'areas' => $objects['areas']
'areas' => $objects['areas'],
'objects' => $objects['objects']
];
}
@@ -254,24 +255,40 @@ class NextFloor extends IPSModuleStrict
if ($stateRevision !== $knownRevision) {
$result['variables'] = $objects['variables'];
$result['areas'] = $objects['areas'];
$result['objects'] = $objects['objects'];
}
return $result;
}
/** Returns every selectable variable and every category that can serve as a room area. */
/** Export real object nodes, not paths reconstructed from variable names. */
private function objectTree(): array
{
$variables = [];
$areas = [];
$nodes = [];
foreach (IPS_GetChildrenIDs(0) as $child) {
$this->collectObjects($child, [], null, $variables, $areas);
$this->collectObjects($child, [], null, $variables, $areas, $nodes);
}
$byVariable = [];
foreach ($variables as $variable) {
$byVariable[$variable['attributes']['symcon_id']] = $variable['entity_id'];
}
// A link stays at its original position in the tree and selects its target variable.
foreach ($nodes as &$node) {
if ($node['object_type'] === 6) {
$target = (int) IPS_GetLink($node['object_id'])['TargetID'];
if (isset($byVariable[$target])) {
$node['entity_id'] = $byVariable[$target];
}
}
}
unset($node);
usort($variables, static fn(array $a, array $b): int => strnatcasecmp($a['path'], $b['path']));
usort($areas, static fn(array $a, array $b): int => strnatcasecmp($a['name'], $b['name']));
return ['variables' => $variables, 'areas' => $areas];
return ['variables' => $variables, 'areas' => $areas, 'objects' => $nodes];
}
private function collectObjects(int $objectID, array $parents, ?int $nearestCategory, array &$variables, array &$areas): void
private function collectObjects(int $objectID, array $parents, ?int $nearestCategory, array &$variables, array &$areas, array &$nodes): void
{
if (!IPS_ObjectExists($objectID)) {
return;
@@ -280,15 +297,28 @@ class NextFloor extends IPSModuleStrict
$name = IPS_GetName($objectID);
$path = [...$parents, $name];
$type = (int) $object['ObjectType'];
$node = [
'object_id' => $objectID,
'parent_id' => (int) $object['ParentID'],
'name' => $name,
'path' => implode(' / ', $path),
'object_type' => $type,
'position' => (int) $object['ObjectPosition'],
'hidden' => (bool) $object['ObjectIsHidden'],
'icon' => (string) $object['ObjectIcon']
];
if ($type === 0) { // OBJECTTYPE_CATEGORY
$nearestCategory = $objectID;
$areas[] = ['area_id' => 'symcon-category-' . $objectID, 'name' => implode(' / ', $path)];
}
if ($type === 2) { // OBJECTTYPE_VARIABLE
$variables[] = $this->describeVariable($objectID, $name, implode(' / ', $path), $nearestCategory);
$variable = $this->describeVariable($objectID, $name, implode(' / ', $path), $nearestCategory);
$variables[] = $variable;
$node['entity_id'] = $variable['entity_id'];
}
$nodes[] = $node;
foreach (IPS_GetChildrenIDs($objectID) as $child) {
$this->collectObjects($child, $path, $nearestCategory, $variables, $areas);
$this->collectObjects($child, $path, $nearestCategory, $variables, $areas, $nodes);
}
}