feat: replace Labs expiry with persistent alpha switch

Issue: #448
User-Visible: yes
This commit is contained in:
Sergey Matyunin
2026-09-04 16:31:06 +03:00
parent 7230e4248a
commit 169fed01f0
52 changed files with 531 additions and 486 deletions
+79 -79
View File
@@ -1,169 +1,169 @@
{
"schema": 1,
"fingerprint": "7acb1b9d3bb384bc1a0c70fb01347386c157ae88b12b00ccd876b7658fc84a1c",
"fingerprint": "c587da8bf19038598495b0b9ddda9c9114f0756daab651f3e54c33a5c475fb68",
"entry": "houseplan-card.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-CUGUKK_i.js",
"houseplan-assets/houseplan-card-ChX1D80D.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 295369,
"initialViewGzipBytes": 295081,
"lazyFiles": [
"houseplan-assets/backdrop-pick-dOIdD4Nd.js",
"houseplan-assets/de-cPbBjbs1.js",
"houseplan-assets/editor-DbPvbFoq.js",
"houseplan-assets/fr-DPg5Q9iv.js",
"houseplan-assets/houseplan-editor-runtime-BgPje-yd.js",
"houseplan-assets/houseplan-onboarding-runtime-DLDNqOhX.js",
"houseplan-assets/hp-zigbee-topology-overlay-BQXXvOQH.js",
"houseplan-assets/zigbee-topology-CYx1516f.js",
"houseplan-assets/zigbee-topology-runtime-uMa0AauT.js"
"houseplan-assets/backdrop-pick-NrJEEN0r.js",
"houseplan-assets/de-DA7mjOZJ.js",
"houseplan-assets/editor-D24BP0DF.js",
"houseplan-assets/fr-C-w3DcXu.js",
"houseplan-assets/houseplan-editor-runtime-RnjyqTgo.js",
"houseplan-assets/houseplan-onboarding-runtime-CvJdLhnE.js",
"houseplan-assets/hp-zigbee-topology-overlay-CETnk9d9.js",
"houseplan-assets/zigbee-topology-DPVmjscE.js",
"houseplan-assets/zigbee-topology-runtime-DGzNYIFZ.js"
],
"lazyGzipBytes": 234136,
"lazyGzipBytes": 234155,
"lazyEditorFiles": [
"houseplan-assets/backdrop-pick-dOIdD4Nd.js",
"houseplan-assets/editor-DbPvbFoq.js",
"houseplan-assets/houseplan-editor-runtime-BgPje-yd.js",
"houseplan-assets/zigbee-topology-CYx1516f.js"
"houseplan-assets/backdrop-pick-NrJEEN0r.js",
"houseplan-assets/editor-D24BP0DF.js",
"houseplan-assets/houseplan-editor-runtime-RnjyqTgo.js",
"houseplan-assets/zigbee-topology-DPVmjscE.js"
],
"lazyEditorGzipBytes": 173931,
"lazyEditorGzipBytes": 173937,
"lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-dOIdD4Nd.js",
"houseplan-assets/houseplan-onboarding-runtime-DLDNqOhX.js"
"houseplan-assets/backdrop-pick-NrJEEN0r.js",
"houseplan-assets/houseplan-onboarding-runtime-CvJdLhnE.js"
],
"lazyOnboardingGzipBytes": 14237,
"lazyOnboardingGzipBytes": 14241,
"lazyLocaleFiles": [
"houseplan-assets/de-cPbBjbs1.js",
"houseplan-assets/fr-DPg5Q9iv.js"
"houseplan-assets/de-DA7mjOZJ.js",
"houseplan-assets/fr-C-w3DcXu.js"
],
"lazyLocaleGzipBytes": 49108,
"lazyLocaleGzipBytes": 49112,
"files": [
{
"path": "houseplan-assets/backdrop-pick-dOIdD4Nd.js",
"sha256": "2cb83657b59e337a9580810b3b80e0b2f59416aa067b75568e04bc3aff120471",
"path": "houseplan-assets/backdrop-pick-NrJEEN0r.js",
"sha256": "7647a2ccc2b50dbf4d8394f1da7fc489ba127a6b229c12a4baf3eebf0be88e16",
"rawBytes": 21418,
"gzipBytes": 7283,
"gzipBytes": 7284,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CUGUKK_i.js"
"houseplan-assets/houseplan-card-ChX1D80D.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/de-cPbBjbs1.js",
"sha256": "01aa9b2ef88895a4f9db5b15254c059a4ed8fca086f4dcd9190aaf98603ed013",
"path": "houseplan-assets/de-DA7mjOZJ.js",
"sha256": "db975403b8dcf15b57e6f2546f101fd862324a74f04a0e15178d941be6f849a2",
"rawBytes": 82182,
"gzipBytes": 24824,
"gzipBytes": 24826,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor-DbPvbFoq.js",
"sha256": "c6d1ad2545d39a42f40a6411775d27be856ee0611225cc4dcc4e8481808bb6d4",
"path": "houseplan-assets/editor-D24BP0DF.js",
"sha256": "93a90b206308e316481a075edf1d08d501a640a769cc4484658500c1d9e5ba35",
"rawBytes": 3826,
"gzipBytes": 1582,
"gzipBytes": 1583,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CUGUKK_i.js"
"houseplan-assets/houseplan-card-ChX1D80D.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/fr-DPg5Q9iv.js",
"sha256": "2c8ae7b54e24ffca2324219678f6d935468e728dc78d2c11df66c2553ef58464",
"path": "houseplan-assets/fr-C-w3DcXu.js",
"sha256": "bcf7706e58edb29f1177e87235329c8fa7a95ea79927e67141dfd31a600390f9",
"rawBytes": 84312,
"gzipBytes": 24284,
"gzipBytes": 24286,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-CUGUKK_i.js",
"sha256": "88d7cd5d613b674a9e7ebf1aadca73b81f229b1694a4d8f9f319a68f50738fff",
"rawBytes": 1048703,
"gzipBytes": 294573,
"path": "houseplan-assets/houseplan-card-ChX1D80D.js",
"sha256": "bb34df2874e249302a10e76bab0f6f65ba7da20a231f01d33e4911f09ec2c888",
"rawBytes": 1047873,
"gzipBytes": 294284,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-cPbBjbs1.js",
"houseplan-assets/editor-DbPvbFoq.js",
"houseplan-assets/fr-DPg5Q9iv.js",
"houseplan-assets/houseplan-editor-runtime-BgPje-yd.js",
"houseplan-assets/houseplan-onboarding-runtime-DLDNqOhX.js",
"houseplan-assets/hp-zigbee-topology-overlay-BQXXvOQH.js"
"houseplan-assets/de-DA7mjOZJ.js",
"houseplan-assets/editor-D24BP0DF.js",
"houseplan-assets/fr-C-w3DcXu.js",
"houseplan-assets/houseplan-editor-runtime-RnjyqTgo.js",
"houseplan-assets/houseplan-onboarding-runtime-CvJdLhnE.js",
"houseplan-assets/hp-zigbee-topology-overlay-CETnk9d9.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-BgPje-yd.js",
"sha256": "c01e76ecf2722feeb32b0900965a49d8203051f23f691d39077455b5691872aa",
"path": "houseplan-assets/houseplan-editor-runtime-RnjyqTgo.js",
"sha256": "f8db491183ec7f8f3120fba5dffab6faf905b0833d8ac004e1913553d2e0d00e",
"rawBytes": 608951,
"gzipBytes": 160251,
"gzipBytes": 160254,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-dOIdD4Nd.js",
"houseplan-assets/houseplan-card-CUGUKK_i.js",
"houseplan-assets/zigbee-topology-CYx1516f.js"
"houseplan-assets/backdrop-pick-NrJEEN0r.js",
"houseplan-assets/houseplan-card-ChX1D80D.js",
"houseplan-assets/zigbee-topology-DPVmjscE.js"
],
"dynamicImports": [
"houseplan-assets/zigbee-topology-runtime-uMa0AauT.js"
"houseplan-assets/zigbee-topology-runtime-DGzNYIFZ.js"
]
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-DLDNqOhX.js",
"sha256": "a1621e3e28d48132909b6212ec8ea4876dce1e369397d5059c106e111b49c1c2",
"path": "houseplan-assets/houseplan-onboarding-runtime-CvJdLhnE.js",
"sha256": "5885db7cb48f494ea4aa71c9e8bafb1afb937fc5fd1e342ae78bfd192561df3b",
"rawBytes": 28088,
"gzipBytes": 6954,
"gzipBytes": 6957,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-dOIdD4Nd.js",
"houseplan-assets/houseplan-card-CUGUKK_i.js"
"houseplan-assets/backdrop-pick-NrJEEN0r.js",
"houseplan-assets/houseplan-card-ChX1D80D.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/hp-zigbee-topology-overlay-BQXXvOQH.js",
"sha256": "7d156f4c6f9ea90352980a8674ed7862586cc34c53b837dc362fff657edd70f0",
"path": "houseplan-assets/hp-zigbee-topology-overlay-CETnk9d9.js",
"sha256": "6059de0ce06bcddf8049095ba9ec7ed4c88f5ad77838e91f4cfdcb8189ef1d78",
"rawBytes": 6007,
"gzipBytes": 2379,
"gzipBytes": 2384,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CUGUKK_i.js",
"houseplan-assets/zigbee-topology-CYx1516f.js",
"houseplan-assets/zigbee-topology-runtime-uMa0AauT.js"
"houseplan-assets/houseplan-card-ChX1D80D.js",
"houseplan-assets/zigbee-topology-DPVmjscE.js",
"houseplan-assets/zigbee-topology-runtime-DGzNYIFZ.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/zigbee-topology-CYx1516f.js",
"sha256": "aebecd67b2ec3e73605ba0a9ef59f60352428230d44a85138a161532743487ee",
"rawBytes": 12245,
"gzipBytes": 4815,
"path": "houseplan-assets/zigbee-topology-DPVmjscE.js",
"sha256": "5558d0c42b9edac38cb192822c58c03463856bbedeefa2176f6fcc4a49a25c75",
"rawBytes": 12250,
"gzipBytes": 4816,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CUGUKK_i.js"
"houseplan-assets/houseplan-card-ChX1D80D.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/zigbee-topology-runtime-uMa0AauT.js",
"sha256": "ed10f0d6cd269bb639dc8857b3c2b1a8a3296c76d046913eb1e078cb718f0adc",
"path": "houseplan-assets/zigbee-topology-runtime-DGzNYIFZ.js",
"sha256": "4a4244f8a1e308c12af2675f47dc22a99ca29caf455820cd9961e9bbddfd8557",
"rawBytes": 3941,
"gzipBytes": 1764,
"gzipBytes": 1765,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CUGUKK_i.js",
"houseplan-assets/zigbee-topology-CYx1516f.js"
"houseplan-assets/houseplan-card-ChX1D80D.js",
"houseplan-assets/zigbee-topology-DPVmjscE.js"
],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "e2052f7a097d344cf8c00df6c9735e96d4e9b8670c2b55174cca6bc8469f83bf",
"sha256": "420508366c663a62745f1c0ac9573d34395a2a12328da1ee8c3efa2fc28960af",
"rawBytes": 1183,
"gzipBytes": 796,
"gzipBytes": 797,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-CUGUKK_i.js"
"houseplan-assets/houseplan-card-ChX1D80D.js"
],
"dynamicImports": []
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7acb1b9d3bb384bc1a0c70fb01347386c157ae88b12b00ccd876b7658fc84a1c";import{k as e,l as o,t,dq as s,A as a,dr as i,ds as l,dt as r,E as n,c}from"./houseplan-card-CUGUKK_i.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const r="string"==typeof this._config?.default_floor?this._config.default_floor:"",n=[...e];return r&&!e.some(e=>e.value===r)&&n.unshift({value:r,label:r}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:n}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return r();if("warm"===e)return n;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="c587da8bf19038598495b0b9ddda9c9114f0756daab651f3e54c33a5c475fb68";import{k as e,l as o,t,dq as s,A as a,dr as i,ds as l,dt as r,E as n,c}from"./houseplan-card-ChX1D80D.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const r="string"==typeof this._config?.default_floor?this._config.default_floor:"",n=[...e];return r&&!e.some(e=>e.value===r)&&n.unshift({value:r,label:r}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:n}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return r();if("warm"===e)return n;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
.hass=${this.hass}
.data=${this._formData}
.schema=${e}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7acb1b9d3bb384bc1a0c70fb01347386c157ae88b12b00ccd876b7658fc84a1c";import{k as e,A as t,du as i,aw as s,c as o,l as r,j as n}from"./houseplan-card-CUGUKK_i.js";import{a,r as h,t as d}from"./zigbee-topology-CYx1516f.js";import{zigbeeTopologyRuntimeSnapshot as p,subscribeZigbeeTopology as c}from"./zigbee-topology-runtime-uMa0AauT.js";const l={revision:0,topologies:[],states:{}};class v extends e{constructor(){super(...arguments),this.devices=[],this.currentSpace="",this._runtime=l,this._hovered="",this._pointerOver=e=>{if(!this._mouseAllowed(e))return void this._clear();const t=this._deviceFromEvent(e),i=t?.dataset.id||"";i&&i!==this._hovered&&(this._hovered=i,this.requestUpdate())},this._pointerOut=e=>{const t=this._deviceFromEvent(e);if(!t||t.dataset.id!==this._hovered)return;const i=e.relatedTarget instanceof Element?e.relatedTarget.closest('[data-hp="device"]'):null;i?.dataset.id!==this._hovered&&this._clear()},this._pointerDown=e=>{"mouse"!==e.pointerType&&this._clear()}}connectedCallback(){super.connectedCallback();const e=this.getRootNode();e.host&&"undefined"!=typeof MutationObserver&&(this._hoverGateObserver=new MutationObserver(()=>{e.host.hasAttribute("data-pointer-hover")||this._clear()}),this._hoverGateObserver.observe(e.host,{attributes:!0,attributeFilter:["data-pointer-hover"]})),queueMicrotask(()=>this._connectParent())}disconnectedCallback(){this._release?.(),this._release=void 0,this._disconnectParent(),this._hoverGateObserver?.disconnect(),this._hoverGateObserver=void 0,this._hovered="",super.disconnectedCallback()}updated(e){e.has("hass")&&(this._release?.(),this._runtime=p(this.hass),this._mappedMemo=void 0,this._release=c(this.hass,()=>{this._runtime=p(this.hass),this._mappedMemo=void 0,this.requestUpdate()})),(e.has("currentSpace")||e.has("devices")||e.has("registry"))&&(this._mappedMemo=void 0,this.devices.some(e=>e.id===this._hovered&&e.space===this.currentSpace)||(this._hovered=""))}_connectParent(){const e=this.parentElement;e&&e!==this._parent&&(this._disconnectParent(),this._parent=e,e.addEventListener("pointerover",this._pointerOver),e.addEventListener("pointerout",this._pointerOut),e.addEventListener("pointerdown",this._pointerDown,!0))}_disconnectParent(){this._parent?.removeEventListener("pointerover",this._pointerOver),this._parent?.removeEventListener("pointerout",this._pointerOut),this._parent?.removeEventListener("pointerdown",this._pointerDown,!0),this._parent=void 0}_deviceFromEvent(e){for(const t of e.composedPath())if(t instanceof HTMLElement&&"device"===t.dataset.hp)return t;return null}_mouseAllowed(e){const t=this.getRootNode();return"mouse"===e.pointerType&&t.host?.hasAttribute?.("data-pointer-hover")}_clear(){this._hovered&&(this._hovered="",this.requestUpdate())}_position(e){const t=[...this._parent?.querySelectorAll(".dev[data-id]")||[]].find(t=>t.dataset.id===e);if(!t)return null;const i=Number.parseFloat(t.style.left),s=Number.parseFloat(t.style.top),o=t.getBoundingClientRect();return Number.isFinite(i)&&Number.isFinite(s)?{x:i,y:s,width:o.width,height:o.height}:null}render(){if(!this._hovered||!this.registry||!this._runtime.topologies.length)return t;const e=this._mappedMemo,n=e&&e.runtime===this._runtime&&e.devices===this.devices&&e.registry===this.registry?e.mapped:a(this._runtime.topologies,this.devices,this.registry);e&&n===e.mapped||(this._mappedMemo={runtime:this._runtime,devices:this.devices,registry:this.registry,mapped:n});const p=h(n,this.currentSpace,this._hovered),c=this._position(this._hovered);if(!c)return t;const l=p.lines.map(e=>({...e,point:this._position(e.neighborMarkerId)})).filter(e=>!!e.point);return o`
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="c587da8bf19038598495b0b9ddda9c9114f0756daab651f3e54c33a5c475fb68";import{k as e,A as t,du as i,aw as s,c as o,l as r,j as n}from"./houseplan-card-ChX1D80D.js";import{a,r as h,t as d}from"./zigbee-topology-DPVmjscE.js";import{zigbeeTopologyRuntimeSnapshot as p,subscribeZigbeeTopology as c}from"./zigbee-topology-runtime-DGzNYIFZ.js";const l={revision:0,topologies:[],states:{}};class v extends e{constructor(){super(...arguments),this.devices=[],this.currentSpace="",this._runtime=l,this._hovered="",this._pointerOver=e=>{if(!this._mouseAllowed(e))return void this._clear();const t=this._deviceFromEvent(e),i=t?.dataset.id||"";i&&i!==this._hovered&&(this._hovered=i,this.requestUpdate())},this._pointerOut=e=>{const t=this._deviceFromEvent(e);if(!t||t.dataset.id!==this._hovered)return;const i=e.relatedTarget instanceof Element?e.relatedTarget.closest('[data-hp="device"]'):null;i?.dataset.id!==this._hovered&&this._clear()},this._pointerDown=e=>{"mouse"!==e.pointerType&&this._clear()}}connectedCallback(){super.connectedCallback();const e=this.getRootNode();e.host&&"undefined"!=typeof MutationObserver&&(this._hoverGateObserver=new MutationObserver(()=>{e.host.hasAttribute("data-pointer-hover")||this._clear()}),this._hoverGateObserver.observe(e.host,{attributes:!0,attributeFilter:["data-pointer-hover"]})),queueMicrotask(()=>this._connectParent())}disconnectedCallback(){this._release?.(),this._release=void 0,this._disconnectParent(),this._hoverGateObserver?.disconnect(),this._hoverGateObserver=void 0,this._hovered="",super.disconnectedCallback()}updated(e){e.has("hass")&&(this._release?.(),this._runtime=p(this.hass),this._mappedMemo=void 0,this._release=c(this.hass,()=>{this._runtime=p(this.hass),this._mappedMemo=void 0,this.requestUpdate()})),(e.has("currentSpace")||e.has("devices")||e.has("registry"))&&(this._mappedMemo=void 0,this.devices.some(e=>e.id===this._hovered&&e.space===this.currentSpace)||(this._hovered=""))}_connectParent(){const e=this.parentElement;e&&e!==this._parent&&(this._disconnectParent(),this._parent=e,e.addEventListener("pointerover",this._pointerOver),e.addEventListener("pointerout",this._pointerOut),e.addEventListener("pointerdown",this._pointerDown,!0))}_disconnectParent(){this._parent?.removeEventListener("pointerover",this._pointerOver),this._parent?.removeEventListener("pointerout",this._pointerOut),this._parent?.removeEventListener("pointerdown",this._pointerDown,!0),this._parent=void 0}_deviceFromEvent(e){for(const t of e.composedPath())if(t instanceof HTMLElement&&"device"===t.dataset.hp)return t;return null}_mouseAllowed(e){const t=this.getRootNode();return"mouse"===e.pointerType&&t.host?.hasAttribute?.("data-pointer-hover")}_clear(){this._hovered&&(this._hovered="",this.requestUpdate())}_position(e){const t=[...this._parent?.querySelectorAll(".dev[data-id]")||[]].find(t=>t.dataset.id===e);if(!t)return null;const i=Number.parseFloat(t.style.left),s=Number.parseFloat(t.style.top),o=t.getBoundingClientRect();return Number.isFinite(i)&&Number.isFinite(s)?{x:i,y:s,width:o.width,height:o.height}:null}render(){if(!this._hovered||!this.registry||!this._runtime.topologies.length)return t;const e=this._mappedMemo,n=e&&e.runtime===this._runtime&&e.devices===this.devices&&e.registry===this.registry?e.mapped:a(this._runtime.topologies,this.devices,this.registry);e&&n===e.mapped||(this._mappedMemo={runtime:this._runtime,devices:this.devices,registry:this.registry,mapped:n});const p=h(n,this.currentSpace,this._hovered),c=this._position(this._hovered);if(!c)return t;const l=p.lines.map(e=>({...e,point:this._position(e.neighborMarkerId)})).filter(e=>!!e.point);return o`
${l.length?s`<svg viewBox="0 0 100 100" preserveAspectRatio="none"
aria-hidden="true" data-hp="zigbee-topology-lines">
${l.map(e=>s`<line x1=${c.x} y1=${c.y}
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7acb1b9d3bb384bc1a0c70fb01347386c157ae88b12b00ccd876b7658fc84a1c";import{n as t,b as n}from"./zigbee-topology-CYx1516f.js";import{y as e}from"./houseplan-card-CUGUKK_i.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,g=null;const y=new Promise(t=>{u=t}),b=new Promise((t,n)=>{f=t,g=n}),w=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&w.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&w.push(p),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(b,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of w)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="c587da8bf19038598495b0b9ddda9c9114f0756daab651f3e54c33a5c475fb68";import{n as t,b as n}from"./zigbee-topology-DPVmjscE.js";import{y as e}from"./houseplan-card-ChX1D80D.js";const o=new WeakMap;function i(t){const n=function(t){const n=t?.connection||t;return!n||"object"!=typeof n&&"function"!=typeof n?null:n}(t);if(!n)return null;let e=o.get(n);return e||(e={revision:0,topologies:[],states:{},listeners:new Set,inflight:new Map},o.set(n,e)),e}function r(t,n,e){t.states={...t.states,[n]:e},function(t){t.revision++;for(const n of t.listeners)n()}(t)}function s(t){const n=t?.code;if("permission"===n||"unsupported"===n||"timeout"===n||"invalid_topic"===n||"invalid_payload"===n)return n;const e=String(t?.message||"").toLowerCase();return e.includes("unauthor")||e.includes("permission")?"permission":e.includes("unknown_command")||e.includes("not found")?"unsupported":"provider"}function a(t){return Object.assign(new Error(t),{code:t})}function c(t,n,e){const o=t.inflight.get(n);if(o)return o;r(t,n,{phase:"loading"});const i=e().then(n=>{if(!n.nodes.length&&n.warnings.some(t=>"invalid_payload"===t.code))throw a("invalid_payload");!function(t,n){t.topologies=[...t.topologies.filter(t=>!(t.provider===n.provider&&t.instanceId===n.instanceId)),n],r(t,"zha"===n.provider?"zha":`z2m:${n.instanceId}`,{phase:"ready",obtainedAt:n.obtainedAt,partial:n.warnings.length>0})}(t,n)}).catch(e=>{r(t,n,{phase:"error",error:s(e)})}).finally(()=>t.inflight.delete(n));return t.inflight.set(n,i),i}function l(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function u(t,n){const e=i(t);return e?(e.listeners.add(n),()=>e.listeners.delete(n)):()=>{}}function p(t){if(!0!==t?.user?.is_admin)throw a("permission")}function f(n){const e=i(n);return e?c(e,"zha",async()=>{if(p(n),"function"!=typeof n?.callWS)throw a("unsupported");return t(await n.callWS({type:"zha/devices"}))}):Promise.resolve()}function d(t){return null!==t&&"object"==typeof t?t:null}function h(t){const n=d(t),e=n?.payload??t;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return null}}async function m(t,n){let e;try{return await Promise.race([t,new Promise((t,o)=>{e=globalThis.setTimeout(()=>o(a("timeout")),Math.max(1,n))})])}finally{void 0!==e&&globalThis.clearTimeout(e)}}function g(t,o,r=15e4){const s=i(t);if(!s)return Promise.resolve();const l=e(o);return c(s,`z2m:${l||String(o)}`,async()=>{if(p(t),!l)throw a("invalid_topic");const e=t.connection,o=e?.subscribeMessage;if("function"!=typeof o||"function"!=typeof t?.callService)throw a("unsupported");const i=function(){const t=globalThis.crypto;return"function"==typeof t?.randomUUID?`houseplan-${t.randomUUID()}`:`houseplan-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}(),s=Date.now()+Math.max(1,r);let c=!1,u=null,f=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{f=t,g=n}),b=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&u?.()},{type:"mqtt/subscribe",topic:`${l}/bridge/info`});"function"==typeof r&&b.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);null!==n?n&&function(t){const n=d(t),e=n?.transaction??d(n?.data)?.transaction;return"string"==typeof e||"number"==typeof e?String(e):null}(n)===i&&f?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof p&&b.push(p),await m(y,Math.min(4e3,Math.max(1,s-Date.now()))),c=!0,await t.callService("mqtt","publish",{topic:`${l}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const v=await m(w,s-Date.now()),_=d(v)?.status;if(_&&"ok"!==_)throw a("provider");return n(v,l)}finally{for(const t of b)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
+1 -1
View File
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7acb1b9d3bb384bc1a0c70fb01347386c157ae88b12b00ccd876b7658fc84a1c";try{await import("./houseplan-assets/houseplan-card-CUGUKK_i.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale entry: the main chunk is unavailable",e)}
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="c587da8bf19038598495b0b9ddda9c9114f0756daab651f3e54c33a5c475fb68";try{await import("./houseplan-assets/houseplan-card-ChX1D80D.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale entry: the main chunk is unavailable",e)}