test: settle animated camera checks

Wait for camera transitions in legacy smoke and golden scenarios, and render the far-object hint state even when fitting is a camera no-op.

Issue: #82
User-Visible: no
This commit is contained in:
Matysh
2026-08-30 16:11:35 +00:00
committed by claude[bot]
parent ac625833f2
commit 6379334b21
23 changed files with 180 additions and 142 deletions
@@ -1,125 +1,125 @@
{
"schema": 1,
"fingerprint": "f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7",
"fingerprint": "099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347",
"entry": "houseplan-card.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-CBWTStJK.js",
"houseplan-assets/houseplan-card-DzlQl4_k.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 283088,
"initialViewGzipBytes": 283094,
"lazyFiles": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/de-oZrkEqX6.js",
"houseplan-assets/editor--mflqGUR.js",
"houseplan-assets/fr-DfONpvOM.js",
"houseplan-assets/houseplan-editor-runtime-By0nbxeL.js",
"houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/de-Dq2fGpol.js",
"houseplan-assets/editor-DrQ9S89m.js",
"houseplan-assets/fr-Bq4OMxB4.js",
"houseplan-assets/houseplan-editor-runtime-C6fRvS15.js",
"houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js"
],
"lazyGzipBytes": 197604,
"lazyGzipBytes": 197612,
"lazyEditorFiles": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/editor--mflqGUR.js",
"houseplan-assets/houseplan-editor-runtime-By0nbxeL.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/editor-DrQ9S89m.js",
"houseplan-assets/houseplan-editor-runtime-C6fRvS15.js"
],
"lazyEditorGzipBytes": 143900,
"lazyEditorGzipBytes": 143897,
"lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js"
],
"lazyOnboardingGzipBytes": 13789,
"lazyLocaleFiles": [
"houseplan-assets/de-oZrkEqX6.js",
"houseplan-assets/fr-DfONpvOM.js"
"houseplan-assets/de-Dq2fGpol.js",
"houseplan-assets/fr-Bq4OMxB4.js"
],
"lazyLocaleGzipBytes": 46986,
"lazyLocaleGzipBytes": 46997,
"files": [
{
"path": "houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"sha256": "5331740c6e13db3e93870fc4b2d3f098ea327417cdab7eb0800cbf3215834b92",
"path": "houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"sha256": "383eea583e6ee787be10c7766420bbff1738f466827bcada4dbb2fbf1de24505",
"rawBytes": 20636,
"gzipBytes": 7071,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/de-oZrkEqX6.js",
"sha256": "6184f30f2a77335edf045179e42c7ee285995670b143c9b3f9a9ab50c2955746",
"path": "houseplan-assets/de-Dq2fGpol.js",
"sha256": "17cca86ed13e257b06567609834707e975e9dacb38e495208a5bceedf4e7da8f",
"rawBytes": 78310,
"gzipBytes": 23715,
"gzipBytes": 23721,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor--mflqGUR.js",
"sha256": "86e469e66557c2aff1c7e3cff65cf7a21bd8ed5e24a6749f1eaa0a050566beff",
"path": "houseplan-assets/editor-DrQ9S89m.js",
"sha256": "0b137accab6d6ed51f44aed3d4d2b1ff444b5307ac9c11ff0cb9535cfd25bb2c",
"rawBytes": 3826,
"gzipBytes": 1581,
"gzipBytes": 1582,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/fr-DfONpvOM.js",
"sha256": "e797479f529a3b301db1b612010958789ab58fcdfe1bfbeeed8856a3cbb32255",
"path": "houseplan-assets/fr-Bq4OMxB4.js",
"sha256": "da0d137d42243e36315ed6ad73197210ea12cf672cf14eb7cb6320594c9aec56",
"rawBytes": 80482,
"gzipBytes": 23271,
"gzipBytes": 23276,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-CBWTStJK.js",
"sha256": "2d137f17eeb1a7bcdb1846edc3e5f36e7ebe7d689c7b07b22a51f7c12f13e02a",
"rawBytes": 1001304,
"gzipBytes": 282292,
"path": "houseplan-assets/houseplan-card-DzlQl4_k.js",
"sha256": "ac14483abe54719e12506df7eef1f26f4fd570c92600ea781159e445249ecca9",
"rawBytes": 1001346,
"gzipBytes": 282298,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-oZrkEqX6.js",
"houseplan-assets/editor--mflqGUR.js",
"houseplan-assets/fr-DfONpvOM.js",
"houseplan-assets/houseplan-editor-runtime-By0nbxeL.js",
"houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js"
"houseplan-assets/de-Dq2fGpol.js",
"houseplan-assets/editor-DrQ9S89m.js",
"houseplan-assets/fr-Bq4OMxB4.js",
"houseplan-assets/houseplan-editor-runtime-C6fRvS15.js",
"houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-By0nbxeL.js",
"sha256": "c316d389463599c5230c92af641cd6b413d8b34074ed2101d9232157c234c336",
"path": "houseplan-assets/houseplan-editor-runtime-C6fRvS15.js",
"sha256": "aeef2fb0c3cec33286d9aee59488c69713483da5e93d5a47b28b67e5637354e6",
"rawBytes": 524015,
"gzipBytes": 135248,
"gzipBytes": 135244,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js",
"sha256": "e1184e7c0bfd79eb07573bda18c348d98c618a674f05653553c955a14dcc6370",
"path": "houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js",
"sha256": "d7aba6728494fdc25e17a614eba3e91bb8132ee8248d8970fe6030565ec8c36b",
"rawBytes": 27120,
"gzipBytes": 6718,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "819076ed93c5615271a579b4713b4d346c99f8ad168c063bd4b3904cac3f5626",
"sha256": "2bdf546fd8a2b8fe97577f166d3dd1720dc7777201accb899856e1ea3e96c14d",
"rawBytes": 1183,
"gzipBytes": 796,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
}
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";import{b as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,c}from"./houseplan-card-CBWTStJK.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")},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__="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";import{b as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,c}from"./houseplan-card-DzlQl4_k.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")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
.hass=${this.hass}
.data=${this._formData}
.schema=${e}
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";import{l as t,ar as s,A as e,t as o,c as a,bV as l,bW as i,bX as h,bY as c,ao as n,bZ as p,c2 as r,b_ as _,b$ as d,c0 as u,c1 as g,cX as m,an as b,ap as $,cY as v}from"./houseplan-card-CBWTStJK.js";import{i as f,c as y,e as w,r as D,a as S,b as k,s as C,t as M}from"./backdrop-pick-Do7LQiRQ.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";class I{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__="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";import{l as t,ar as s,A as e,t as o,c as a,bV as l,bW as i,bX as h,bY as c,ao as n,bZ as p,c2 as r,b_ as _,b$ as d,c0 as u,c1 as g,cX as m,an as b,ap as $,cY as v}from"./houseplan-card-DzlQl4_k.js";import{i as f,c as y,e as w,r as D,a as S,b as k,s as C,t as M}from"./backdrop-pick-CJ3kZCi2.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";class I{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,r="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:p(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:r,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=r(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:d,tempMax:_,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){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 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 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";try{await import("./houseplan-assets/houseplan-card-CBWTStJK.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__="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";try{await import("./houseplan-assets/houseplan-card-DzlQl4_k.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)}
+8 -1
View File
@@ -742,6 +742,11 @@ export async function prepareGoldenScenario(page, scenario) {
await card.updateComplete;
await frame();
};
const settleCamera = async (card) => {
await until(() => !card._cameraTransition?.active, 1500);
await card.updateComplete;
await frame();
};
window.__goldenCard?.remove?.();
window.__goldenEditor?.remove?.();
window.__card?.remove?.();
@@ -1711,7 +1716,9 @@ export async function prepareGoldenScenario(page, scenario) {
}
}
await document.fonts?.ready;
await frame();
// Camera motion is intentionally visible in production, but reviewed
// goldens own the settled UI. Never capture a timing-dependent RAF frame.
await settleCamera(card);
return {
space: card._space,
mode: card._mode,
+6
View File
@@ -44,6 +44,12 @@ const load = (cfg, layout, space) => page.evaluate(async ([c2, l2, sp]) => {
await c.updateComplete;
c._resetZoom();
await c.updateComplete;
const started = performance.now();
while (c._cameraTransition?.active) {
if (performance.now() - started > 1000) throw new Error('camera transition did not settle');
await new Promise((r) => requestAnimationFrame(r));
}
await c.updateComplete;
}, [cfg, layout, space]);
// ---------------------------------------------------------------- 01: hidden
+29 -13
View File
@@ -12,6 +12,18 @@ const SHOTS = process.env.HP_SHOTS || '';
const { page, browser } = await launch({ width: 900, height: 820 }, 1);
const out = {};
const raf = () => page.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))));
await page.evaluate(() => {
window.__waitForCamera = async (card = window.__card) => {
const started = performance.now();
while (card?._cameraTransition?.active) {
if (performance.now() - started > 1000) throw new Error('camera transition did not settle');
await new Promise((r) => requestAnimationFrame(r));
}
await card?.updateComplete;
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
await card?.updateComplete;
};
});
// A hand-drawn plan whose rooms live at 1.5..3.0 — entirely outside the old
// canvas. Before the infinite canvas the -25%..125% envelope threw every one
@@ -61,7 +73,7 @@ const loadFar = (cfg, layout) => page.evaluate(async ([c2, l2]) => {
c.requestUpdate();
await c.updateComplete;
c._resetZoom();
await c.updateComplete;
await window.__waitForCamera(c);
}, [cfg, layout]);
await loadFar(FAR_CFG, FAR_LAYOUT);
@@ -181,7 +193,7 @@ Object.assign(out, await page.evaluate(async () => {
const c = window.__card;
const sr = c.shadowRoot || c.renderRoot;
sr.querySelector('.farhint button').click();
await c.updateComplete;
await window.__waitForCamera(c);
const o = {};
const v = c._viewOr(c._baseVb());
o.fitAllReachesTheStray = v.x + v.w > 90000 && v.y + v.h > 90000;
@@ -194,10 +206,11 @@ Object.assign(out, await page.evaluate(async () => {
// ---- zoom-out stops at 3x, zoom-in unchanged -----------------------------
await loadFar(FAR_CFG, FAR_LAYOUT);
await raf();
Object.assign(out, await page.evaluate(() => {
Object.assign(out, await page.evaluate(async () => {
const c = window.__card;
const o = {};
c._resetZoom();
await window.__waitForCamera(c);
const fit = { ...c._viewOr(c._baseVb()) };
c._applyView(0.001);
o.zoomOutStopsAtThree = Math.abs(c._zoom - 1 / 3) < 1e-9
@@ -205,6 +218,7 @@ Object.assign(out, await page.evaluate(() => {
c._applyView(50);
o.zoomInUnchanged = c._zoom === 8;
c._resetZoom();
await window.__waitForCamera(c);
return o;
}));
@@ -213,7 +227,7 @@ Object.assign(out, await page.evaluate(async () => {
const c = window.__card;
const sr = c.shadowRoot || c.renderRoot;
const o = {};
c._resetZoom(); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
const fit = { ...c._view };
// pan most of a screen to the right: nothing pins the content over the scene
c._view = c._clampView({ ...fit, x: fit.x + fit.w * 0.9 }, fit);
@@ -225,13 +239,13 @@ Object.assign(out, await page.evaluate(async () => {
o.homeArrowAppears = !!arrow;
if (arrow) {
arrow.click();
await c.updateComplete;
await window.__waitForCamera(c);
o.homeArrowFitsBack = Math.abs(c._view.x - fit.x) < 2 && Math.abs(c._view.w - fit.w) < 2;
await c.updateComplete;
o.homeArrowGone = !sr.querySelector('.homearrow');
}
// and it is NOT there while the plan is on screen
c._resetZoom(); c.requestUpdate(); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
o.noHomeArrowWhenVisible = !sr.querySelector('.homearrow');
return o;
}));
@@ -255,13 +269,13 @@ const farIcon = await page.evaluate(async () => {
return Math.round(el.getBoundingClientRect().width * 100) / 100;
};
const o = {};
c._resetZoom(); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
const at1 = size();
c._applyView(4); await c.updateComplete;
const at4 = size();
c._applyView(1 / 3); await c.updateComplete;
const atOut = size();
c._resetZoom(); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
o.iconGrowsWithZoomIn = at1 > 4 && Math.abs(at4 / at1 - 4) < 0.05;
o.iconShrinksWithZoomOut = Math.abs(atOut / at1 - 1 / 3) < 0.02;
if (!o.iconGrowsWithZoomIn || !o.iconShrinksWithZoomOut) console.log('icon px', at1, at4, atOut);
@@ -286,7 +300,7 @@ Object.assign(out, await page.evaluate(async () => {
c._maybeRebuildDevices?.();
c._defPos = c._defaultPositions(); // the auto grid follows the new rooms
c.requestUpdate(); await c.updateComplete;
c._resetZoom(); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
const b = c._baseVb();
// identical to what contentBounds produced before: the content bbox
// (40..960 x 140..580) plus 5% of the longer side (920 -> 46)
@@ -327,7 +341,7 @@ out.farIconNotDegenerate = await page.evaluate(async (farPx) => {
c._maybeRebuildDevices?.();
c._defPos = c._defaultPositions();
c.requestUpdate(); await c.updateComplete;
c._resetZoom(); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
const el = sr.querySelector('.devlayer .dev');
const px = el.getBoundingClientRect().width - 2;
if (!(px > 4 && Math.abs(px / farPx - 1) < 0.3)) console.log('icon px near/far', px, farPx);
@@ -347,7 +361,7 @@ if (SHOTS) {
await page.evaluate(async () => {
const c = window.__card;
(c.shadowRoot || c.renderRoot).querySelector('.farhint button').click();
await c.updateComplete;
await window.__waitForCamera(c);
});
await raf();
await page.screenshot({ path: `${SHOTS}/canvas_fit_all.png` });
@@ -356,13 +370,15 @@ if (SHOTS) {
await page.evaluate(async () => {
const c = window.__card;
c._setMode('plan'); await c.updateComplete;
c._resetZoom(); c._applyView(1 / 3); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
c._applyView(1 / 3); await c.updateComplete;
});
await raf();
await page.screenshot({ path: `${SHOTS}/canvas_grid_far.png` });
await page.evaluate(async () => {
const c = window.__card;
c._resetZoom(); c._applyView(4); await c.updateComplete;
c._resetZoom(); await window.__waitForCamera(c);
c._applyView(4); await c.updateComplete;
});
await raf();
await page.screenshot({ path: `${SHOTS}/canvas_grid_near.png` });
+5
View File
@@ -37,6 +37,11 @@ const res = await page.evaluate(async () => {
c._lastTap = Date.now() - 100;
stage.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, composed: true, pointerId: 3, clientX: 500, clientY: 300 }));
stage.dispatchEvent(new PointerEvent('pointerup', { bubbles: true, composed: true, pointerId: 3, clientX: 501, clientY: 300 }));
const resetStarted = performance.now();
while (c._cameraTransition?.active) {
if (performance.now() - resetStarted > 1000) throw new Error('double-tap camera transition did not settle');
await new Promise((r) => requestAnimationFrame(r));
}
await c.updateComplete;
out.dblTapResets = c._zoom === 1;
// 6) локальный множитель иконок применяется
+52 -52
View File
@@ -1,125 +1,125 @@
{
"schema": 1,
"fingerprint": "f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7",
"fingerprint": "099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347",
"entry": "houseplan-card.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-CBWTStJK.js",
"houseplan-assets/houseplan-card-DzlQl4_k.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 283088,
"initialViewGzipBytes": 283094,
"lazyFiles": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/de-oZrkEqX6.js",
"houseplan-assets/editor--mflqGUR.js",
"houseplan-assets/fr-DfONpvOM.js",
"houseplan-assets/houseplan-editor-runtime-By0nbxeL.js",
"houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/de-Dq2fGpol.js",
"houseplan-assets/editor-DrQ9S89m.js",
"houseplan-assets/fr-Bq4OMxB4.js",
"houseplan-assets/houseplan-editor-runtime-C6fRvS15.js",
"houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js"
],
"lazyGzipBytes": 197604,
"lazyGzipBytes": 197612,
"lazyEditorFiles": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/editor--mflqGUR.js",
"houseplan-assets/houseplan-editor-runtime-By0nbxeL.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/editor-DrQ9S89m.js",
"houseplan-assets/houseplan-editor-runtime-C6fRvS15.js"
],
"lazyEditorGzipBytes": 143900,
"lazyEditorGzipBytes": 143897,
"lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js"
],
"lazyOnboardingGzipBytes": 13789,
"lazyLocaleFiles": [
"houseplan-assets/de-oZrkEqX6.js",
"houseplan-assets/fr-DfONpvOM.js"
"houseplan-assets/de-Dq2fGpol.js",
"houseplan-assets/fr-Bq4OMxB4.js"
],
"lazyLocaleGzipBytes": 46986,
"lazyLocaleGzipBytes": 46997,
"files": [
{
"path": "houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"sha256": "5331740c6e13db3e93870fc4b2d3f098ea327417cdab7eb0800cbf3215834b92",
"path": "houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"sha256": "383eea583e6ee787be10c7766420bbff1738f466827bcada4dbb2fbf1de24505",
"rawBytes": 20636,
"gzipBytes": 7071,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/de-oZrkEqX6.js",
"sha256": "6184f30f2a77335edf045179e42c7ee285995670b143c9b3f9a9ab50c2955746",
"path": "houseplan-assets/de-Dq2fGpol.js",
"sha256": "17cca86ed13e257b06567609834707e975e9dacb38e495208a5bceedf4e7da8f",
"rawBytes": 78310,
"gzipBytes": 23715,
"gzipBytes": 23721,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor--mflqGUR.js",
"sha256": "86e469e66557c2aff1c7e3cff65cf7a21bd8ed5e24a6749f1eaa0a050566beff",
"path": "houseplan-assets/editor-DrQ9S89m.js",
"sha256": "0b137accab6d6ed51f44aed3d4d2b1ff444b5307ac9c11ff0cb9535cfd25bb2c",
"rawBytes": 3826,
"gzipBytes": 1581,
"gzipBytes": 1582,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/fr-DfONpvOM.js",
"sha256": "e797479f529a3b301db1b612010958789ab58fcdfe1bfbeeed8856a3cbb32255",
"path": "houseplan-assets/fr-Bq4OMxB4.js",
"sha256": "da0d137d42243e36315ed6ad73197210ea12cf672cf14eb7cb6320594c9aec56",
"rawBytes": 80482,
"gzipBytes": 23271,
"gzipBytes": 23276,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-CBWTStJK.js",
"sha256": "2d137f17eeb1a7bcdb1846edc3e5f36e7ebe7d689c7b07b22a51f7c12f13e02a",
"rawBytes": 1001304,
"gzipBytes": 282292,
"path": "houseplan-assets/houseplan-card-DzlQl4_k.js",
"sha256": "ac14483abe54719e12506df7eef1f26f4fd570c92600ea781159e445249ecca9",
"rawBytes": 1001346,
"gzipBytes": 282298,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-oZrkEqX6.js",
"houseplan-assets/editor--mflqGUR.js",
"houseplan-assets/fr-DfONpvOM.js",
"houseplan-assets/houseplan-editor-runtime-By0nbxeL.js",
"houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js"
"houseplan-assets/de-Dq2fGpol.js",
"houseplan-assets/editor-DrQ9S89m.js",
"houseplan-assets/fr-Bq4OMxB4.js",
"houseplan-assets/houseplan-editor-runtime-C6fRvS15.js",
"houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-By0nbxeL.js",
"sha256": "c316d389463599c5230c92af641cd6b413d8b34074ed2101d9232157c234c336",
"path": "houseplan-assets/houseplan-editor-runtime-C6fRvS15.js",
"sha256": "aeef2fb0c3cec33286d9aee59488c69713483da5e93d5a47b28b67e5637354e6",
"rawBytes": 524015,
"gzipBytes": 135248,
"gzipBytes": 135244,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-DRAI36pI.js",
"sha256": "e1184e7c0bfd79eb07573bda18c348d98c618a674f05653553c955a14dcc6370",
"path": "houseplan-assets/houseplan-onboarding-runtime-HmSdEh0z.js",
"sha256": "d7aba6728494fdc25e17a614eba3e91bb8132ee8248d8970fe6030565ec8c36b",
"rawBytes": 27120,
"gzipBytes": 6718,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-Do7LQiRQ.js",
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/backdrop-pick-CJ3kZCi2.js",
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "819076ed93c5615271a579b4713b4d346c99f8ad168c063bd4b3904cac3f5626",
"sha256": "2bdf546fd8a2b8fe97577f166d3dd1720dc7777201accb899856e1ea3e96c14d",
"rawBytes": 1183,
"gzipBytes": 796,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-CBWTStJK.js"
"houseplan-assets/houseplan-card-DzlQl4_k.js"
],
"dynamicImports": []
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";import{b as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,c}from"./houseplan-card-CBWTStJK.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")},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__="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";import{b as e,l as o,t,d7 as s,A as a,d8 as i,d9 as l,da as n,E as r,c}from"./houseplan-card-DzlQl4_k.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")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
.hass=${this.hass}
.data=${this._formData}
.schema=${e}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";import{l as t,ar as s,A as e,t as o,c as a,bV as l,bW as i,bX as h,bY as c,ao as n,bZ as p,c2 as r,b_ as _,b$ as d,c0 as u,c1 as g,cX as m,an as b,ap as $,cY as v}from"./houseplan-card-CBWTStJK.js";import{i as f,c as y,e as w,r as D,a as S,b as k,s as C,t as M}from"./backdrop-pick-Do7LQiRQ.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";class I{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__="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";import{l as t,ar as s,A as e,t as o,c as a,bV as l,bW as i,bX as h,bY as c,ao as n,bZ as p,c2 as r,b_ as _,b$ as d,c0 as u,c1 as g,cX as m,an as b,ap as $,cY as v}from"./houseplan-card-DzlQl4_k.js";import{i as f,c as y,e as w,r as D,a as S,b as k,s as C,t as M}from"./backdrop-pick-CJ3kZCi2.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";class I{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,r="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:p(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:r,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=r(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:d,tempMax:_,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){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 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
View File
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f9d1d97505a93d92d3be104dc3b731c5191d3e7ecb10fef673bdc5e60fe8b2c7";try{await import("./houseplan-assets/houseplan-card-CBWTStJK.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__="099688ecae2a6f015325a6ffa40c7112bd2726309f7760aec7d6b2534ad2f347";try{await import("./houseplan-assets/houseplan-card-DzlQl4_k.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)}
+4
View File
@@ -5970,6 +5970,9 @@ export class HouseplanCard extends LitElement {
private _fitFar(): void {
this._showFar = true;
this._frame = null;
// The camera command may be a no-op at the fitted target. The hint still
// changed state and must disappear without waiting for another render.
this.requestUpdate();
this._resetZoom();
}
@@ -5979,6 +5982,7 @@ export class HouseplanCard extends LitElement {
private _fitAll(reason: 'fit' | 'home' = 'fit'): void {
this._showFar = true;
this._frame = null;
this.requestUpdate();
this._resetZoom(reason);
}