mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
fix: reject malformed Zigbee topology replies
Issue: #54 User-Visible: no
This commit is contained in:
@@ -1,169 +1,169 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"fingerprint": "d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e",
|
||||
"fingerprint": "d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 295355,
|
||||
"initialViewGzipBytes": 295365,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/de-DFeGpePx.js",
|
||||
"houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"houseplan-assets/fr-B-xb3XPO.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-BebiHDnX.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/de-C9t1Wvxo.js",
|
||||
"houseplan-assets/editor-3pWC96yz.js",
|
||||
"houseplan-assets/fr-DN4s45Zz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-CHF8Xp2k.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js"
|
||||
],
|
||||
"lazyGzipBytes": 234058,
|
||||
"lazyGzipBytes": 234147,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/editor-3pWC96yz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 173910,
|
||||
"lazyEditorGzipBytes": 173932,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 14235,
|
||||
"lazyOnboardingGzipBytes": 14242,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-DFeGpePx.js",
|
||||
"houseplan-assets/fr-B-xb3XPO.js"
|
||||
"houseplan-assets/de-C9t1Wvxo.js",
|
||||
"houseplan-assets/fr-DN4s45Zz.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 49089,
|
||||
"lazyLocaleGzipBytes": 49114,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"sha256": "9c2e03431acab819075bef26947d344e14315439ff46554e77b8a7c13d1f49bc",
|
||||
"path": "houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"sha256": "5b835ba23ac9ed4c5ce95d8fc85cb02d5323940841f44c799c06f10ec1cd9f2e",
|
||||
"rawBytes": 21418,
|
||||
"gzipBytes": 7280,
|
||||
"gzipBytes": 7285,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-DFeGpePx.js",
|
||||
"sha256": "98b868c66f86ff49b532cfd06fd9c3febf1a6a2fc5b82ab4cf704c8d1fdea37f",
|
||||
"path": "houseplan-assets/de-C9t1Wvxo.js",
|
||||
"sha256": "32e4807d8bf9c50e5d1b70119543133479d7b5fc1a2ef2549c398f82f3273c73",
|
||||
"rawBytes": 82182,
|
||||
"gzipBytes": 24814,
|
||||
"gzipBytes": 24827,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"sha256": "25805b82349ce1a5553ebe639abea2d8c01c7bf0de9604555f095f390f963504",
|
||||
"path": "houseplan-assets/editor-3pWC96yz.js",
|
||||
"sha256": "948a829aad31aefe970238a4f9e31946297b89ff3dd0edd6900441c994182eae",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1580,
|
||||
"gzipBytes": 1583,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-B-xb3XPO.js",
|
||||
"sha256": "fd859570cdd6bb6e35700cfd5f3ca80cf8fdeb77aaa9fb6472d6286a064d5e19",
|
||||
"path": "houseplan-assets/fr-DN4s45Zz.js",
|
||||
"sha256": "85a7ede00bc5b6db620cc2caa021a6521f00f87ea86eead81c7b1f1ba66b6dc5",
|
||||
"rawBytes": 84312,
|
||||
"gzipBytes": 24275,
|
||||
"gzipBytes": 24287,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"sha256": "5182a288cd5aafd3155b7380539576955aa1aa80c5914cecfcba48119d79d184",
|
||||
"path": "houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"sha256": "15a3eec75860b6754fe777709df6ae958f525fa0da69ff4121171fb06b5381e9",
|
||||
"rawBytes": 1048696,
|
||||
"gzipBytes": 294561,
|
||||
"gzipBytes": 294568,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-DFeGpePx.js",
|
||||
"houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"houseplan-assets/fr-B-xb3XPO.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-BebiHDnX.js"
|
||||
"houseplan-assets/de-C9t1Wvxo.js",
|
||||
"houseplan-assets/editor-3pWC96yz.js",
|
||||
"houseplan-assets/fr-DN4s45Zz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-CHF8Xp2k.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"sha256": "0132e5d538d9bd4a99efd2b8f86b6e01bf465c9be1de72a0399b114204a94189",
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"sha256": "d30404599d56dd5024b46a59db7a750c6bbc2802cf9692166b9640d283736076",
|
||||
"rawBytes": 608944,
|
||||
"gzipBytes": 160238,
|
||||
"gzipBytes": 160247,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js"
|
||||
"houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js",
|
||||
"sha256": "64f4fcf484d2e23b30c79c2a6b03c8af684da972f583151764e4957e391c1d1c",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js",
|
||||
"sha256": "4e6a2d7611f3577039c1d8deeb45d5762f9aab933947ae859daaca9d586c304c",
|
||||
"rawBytes": 28088,
|
||||
"gzipBytes": 6955,
|
||||
"gzipBytes": 6957,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/hp-zigbee-topology-overlay-BebiHDnX.js",
|
||||
"sha256": "ec91560c32a0fbe0af6e066a5cbde4de470ece320b6a189fcdbbb1d690477e53",
|
||||
"path": "houseplan-assets/hp-zigbee-topology-overlay-CHF8Xp2k.js",
|
||||
"sha256": "9f0e4a1c5fb61215e312cfec3b6e4c97f2a50c29dfb706c4fd39ad0f1ac6944d",
|
||||
"rawBytes": 6007,
|
||||
"gzipBytes": 2378,
|
||||
"gzipBytes": 2380,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/zigbee-topology-CjJau-_w.js",
|
||||
"sha256": "44bdc047f04343477b564cdd5515860c2ac58827c78b4990d13e93aaf80d43f5",
|
||||
"path": "houseplan-assets/zigbee-topology-D_aNcMzL.js",
|
||||
"sha256": "121faba84237ce191528be53209c23c460d0148e0f3c4cf173c41a11c05bb253",
|
||||
"rawBytes": 12250,
|
||||
"gzipBytes": 4812,
|
||||
"gzipBytes": 4817,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js",
|
||||
"sha256": "e09fdfac0d02509ebb3b65739eb5e148db5b328f607b6e03d6ccd03abb81d076",
|
||||
"rawBytes": 3878,
|
||||
"gzipBytes": 1726,
|
||||
"path": "houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js",
|
||||
"sha256": "6c86d1c0b6640b5029e968783b01cf97f7ecf6460b2a9fe1aa76dc7605bf2ff0",
|
||||
"rawBytes": 3941,
|
||||
"gzipBytes": 1764,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "bd8bbfbfe67ce7465845f9c52f0ab2c7678e9450cd9f238b2bb5714979f937f0",
|
||||
"sha256": "d0254ba38672cbd0d103d27d45f1ebd0ad8723586724a81c75818c6bd2fc621b",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 794,
|
||||
"gzipBytes": 797,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";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-DUGW724g.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__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";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-HZAjN4mP.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}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";import{l as t,aS as s,A as e,t as o,c as a,cf as l,cg as i,ch as h,ci as c,aP as n,cj as r,co as p,ck as d,cl as _,cm as u,cn as g,df as m,aO as b,aQ as $,dg as v}from"./houseplan-card-DUGW724g.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-MVjPRxdI.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";import{l as t,aS as s,A as e,t as o,c as a,cf as l,cg as i,ch as h,ci as c,aP as n,cj as r,co as p,ck as d,cl as _,cm as u,cn as g,df as m,aO as b,aQ as $,dg as v}from"./houseplan-card-HZAjN4mP.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-8khnweU_.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
.text=${o(h,l)} .ariaLabel=${o(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const o=l(e),a=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===o.fill?{...a||h,a:0}:a;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:o.showBorders,showNames:o.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:p,glowEnabled:o.glow,bgColor:o.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:o.tempMin,tempMax:o.tempMax,showLqi:o.showLqi??this.host._config?.show_signal??!0,cardFontScale:o.cardFontScale,labelTemp:o.labelTemp,labelHum:o.labelHum,labelLqi:o.labelLqi,labelLight:o.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...f(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const o=await y(e);if("reject"===o.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===o.kind)return void(this.host._backdropGuard=o.state);const a=await w(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return D(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),o=this.host._spaceDialog;return o&&o.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...o,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const o=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),a=this.host._spaceDialog,l=a?.saved?.find(s=>s.name===t);if(o&&a&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==a.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return a`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return a`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return a`<div class="savedplans">
|
||||
${s.map(s=>{return a`
|
||||
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";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-DUGW724g.js";import{a,r as h,t as d}from"./zigbee-topology-CjJau-_w.js";import{zigbeeTopologyRuntimeSnapshot as p,subscribeZigbeeTopology as c}from"./zigbee-topology-runtime-ne8Tm9gB.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__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";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-HZAjN4mP.js";import{a,r as h,t as d}from"./zigbee-topology-D_aNcMzL.js";import{zigbeeTopologyRuntimeSnapshot as p,subscribeZigbeeTopology as c}from"./zigbee-topology-runtime-BfK9eNEI.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}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";import{n as t,b as n}from"./zigbee-topology-CjJau-_w.js";import{y as e}from"./houseplan-card-DUGW724g.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 u(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function l(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 u=e(o);return c(s,`z2m:${u||String(o)}`,async()=>{if(p(t),!u)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=null,l=null;const f=new Promise(t=>{c=t}),g=new Promise(t=>{l=t}),y=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&c?.()},{type:"mqtt/subscribe",topic:`${u}/bridge/info`});"function"==typeof r&&y.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);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&&l?.(n)},{type:"mqtt/subscribe",topic:`${u}/bridge/response/networkmap`});"function"==typeof p&&y.push(p),await m(f,Math.min(4e3,Math.max(1,s-Date.now()))),await t.callService("mqtt","publish",{topic:`${u}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const w=await m(g,s-Date.now()),b=d(w)?.status;if(b&&"ok"!==b)throw a("provider");return n(w,u)}finally{for(const t of y)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,l as subscribeZigbeeTopology,u as zigbeeTopologyRuntimeSnapshot};
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";import{n as t,b as n}from"./zigbee-topology-D_aNcMzL.js";import{y as e}from"./houseplan-card-HZAjN4mP.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 f(t){if(!0!==t?.user?.is_admin)throw a("permission")}function p(n){const e=i(n);return e?c(e,"zha",async()=>{if(f(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(f(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,p=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{p=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 f=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&&p?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof f&&b.push(f),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{p as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
|
||||
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";try{await import("./houseplan-assets/houseplan-card-DUGW724g.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__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";try{await import("./houseplan-assets/houseplan-card-HZAjN4mP.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)}
|
||||
|
||||
Vendored
+78
-78
@@ -1,169 +1,169 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"fingerprint": "d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e",
|
||||
"fingerprint": "d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 295355,
|
||||
"initialViewGzipBytes": 295365,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/de-DFeGpePx.js",
|
||||
"houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"houseplan-assets/fr-B-xb3XPO.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-BebiHDnX.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/de-C9t1Wvxo.js",
|
||||
"houseplan-assets/editor-3pWC96yz.js",
|
||||
"houseplan-assets/fr-DN4s45Zz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-CHF8Xp2k.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js"
|
||||
],
|
||||
"lazyGzipBytes": 234058,
|
||||
"lazyGzipBytes": 234147,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/editor-3pWC96yz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 173910,
|
||||
"lazyEditorGzipBytes": 173932,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 14235,
|
||||
"lazyOnboardingGzipBytes": 14242,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-DFeGpePx.js",
|
||||
"houseplan-assets/fr-B-xb3XPO.js"
|
||||
"houseplan-assets/de-C9t1Wvxo.js",
|
||||
"houseplan-assets/fr-DN4s45Zz.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 49089,
|
||||
"lazyLocaleGzipBytes": 49114,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"sha256": "9c2e03431acab819075bef26947d344e14315439ff46554e77b8a7c13d1f49bc",
|
||||
"path": "houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"sha256": "5b835ba23ac9ed4c5ce95d8fc85cb02d5323940841f44c799c06f10ec1cd9f2e",
|
||||
"rawBytes": 21418,
|
||||
"gzipBytes": 7280,
|
||||
"gzipBytes": 7285,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-DFeGpePx.js",
|
||||
"sha256": "98b868c66f86ff49b532cfd06fd9c3febf1a6a2fc5b82ab4cf704c8d1fdea37f",
|
||||
"path": "houseplan-assets/de-C9t1Wvxo.js",
|
||||
"sha256": "32e4807d8bf9c50e5d1b70119543133479d7b5fc1a2ef2549c398f82f3273c73",
|
||||
"rawBytes": 82182,
|
||||
"gzipBytes": 24814,
|
||||
"gzipBytes": 24827,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"sha256": "25805b82349ce1a5553ebe639abea2d8c01c7bf0de9604555f095f390f963504",
|
||||
"path": "houseplan-assets/editor-3pWC96yz.js",
|
||||
"sha256": "948a829aad31aefe970238a4f9e31946297b89ff3dd0edd6900441c994182eae",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1580,
|
||||
"gzipBytes": 1583,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-B-xb3XPO.js",
|
||||
"sha256": "fd859570cdd6bb6e35700cfd5f3ca80cf8fdeb77aaa9fb6472d6286a064d5e19",
|
||||
"path": "houseplan-assets/fr-DN4s45Zz.js",
|
||||
"sha256": "85a7ede00bc5b6db620cc2caa021a6521f00f87ea86eead81c7b1f1ba66b6dc5",
|
||||
"rawBytes": 84312,
|
||||
"gzipBytes": 24275,
|
||||
"gzipBytes": 24287,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"sha256": "5182a288cd5aafd3155b7380539576955aa1aa80c5914cecfcba48119d79d184",
|
||||
"path": "houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"sha256": "15a3eec75860b6754fe777709df6ae958f525fa0da69ff4121171fb06b5381e9",
|
||||
"rawBytes": 1048696,
|
||||
"gzipBytes": 294561,
|
||||
"gzipBytes": 294568,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-DFeGpePx.js",
|
||||
"houseplan-assets/editor-CCrJdJ9P.js",
|
||||
"houseplan-assets/fr-B-xb3XPO.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-BebiHDnX.js"
|
||||
"houseplan-assets/de-C9t1Wvxo.js",
|
||||
"houseplan-assets/editor-3pWC96yz.js",
|
||||
"houseplan-assets/fr-DN4s45Zz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js",
|
||||
"houseplan-assets/hp-zigbee-topology-overlay-CHF8Xp2k.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-BjPEC4JN.js",
|
||||
"sha256": "0132e5d538d9bd4a99efd2b8f86b6e01bf465c9be1de72a0399b114204a94189",
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-CsVJXw5p.js",
|
||||
"sha256": "d30404599d56dd5024b46a59db7a750c6bbc2802cf9692166b9640d283736076",
|
||||
"rawBytes": 608944,
|
||||
"gzipBytes": 160238,
|
||||
"gzipBytes": 160247,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js"
|
||||
"houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-zzJPsMn1.js",
|
||||
"sha256": "64f4fcf484d2e23b30c79c2a6b03c8af684da972f583151764e4957e391c1d1c",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-CnM59ais.js",
|
||||
"sha256": "4e6a2d7611f3577039c1d8deeb45d5762f9aab933947ae859daaca9d586c304c",
|
||||
"rawBytes": 28088,
|
||||
"gzipBytes": 6955,
|
||||
"gzipBytes": 6957,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-MVjPRxdI.js",
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/backdrop-pick-8khnweU_.js",
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/hp-zigbee-topology-overlay-BebiHDnX.js",
|
||||
"sha256": "ec91560c32a0fbe0af6e066a5cbde4de470ece320b6a189fcdbbb1d690477e53",
|
||||
"path": "houseplan-assets/hp-zigbee-topology-overlay-CHF8Xp2k.js",
|
||||
"sha256": "9f0e4a1c5fb61215e312cfec3b6e4c97f2a50c29dfb706c4fd39ad0f1ac6944d",
|
||||
"rawBytes": 6007,
|
||||
"gzipBytes": 2378,
|
||||
"gzipBytes": 2380,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js",
|
||||
"houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/zigbee-topology-CjJau-_w.js",
|
||||
"sha256": "44bdc047f04343477b564cdd5515860c2ac58827c78b4990d13e93aaf80d43f5",
|
||||
"path": "houseplan-assets/zigbee-topology-D_aNcMzL.js",
|
||||
"sha256": "121faba84237ce191528be53209c23c460d0148e0f3c4cf173c41a11c05bb253",
|
||||
"rawBytes": 12250,
|
||||
"gzipBytes": 4812,
|
||||
"gzipBytes": 4817,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/zigbee-topology-runtime-ne8Tm9gB.js",
|
||||
"sha256": "e09fdfac0d02509ebb3b65739eb5e148db5b328f607b6e03d6ccd03abb81d076",
|
||||
"rawBytes": 3878,
|
||||
"gzipBytes": 1726,
|
||||
"path": "houseplan-assets/zigbee-topology-runtime-BfK9eNEI.js",
|
||||
"sha256": "6c86d1c0b6640b5029e968783b01cf97f7ecf6460b2a9fe1aa76dc7605bf2ff0",
|
||||
"rawBytes": 3941,
|
||||
"gzipBytes": 1764,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js",
|
||||
"houseplan-assets/zigbee-topology-CjJau-_w.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js",
|
||||
"houseplan-assets/zigbee-topology-D_aNcMzL.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "bd8bbfbfe67ce7465845f9c52f0ab2c7678e9450cd9f238b2bb5714979f937f0",
|
||||
"sha256": "d0254ba38672cbd0d103d27d45f1ebd0ad8723586724a81c75818c6bd2fc621b",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 794,
|
||||
"gzipBytes": 797,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-DUGW724g.js"
|
||||
"houseplan-assets/houseplan-card-HZAjN4mP.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";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-DUGW724g.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__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";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-HZAjN4mP.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}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";import{l as t,aS as s,A as e,t as o,c as a,cf as l,cg as i,ch as h,ci as c,aP as n,cj as r,co as p,ck as d,cl as _,cm as u,cn as g,df as m,aO as b,aQ as $,dg as v}from"./houseplan-card-DUGW724g.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-MVjPRxdI.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";import{l as t,aS as s,A as e,t as o,c as a,cf as l,cg as i,ch as h,ci as c,aP as n,cj as r,co as p,ck as d,cl as _,cm as u,cn as g,df as m,aO as b,aQ as $,dg as v}from"./houseplan-card-HZAjN4mP.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-8khnweU_.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
.text=${o(h,l)} .ariaLabel=${o(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const o=l(e),a=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===o.fill?{...a||h,a:0}:a;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:o.showBorders,showNames:o.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:p,glowEnabled:o.glow,bgColor:o.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:o.tempMin,tempMax:o.tempMax,showLqi:o.showLqi??this.host._config?.show_signal??!0,cardFontScale:o.cardFontScale,labelTemp:o.labelTemp,labelHum:o.labelHum,labelLqi:o.labelLqi,labelLight:o.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...f(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const o=await y(e);if("reject"===o.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===o.kind)return void(this.host._backdropGuard=o.state);const a=await w(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return D(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),o=this.host._spaceDialog;return o&&o.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...o,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const o=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),a=this.host._spaceDialog,l=a?.saved?.find(s=>s.name===t);if(o&&a&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==a.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return a`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return a`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return a`<div class="savedplans">
|
||||
${s.map(s=>{return a`
|
||||
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";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-DUGW724g.js";import{a,r as h,t as d}from"./zigbee-topology-CjJau-_w.js";import{zigbeeTopologyRuntimeSnapshot as p,subscribeZigbeeTopology as c}from"./zigbee-topology-runtime-ne8Tm9gB.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__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";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-HZAjN4mP.js";import{a,r as h,t as d}from"./zigbee-topology-D_aNcMzL.js";import{zigbeeTopologyRuntimeSnapshot as p,subscribeZigbeeTopology as c}from"./zigbee-topology-runtime-BfK9eNEI.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}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";import{n as t,b as n}from"./zigbee-topology-CjJau-_w.js";import{y as e}from"./houseplan-card-DUGW724g.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 u(t){const n=i(t);return n?{revision:n.revision,topologies:n.topologies,states:n.states}:{revision:0,topologies:[],states:{}}}function l(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 u=e(o);return c(s,`z2m:${u||String(o)}`,async()=>{if(p(t),!u)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=null,l=null;const f=new Promise(t=>{c=t}),g=new Promise(t=>{l=t}),y=[];try{const r=await o.call(e,t=>{!0===d(t)?.retain&&h(t)&&c?.()},{type:"mqtt/subscribe",topic:`${u}/bridge/info`});"function"==typeof r&&y.push(r);const p=await o.call(e,t=>{if(!0===d(t)?.retain)return;const n=h(t);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&&l?.(n)},{type:"mqtt/subscribe",topic:`${u}/bridge/response/networkmap`});"function"==typeof p&&y.push(p),await m(f,Math.min(4e3,Math.max(1,s-Date.now()))),await t.callService("mqtt","publish",{topic:`${u}/bridge/request/networkmap`,payload:JSON.stringify({type:"raw",routes:!1,transaction:i}),qos:0,retain:!1});const w=await m(g,s-Date.now()),b=d(w)?.status;if(b&&"ok"!==b)throw a("provider");return n(w,u)}finally{for(const t of y)try{t()}catch{}}})}export{f as readZhaTopology,g as refreshZ2mTopology,l as subscribeZigbeeTopology,u as zigbeeTopologyRuntimeSnapshot};
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";import{n as t,b as n}from"./zigbee-topology-D_aNcMzL.js";import{y as e}from"./houseplan-card-HZAjN4mP.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 f(t){if(!0!==t?.user?.is_admin)throw a("permission")}function p(n){const e=i(n);return e?c(e,"zha",async()=>{if(f(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(f(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,p=null,g=null;const y=new Promise(t=>{u=t}),w=new Promise((t,n)=>{p=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 f=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&&p?.(n):c&&g?.(a("invalid_payload"))},{type:"mqtt/subscribe",topic:`${l}/bridge/response/networkmap`});"function"==typeof f&&b.push(f),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{p as readZhaTopology,g as refreshZ2mTopology,u as subscribeZigbeeTopology,l as zigbeeTopologyRuntimeSnapshot};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="d4bbc03b3b6fe5e661d2b8bb8d6831e9cccfae5d526d96a3d87c624189f96a3e";try{await import("./houseplan-assets/houseplan-card-DUGW724g.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__="d5c9512472f656b31f81d4cdf480e7be29c083c8faaa1034548ebd88118f8c57";try{await import("./houseplan-assets/houseplan-card-HZAjN4mP.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)}
|
||||
|
||||
@@ -5640,6 +5640,17 @@ const MUTANT_DEFINITIONS = [
|
||||
replace: ' if (value) responseResolve?.(value);',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'zigbee-topology-z2m-malformed-response-waits-for-timeout',
|
||||
guard: 'node --test --test-name-pattern="malformed response immediately" test/zigbee-topology.test.mjs',
|
||||
because: 'a malformed response on the subscribed network-map topic must report invalid payload '
|
||||
+ 'immediately instead of leaving the settings dialog loading for the full timeout (#54 AC16)',
|
||||
patches: [{
|
||||
file: 'src/zigbee-topology-runtime.ts',
|
||||
find: " if (value === null) {\n if (responseActive) responseReject?.(fail('invalid_payload'));\n return;\n }",
|
||||
replace: ' if (value === null) return;',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'zigbee-topology-z2m-subscriptions-leak',
|
||||
guard: 'node --test test/zigbee-topology.test.mjs',
|
||||
|
||||
@@ -198,10 +198,15 @@ export function refreshZ2mTopology(
|
||||
if (typeof subscribe !== 'function' || typeof hass?.callService !== 'function') throw fail('unsupported');
|
||||
const transaction = randomTransaction();
|
||||
const deadline = Date.now() + Math.max(1, timeoutMs);
|
||||
let responseActive = false;
|
||||
let infoResolve: (() => void) | null = null;
|
||||
let responseResolve: ((value: unknown) => void) | null = null;
|
||||
let responseReject: ((reason?: unknown) => void) | null = null;
|
||||
const info = new Promise<void>((resolve) => { infoResolve = resolve; });
|
||||
const response = new Promise<unknown>((resolve) => { responseResolve = resolve; });
|
||||
const response = new Promise<unknown>((resolve, reject) => {
|
||||
responseResolve = resolve;
|
||||
responseReject = reject;
|
||||
});
|
||||
const unsubscribers: Array<() => void> = [];
|
||||
try {
|
||||
const unsubInfo = await subscribe.call(connection, (message: unknown) => {
|
||||
@@ -211,10 +216,15 @@ export function refreshZ2mTopology(
|
||||
const unsubResponse = await subscribe.call(connection, (message: unknown) => {
|
||||
if (recordOf(message)?.retain === true) return;
|
||||
const value = parseMessage(message);
|
||||
if (value === null) {
|
||||
if (responseActive) responseReject?.(fail('invalid_payload'));
|
||||
return;
|
||||
}
|
||||
if (value && transactionOf(value) === transaction) responseResolve?.(value);
|
||||
}, { type: 'mqtt/subscribe', topic: `${topic}/bridge/response/networkmap` });
|
||||
if (typeof unsubResponse === 'function') unsubscribers.push(unsubResponse);
|
||||
await withTimeout(info, Math.min(4000, Math.max(1, deadline - Date.now())));
|
||||
responseActive = true;
|
||||
await hass.callService('mqtt', 'publish', {
|
||||
topic: `${topic}/bridge/request/networkmap`,
|
||||
payload: JSON.stringify({ type: 'raw', routes: false, transaction }),
|
||||
|
||||
@@ -144,6 +144,9 @@ test('Z2M runtime verifies retained bridge info, correlates transaction and clea
|
||||
async subscribeMessage(callback, message) {
|
||||
listeners.set(message.topic, callback);
|
||||
if (message.topic.endsWith('/bridge/info')) queueMicrotask(() => callback({ retain: true, payload: '{}' }));
|
||||
if (message.topic.endsWith('/bridge/response/networkmap')) {
|
||||
queueMicrotask(() => callback({ retain: false, payload: 'stale-not-json' }));
|
||||
}
|
||||
return () => { cleanups++; listeners.delete(message.topic); };
|
||||
},
|
||||
},
|
||||
@@ -169,6 +172,31 @@ test('Z2M runtime verifies retained bridge info, correlates transaction and clea
|
||||
assert.equal(zigbeeTopologyRuntimeSnapshot(hass).states['z2m:zigbee2mqtt'].phase, 'ready');
|
||||
});
|
||||
|
||||
test('Z2M runtime rejects a malformed response immediately instead of timing out', async () => {
|
||||
const listeners = new Map();
|
||||
let cleanups = 0;
|
||||
const hass = {
|
||||
user: { is_admin: true },
|
||||
connection: {
|
||||
async subscribeMessage(callback, message) {
|
||||
listeners.set(message.topic, callback);
|
||||
if (message.topic.endsWith('/bridge/info')) queueMicrotask(() => callback({ retain: true, payload: '{}' }));
|
||||
return () => { cleanups++; listeners.delete(message.topic); };
|
||||
},
|
||||
},
|
||||
async callService() {
|
||||
queueMicrotask(() => listeners.get('zigbee2mqtt/bridge/response/networkmap')?.({
|
||||
retain: false, payload: 'not-json-garbage',
|
||||
}));
|
||||
},
|
||||
};
|
||||
const startedAt = performance.now();
|
||||
await refreshZ2mTopology(hass, 'zigbee2mqtt', 500);
|
||||
assert.ok(performance.now() - startedAt < 250, 'malformed response must not wait for the timeout');
|
||||
assert.equal(cleanups, 2);
|
||||
assert.equal(zigbeeTopologyRuntimeSnapshot(hass).states['z2m:zigbee2mqtt'].error, 'invalid_payload');
|
||||
});
|
||||
|
||||
test('Z2M runtime refuses an unconfirmed base topic without publishing and still cleans up', async () => {
|
||||
let publishes = 0;
|
||||
let cleanups = 0;
|
||||
|
||||
Reference in New Issue
Block a user