fix: close CODE-REVIEW-44-r1 M1-M2

M1: the room-climate cache keys on the STORED exclusion array reference
(stable across renders; _excluded builds a fresh Set per call), so
saving new Discovery filters recomputes climate immediately instead of
waiting for an unrelated hass tick.
M2: a device without a platform-bearing entity takes its integration
name from the identifier domain — the excluded reason can no longer
render a raw {integration} placeholder (if the exclusion matched,
at least one of the two names exists).

User-Visible: no
Issue: #44
This commit is contained in:
Codex
2026-08-30 14:29:19 +03:00
parent 34778d81e4
commit e4e1e3705f
22 changed files with 167 additions and 153 deletions
@@ -1,125 +1,125 @@
{ {
"schema": 1, "schema": 1,
"fingerprint": "6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4", "fingerprint": "88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b",
"entry": "houseplan-card.js", "entry": "houseplan-card.js",
"initialViewFiles": [ "initialViewFiles": [
"houseplan-assets/houseplan-card-1DeOYsuL.js", "houseplan-assets/houseplan-card-DR7nMAa_.js",
"houseplan-card.js" "houseplan-card.js"
], ],
"initialViewGzipBytes": 279517, "initialViewGzipBytes": 279542,
"lazyFiles": [ "lazyFiles": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/de-Bi_JHQVF.js", "houseplan-assets/de-B-stL9mL.js",
"houseplan-assets/editor-Do2Ho-IL.js", "houseplan-assets/editor-Cm8lkf2a.js",
"houseplan-assets/fr-Dr8Ukd6i.js", "houseplan-assets/fr-DosWl8Ak.js",
"houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js", "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js",
"houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js" "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js"
], ],
"lazyGzipBytes": 194625, "lazyGzipBytes": 194653,
"lazyEditorFiles": [ "lazyEditorFiles": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/editor-Do2Ho-IL.js", "houseplan-assets/editor-Cm8lkf2a.js",
"houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js" "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js"
], ],
"lazyEditorGzipBytes": 142246, "lazyEditorGzipBytes": 142267,
"lazyOnboardingFiles": [ "lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js" "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js"
], ],
"lazyOnboardingGzipBytes": 9447, "lazyOnboardingGzipBytes": 9449,
"lazyLocaleFiles": [ "lazyLocaleFiles": [
"houseplan-assets/de-Bi_JHQVF.js", "houseplan-assets/de-B-stL9mL.js",
"houseplan-assets/fr-Dr8Ukd6i.js" "houseplan-assets/fr-DosWl8Ak.js"
], ],
"lazyLocaleGzipBytes": 45885, "lazyLocaleGzipBytes": 45891,
"files": [ "files": [
{ {
"path": "houseplan-assets/backdrop-pick-_T3tJ8H9.js", "path": "houseplan-assets/backdrop-pick-CY3bq28R.js",
"sha256": "40016f66fccc6eb024573c32b45d72dde988cbaeba0340230ea0a93968a1e706", "sha256": "24aafff95b20171ff57a13ca7e82e885443d1a9a0676c0075e957c3028656b50",
"rawBytes": 6967, "rawBytes": 6967,
"gzipBytes": 2953, "gzipBytes": 2954,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/de-Bi_JHQVF.js", "path": "houseplan-assets/de-B-stL9mL.js",
"sha256": "cca25f5cc5df0ebae4f3068f5019d7b1c8caa993bf724223706272ca7ab9e416", "sha256": "16bd18e83158ca3d35ea4132a9300039d1c8d6bc7642a95115ddf1dba6265ede",
"rawBytes": 76237, "rawBytes": 76237,
"gzipBytes": 23175, "gzipBytes": 23178,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/editor-Do2Ho-IL.js", "path": "houseplan-assets/editor-Cm8lkf2a.js",
"sha256": "513f821bad0285d88e06a89e842ab4e27fd843b4d47cce6d70b63b7c5a0eaa45", "sha256": "d38328e9559875eb4ba650e7f939cb81e4d9e93b70eafcc4b2348693344afdc7",
"rawBytes": 3831, "rawBytes": 3831,
"gzipBytes": 1581, "gzipBytes": 1583,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/fr-Dr8Ukd6i.js", "path": "houseplan-assets/fr-DosWl8Ak.js",
"sha256": "12bb2d9bfe8581f12a0c3edafcd01999f77f38d1cf74ec3ecce607087626fdcb", "sha256": "b795363b2ada632fd7f79798152b9b4586f3310641ab7de7789dfac8d31eab70",
"rawBytes": 78415, "rawBytes": 78415,
"gzipBytes": 22710, "gzipBytes": 22713,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/houseplan-card-1DeOYsuL.js", "path": "houseplan-assets/houseplan-card-DR7nMAa_.js",
"sha256": "a6e67a50d5a76a8d892306ac8ff9983a8669df3a8cce4b0fe0d614317c99fa77", "sha256": "73bb53ca51571acec2596bee21c05698d86455b05ab351767f0b76f19ccb76ab",
"rawBytes": 985780, "rawBytes": 985833,
"gzipBytes": 278722, "gzipBytes": 278747,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/de-Bi_JHQVF.js", "houseplan-assets/de-B-stL9mL.js",
"houseplan-assets/editor-Do2Ho-IL.js", "houseplan-assets/editor-Cm8lkf2a.js",
"houseplan-assets/fr-Dr8Ukd6i.js", "houseplan-assets/fr-DosWl8Ak.js",
"houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js", "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js",
"houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js" "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js"
] ]
}, },
{ {
"path": "houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js", "path": "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js",
"sha256": "cd33e739519f7ebb442669ffb3f4f8769ed103f8c4632fec65e61838c88911c7", "sha256": "8b1d48fe0e941891caec619fd8cd4b6f71b628466c7733190cdbcc7544d85ac0",
"rawBytes": 535345, "rawBytes": 535370,
"gzipBytes": 137712, "gzipBytes": 137730,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js", "path": "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js",
"sha256": "69836ad15bd6ea53ded4be778e78ae8d62e3ea4f0f103e310d0c7b0d2e423698", "sha256": "8df13ba33ec7e1e83eb054ea8b66a25456e384d4a5e0be57f470241fb6f55fbc",
"rawBytes": 26195, "rawBytes": 26195,
"gzipBytes": 6494, "gzipBytes": 6495,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-card.js", "path": "houseplan-card.js",
"sha256": "813b0936d57623e31386df8ca3a19e793315e1f197171a3f436649bcbe6d14be", "sha256": "12e0e5704282fe9af4546c9f3b6a8ee697b87747ad8425d6e8e4b8340cb3df9a",
"rawBytes": 1183, "rawBytes": 1183,
"gzipBytes": 795, "gzipBytes": 795,
"isEntry": true, "isEntry": true,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
} }
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";import{c as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,b as c}from"./houseplan-card-1DeOYsuL.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 n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{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 n();if("warm"===e)return r;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")},_=this._schema,f=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__="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";import{c as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,b as c}from"./houseplan-card-DR7nMAa_.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 n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{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 n();if("warm"===e)return r;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")},_=this._schema,f=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} .hass=${this.hass}
.data=${this._formData} .data=${this._formData}
.schema=${e} .schema=${e}
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";import{bX as t,bY as s,bZ as e,b_ as o,aq as a,b$ as l,c4 as i,c0 as h,c1 as c,c2 as n,c3 as r,A as p,b as _,cZ as d,ap as u,ar as g,c_ as m}from"./houseplan-card-1DeOYsuL.js";import{i as b,c as $,e as v,r as y,a as f,b as w,s as D,t as S}from"./backdrop-pick-_T3tJ8H9.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";class F{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:n,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,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 $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return y(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans"> globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";import{bX as t,bY as s,bZ as e,b_ as o,aq as a,b$ as l,c4 as i,c0 as h,c1 as c,c2 as n,c3 as r,A as p,b as _,cZ as d,ap as u,ar as g,c_ as m}from"./houseplan-card-DR7nMAa_.js";import{i as b,c as $,e as v,r as y,a as f,b as w,s as D,t as S}from"./backdrop-pick-CY3bq28R.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";class F{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:n,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,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 $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return y(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans">
${s.map(s=>{return _` ${s.map(s=>{return _`
<div class="savedplan ${s.url===t.planUrl?"cur":""}"> <div class="savedplan ${s.url===t.planUrl?"cur":""}">
<img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" /> <img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" />
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";try{await import("./houseplan-assets/houseplan-card-1DeOYsuL.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__="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";try{await import("./houseplan-assets/houseplan-card-DR7nMAa_.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)}
+56 -56
View File
@@ -1,125 +1,125 @@
{ {
"schema": 1, "schema": 1,
"fingerprint": "6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4", "fingerprint": "88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b",
"entry": "houseplan-card.js", "entry": "houseplan-card.js",
"initialViewFiles": [ "initialViewFiles": [
"houseplan-assets/houseplan-card-1DeOYsuL.js", "houseplan-assets/houseplan-card-DR7nMAa_.js",
"houseplan-card.js" "houseplan-card.js"
], ],
"initialViewGzipBytes": 279517, "initialViewGzipBytes": 279542,
"lazyFiles": [ "lazyFiles": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/de-Bi_JHQVF.js", "houseplan-assets/de-B-stL9mL.js",
"houseplan-assets/editor-Do2Ho-IL.js", "houseplan-assets/editor-Cm8lkf2a.js",
"houseplan-assets/fr-Dr8Ukd6i.js", "houseplan-assets/fr-DosWl8Ak.js",
"houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js", "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js",
"houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js" "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js"
], ],
"lazyGzipBytes": 194625, "lazyGzipBytes": 194653,
"lazyEditorFiles": [ "lazyEditorFiles": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/editor-Do2Ho-IL.js", "houseplan-assets/editor-Cm8lkf2a.js",
"houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js" "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js"
], ],
"lazyEditorGzipBytes": 142246, "lazyEditorGzipBytes": 142267,
"lazyOnboardingFiles": [ "lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js" "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js"
], ],
"lazyOnboardingGzipBytes": 9447, "lazyOnboardingGzipBytes": 9449,
"lazyLocaleFiles": [ "lazyLocaleFiles": [
"houseplan-assets/de-Bi_JHQVF.js", "houseplan-assets/de-B-stL9mL.js",
"houseplan-assets/fr-Dr8Ukd6i.js" "houseplan-assets/fr-DosWl8Ak.js"
], ],
"lazyLocaleGzipBytes": 45885, "lazyLocaleGzipBytes": 45891,
"files": [ "files": [
{ {
"path": "houseplan-assets/backdrop-pick-_T3tJ8H9.js", "path": "houseplan-assets/backdrop-pick-CY3bq28R.js",
"sha256": "40016f66fccc6eb024573c32b45d72dde988cbaeba0340230ea0a93968a1e706", "sha256": "24aafff95b20171ff57a13ca7e82e885443d1a9a0676c0075e957c3028656b50",
"rawBytes": 6967, "rawBytes": 6967,
"gzipBytes": 2953, "gzipBytes": 2954,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/de-Bi_JHQVF.js", "path": "houseplan-assets/de-B-stL9mL.js",
"sha256": "cca25f5cc5df0ebae4f3068f5019d7b1c8caa993bf724223706272ca7ab9e416", "sha256": "16bd18e83158ca3d35ea4132a9300039d1c8d6bc7642a95115ddf1dba6265ede",
"rawBytes": 76237, "rawBytes": 76237,
"gzipBytes": 23175, "gzipBytes": 23178,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/editor-Do2Ho-IL.js", "path": "houseplan-assets/editor-Cm8lkf2a.js",
"sha256": "513f821bad0285d88e06a89e842ab4e27fd843b4d47cce6d70b63b7c5a0eaa45", "sha256": "d38328e9559875eb4ba650e7f939cb81e4d9e93b70eafcc4b2348693344afdc7",
"rawBytes": 3831, "rawBytes": 3831,
"gzipBytes": 1581, "gzipBytes": 1583,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/fr-Dr8Ukd6i.js", "path": "houseplan-assets/fr-DosWl8Ak.js",
"sha256": "12bb2d9bfe8581f12a0c3edafcd01999f77f38d1cf74ec3ecce607087626fdcb", "sha256": "b795363b2ada632fd7f79798152b9b4586f3310641ab7de7789dfac8d31eab70",
"rawBytes": 78415, "rawBytes": 78415,
"gzipBytes": 22710, "gzipBytes": 22713,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/houseplan-card-1DeOYsuL.js", "path": "houseplan-assets/houseplan-card-DR7nMAa_.js",
"sha256": "a6e67a50d5a76a8d892306ac8ff9983a8669df3a8cce4b0fe0d614317c99fa77", "sha256": "73bb53ca51571acec2596bee21c05698d86455b05ab351767f0b76f19ccb76ab",
"rawBytes": 985780, "rawBytes": 985833,
"gzipBytes": 278722, "gzipBytes": 278747,
"isEntry": false, "isEntry": false,
"imports": [], "imports": [],
"dynamicImports": [ "dynamicImports": [
"houseplan-assets/de-Bi_JHQVF.js", "houseplan-assets/de-B-stL9mL.js",
"houseplan-assets/editor-Do2Ho-IL.js", "houseplan-assets/editor-Cm8lkf2a.js",
"houseplan-assets/fr-Dr8Ukd6i.js", "houseplan-assets/fr-DosWl8Ak.js",
"houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js", "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js",
"houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js" "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js"
] ]
}, },
{ {
"path": "houseplan-assets/houseplan-editor-runtime-DIDvlNH4.js", "path": "houseplan-assets/houseplan-editor-runtime-CBk6MgZ-.js",
"sha256": "cd33e739519f7ebb442669ffb3f4f8769ed103f8c4632fec65e61838c88911c7", "sha256": "8b1d48fe0e941891caec619fd8cd4b6f71b628466c7733190cdbcc7544d85ac0",
"rawBytes": 535345, "rawBytes": 535370,
"gzipBytes": 137712, "gzipBytes": 137730,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-assets/houseplan-onboarding-runtime-Brmu1Azl.js", "path": "houseplan-assets/houseplan-onboarding-runtime-CWRuFlaF.js",
"sha256": "69836ad15bd6ea53ded4be778e78ae8d62e3ea4f0f103e310d0c7b0d2e423698", "sha256": "8df13ba33ec7e1e83eb054ea8b66a25456e384d4a5e0be57f470241fb6f55fbc",
"rawBytes": 26195, "rawBytes": 26195,
"gzipBytes": 6494, "gzipBytes": 6495,
"isEntry": false, "isEntry": false,
"imports": [ "imports": [
"houseplan-assets/backdrop-pick-_T3tJ8H9.js", "houseplan-assets/backdrop-pick-CY3bq28R.js",
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "dynamicImports": []
}, },
{ {
"path": "houseplan-card.js", "path": "houseplan-card.js",
"sha256": "813b0936d57623e31386df8ca3a19e793315e1f197171a3f436649bcbe6d14be", "sha256": "12e0e5704282fe9af4546c9f3b6a8ee697b87747ad8425d6e8e4b8340cb3df9a",
"rawBytes": 1183, "rawBytes": 1183,
"gzipBytes": 795, "gzipBytes": 795,
"isEntry": true, "isEntry": true,
"imports": [ "imports": [
"houseplan-assets/houseplan-card-1DeOYsuL.js" "houseplan-assets/houseplan-card-DR7nMAa_.js"
], ],
"dynamicImports": [] "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__="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";import{c as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,b as c}from"./houseplan-card-1DeOYsuL.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 n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{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 n();if("warm"===e)return r;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")},_=this._schema,f=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__="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";import{c as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,b as c}from"./houseplan-card-DR7nMAa_.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 n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{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 n();if("warm"===e)return r;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")},_=this._schema,f=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} .hass=${this.hass}
.data=${this._formData} .data=${this._formData}
.schema=${e} .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__="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";import{bX as t,bY as s,bZ as e,b_ as o,aq as a,b$ as l,c4 as i,c0 as h,c1 as c,c2 as n,c3 as r,A as p,b as _,cZ as d,ap as u,ar as g,c_ as m}from"./houseplan-card-1DeOYsuL.js";import{i as b,c as $,e as v,r as y,a as f,b as w,s as D,t as S}from"./backdrop-pick-_T3tJ8H9.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";class F{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:n,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,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 $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return y(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans"> globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";import{bX as t,bY as s,bZ as e,b_ as o,aq as a,b$ as l,c4 as i,c0 as h,c1 as c,c2 as n,c3 as r,A as p,b as _,cZ as d,ap as u,ar as g,c_ as m}from"./houseplan-card-DR7nMAa_.js";import{i as b,c as $,e as v,r as y,a as f,b as w,s as D,t as S}from"./backdrop-pick-CY3bq28R.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";class F{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:n,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,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 $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return y(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans">
${s.map(s=>{return _` ${s.map(s=>{return _`
<div class="savedplan ${s.url===t.planUrl?"cur":""}"> <div class="savedplan ${s.url===t.planUrl?"cur":""}">
<img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" /> <img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" />
+1 -1
View File
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="6f7b71e68505c64c76cdebce5760e009ea6ec2a15455ae323494ccdde728e3b4";try{await import("./houseplan-assets/houseplan-card-1DeOYsuL.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__="88a6e19b99c65848b1132de49a50a7d9214b7d4c077dbd83e9cbda0c21b27d3b";try{await import("./houseplan-assets/houseplan-card-DR7nMAa_.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)}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 KiB

After

Width:  |  Height:  |  Size: 317 KiB

+12 -12
View File
@@ -3,7 +3,7 @@
"fixture": "synthetic-only", "fixture": "synthetic-only",
"chromium": "151.0.7922.34", "chromium": "151.0.7922.34",
"oxipng": null, "oxipng": null,
"sourceFingerprint": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceFingerprint": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"captureScriptSha256": "fe76c8e2e27501e9a377d7aa15dd6cba6a018d55c07deb602dbee097f0a0a5ba", "captureScriptSha256": "fe76c8e2e27501e9a377d7aa15dd6cba6a018d55c07deb602dbee097f0a0a5ba",
"command": "npm run build && node demo/docs/capture.mjs", "command": "npm run build && node demo/docs/capture.mjs",
"scenarios": { "scenarios": {
@@ -15,7 +15,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "0ca982495a7749907c48ebbddfd089c54385a4347f79f64e94af2c5a8d5c03eb" "imageSha256": "0ca982495a7749907c48ebbddfd089c54385a4347f79f64e94af2c5a8d5c03eb"
}, },
"view-touch": { "view-touch": {
@@ -26,7 +26,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "3be239a5a494f6776540a9c0049694ee6f9d2ba927c8bcb4b26ee5a69a228a7d" "imageSha256": "3be239a5a494f6776540a9c0049694ee6f9d2ba927c8bcb4b26ee5a69a228a7d"
}, },
"space-create": { "space-create": {
@@ -37,7 +37,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "a55b463055a565892ca139014e314a8f63fb5301c87fff2e48d7e69210fe9b6c" "imageSha256": "a55b463055a565892ca139014e314a8f63fb5301c87fff2e48d7e69210fe9b6c"
}, },
"room-contour-close": { "room-contour-close": {
@@ -48,7 +48,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "dfad9a27371cfa397a3fd8dce7005f42d24649743f5322105ee894067d3a9f16" "imageSha256": "dfad9a27371cfa397a3fd8dce7005f42d24649743f5322105ee894067d3a9f16"
}, },
"plan-context-tray": { "plan-context-tray": {
@@ -59,7 +59,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "b75f348c632296da5c2fc142d53df613f757e1516acac315be50f5b4557729cc" "imageSha256": "b75f348c632296da5c2fc142d53df613f757e1516acac315be50f5b4557729cc"
}, },
"device-editor": { "device-editor": {
@@ -70,8 +70,8 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "6b9cd281450e7782cff292f11efc58d227bedd0df86afc3be987feb2edec9dc3" "imageSha256": "8affadfce926fe2f6cf344c33f611c44fcbc79c1969f69c3a6935ff2e99c36c3"
}, },
"device-display-preview": { "device-display-preview": {
"file": "06-device-display-preview.png", "file": "06-device-display-preview.png",
@@ -81,7 +81,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "6f628abe6b89d7c4b352e6d73ac0b126526f6fdba5927bb774c5b884e484ca19" "imageSha256": "6f628abe6b89d7c4b352e6d73ac0b126526f6fdba5927bb774c5b884e484ca19"
}, },
"background-editor": { "background-editor": {
@@ -92,7 +92,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "ed041f571b0c34f1e06b13419ea08d90ebb7c26950f631d46f6cebb9a29f5c20" "imageSha256": "ed041f571b0c34f1e06b13419ea08d90ebb7c26950f631d46f6cebb9a29f5c20"
}, },
"room-card": { "room-card": {
@@ -103,7 +103,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "48a5685039a5e0de2a28190d857b193c86e2e63606e3c7a8c40fc9d2b190da4e" "imageSha256": "48a5685039a5e0de2a28190d857b193c86e2e63606e3c7a8c40fc9d2b190da4e"
}, },
"device-info": { "device-info": {
@@ -114,7 +114,7 @@
}, },
"theme": "dark", "theme": "dark",
"language": "en", "language": "en",
"sourceSha256": "64bd1675ca6c8672dfedcd88d8397cead0c11e3d3d18d3880a22c53208e1b661", "sourceSha256": "443e9bf46714a4fbb37dcee97568865740927c67c119e85e5caf044c15e23feb",
"imageSha256": "29a342811aaedaebc54ba337792d60cb454a7cf4c3063b210f6c4bafe0a4d87b" "imageSha256": "29a342811aaedaebc54ba337792d60cb454a7cf4c3063b210f6c4bafe0a4d87b"
} }
} }
+11 -3
View File
@@ -11849,7 +11849,9 @@ export class HouseplanCard extends LitElement {
return key ? this._climate().get(key)?.hum ?? null : null; return key ? this._climate().get(key)?.hum ?? null : null;
} }
private _climateCache: { h: any; r: any; mk: any; m: Map<string, AreaClimate> } | null = null; private _climateCache: {
h: any; r: any; mk: any; ex: string[] | undefined; m: Map<string, AreaClimate>;
} | null = null;
/** /**
* Climate for every HA Area and explicitly placed local room, computed ONCE * Climate for every HA Area and explicitly placed local room, computed ONCE
@@ -11865,9 +11867,15 @@ export class HouseplanCard extends LitElement {
const mk = this._serverCfg?.markers; const mk = this._serverCfg?.markers;
const planHass = this._renderPlanHass; const planHass = this._renderPlanHass;
const c = this._climateCache; const c = this._climateCache;
if (c && c.h === planHass && c.r === this._iconRules && c.mk === mk) return c.m; // #44 r1-M1: the exclusion list is part of the key — saving new Discovery
// filters replaces the settings object, and room climate must follow the
// new exclusions immediately, not on the next unrelated hass tick. The
// STORED array reference is the key (stable across renders); _excluded
// itself builds a fresh Set per call when a list is present.
const ex = this._settings.exclude_integrations;
if (c && c.h === planHass && c.r === this._iconRules && c.mk === mk && c.ex === ex) return c.m;
const m = roomClimateMap(planHass, this._iconRules, mk, this._excluded); const m = roomClimateMap(planHass, this._iconRules, mk, this._excluded);
this._climateCache = { h: planHass, r: this._iconRules, mk, m }; this._climateCache = { h: planHass, r: this._iconRules, mk, ex, m };
return m; return m;
} }
+6
View File
@@ -7637,6 +7637,12 @@ public _deviceInboxRows(): DeviceInboxRow[] {
const platforms = devicePlatforms.get(deviceId) || new Set<string>(); const platforms = devicePlatforms.get(deviceId) || new Set<string>();
const identifierDomain = Array.isArray(device?.identifiers?.[0]) const identifierDomain = Array.isArray(device?.identifiers?.[0])
? String(device.identifiers[0][0] || '') : ''; ? String(device.identifiers[0][0] || '') : '';
// #44 r1-M2: a device without a single platform-bearing entity still has
// an integration name — its identifier domain. Without this fallback the
// reason text would render the raw {integration} placeholder.
if (identifierDomain && !integrationByBinding[binding]) {
integrationByBinding[binding] = identifierDomain;
}
const excluded = [identifierDomain, ...platforms].some((domain) => this.host._excluded.has(domain)); const excluded = [identifierDomain, ...platforms].some((domain) => this.host._excluded.has(domain));
if (device?.entry_type === 'service') reasonByBinding[binding] = 'service_entry'; if (device?.entry_type === 'service') reasonByBinding[binding] = 'service_entry';
else if (excluded) reasonByBinding[binding] = 'excluded_integration'; else if (excluded) reasonByBinding[binding] = 'excluded_integration';