mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-28 19:01:34 +00:00
fix: calibrate a robot map against the space it is assigned to
User-Visible: no Issue: #162
This commit is contained in:
@@ -1,125 +1,125 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"fingerprint": "781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5",
|
||||
"fingerprint": "eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js",
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 292979,
|
||||
"initialViewGzipBytes": 292971,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/de-DZwnjt2u.js",
|
||||
"houseplan-assets/editor-CHYZKnjE.js",
|
||||
"houseplan-assets/fr-C7WePbhg.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/de-CsRas6jx.js",
|
||||
"houseplan-assets/editor-S0HhJYix.js",
|
||||
"houseplan-assets/fr-DdgK8UIB.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js"
|
||||
],
|
||||
"lazyGzipBytes": 219759,
|
||||
"lazyGzipBytes": 219799,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/editor-CHYZKnjE.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/editor-S0HhJYix.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 163722,
|
||||
"lazyEditorGzipBytes": 163776,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 14234,
|
||||
"lazyOnboardingGzipBytes": 14230,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-DZwnjt2u.js",
|
||||
"houseplan-assets/fr-C7WePbhg.js"
|
||||
"houseplan-assets/de-CsRas6jx.js",
|
||||
"houseplan-assets/fr-DdgK8UIB.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 49082,
|
||||
"lazyLocaleGzipBytes": 49071,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"sha256": "8be84f207f5d68f15f792323ab0c4f3a689132d154d3a68a47b04b6112d7fe93",
|
||||
"path": "houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"sha256": "7ddf179e36cbde0bf7e9022b0c485fbea78ef6b795353258a61a79f44b1deeaa",
|
||||
"rawBytes": 21378,
|
||||
"gzipBytes": 7279,
|
||||
"gzipBytes": 7278,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-DZwnjt2u.js",
|
||||
"sha256": "b5d15c4488fda2e435fb6220ccaaa2696cbee3991540885a18d3bbcbb31cf5e4",
|
||||
"path": "houseplan-assets/de-CsRas6jx.js",
|
||||
"sha256": "e2aa870d33f74396775b0967bd51c772a4f832f4fec49d90db419a58dc1440d2",
|
||||
"rawBytes": 82140,
|
||||
"gzipBytes": 24809,
|
||||
"gzipBytes": 24805,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-CHYZKnjE.js",
|
||||
"sha256": "0eb13886c6e6814cca1ce7d791c92968c9823c50abb31f0895a74c039fe7b9e5",
|
||||
"path": "houseplan-assets/editor-S0HhJYix.js",
|
||||
"sha256": "fdbe9fc3fc2951da28e3c0c670a0032cd8f090bbf233d1a134a3b170c6543eef",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1582,
|
||||
"gzipBytes": 1581,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-C7WePbhg.js",
|
||||
"sha256": "fe7b6e9bd8dbdd7b3e175bdc6e58b8927538f4078f89a306bed1fc78857d520d",
|
||||
"path": "houseplan-assets/fr-DdgK8UIB.js",
|
||||
"sha256": "aad556cbbf53185d79c761d65ad8e12635d78e3a309e417285d09d56656a3c82",
|
||||
"rawBytes": 84267,
|
||||
"gzipBytes": 24273,
|
||||
"gzipBytes": 24266,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-CuVuAiJj.js",
|
||||
"sha256": "dc8ac636f240e73c54f26bfff9ca62d5a6516e37850e2498e913637f85ee7f6a",
|
||||
"path": "houseplan-assets/houseplan-card-D8zflggZ.js",
|
||||
"sha256": "857327b87b7b74ea580699c5023efbf35c59bafada3f65a4f1ca3ed1414fa9ec",
|
||||
"rawBytes": 1039585,
|
||||
"gzipBytes": 292182,
|
||||
"gzipBytes": 292176,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-DZwnjt2u.js",
|
||||
"houseplan-assets/editor-CHYZKnjE.js",
|
||||
"houseplan-assets/fr-C7WePbhg.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js"
|
||||
"houseplan-assets/de-CsRas6jx.js",
|
||||
"houseplan-assets/editor-S0HhJYix.js",
|
||||
"houseplan-assets/fr-DdgK8UIB.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js",
|
||||
"sha256": "66d51bf9c6363689f5ddf47a87b30e12ddfc970ff726596e5f1324b3d1f2bbab",
|
||||
"rawBytes": 589941,
|
||||
"gzipBytes": 154861,
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js",
|
||||
"sha256": "23baee7febc624f323b1850067aca264554abdd4995a6e90c786d44524233881",
|
||||
"rawBytes": 590156,
|
||||
"gzipBytes": 154917,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js",
|
||||
"sha256": "16c760331824dbd047763b6a8381ec6589da01f95e0bcfcab7801f0ad08e142e",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js",
|
||||
"sha256": "03ce43da4034c5dc3e05e0946b39e68aeeece3aef0cff782eb27ca3c8033a3c5",
|
||||
"rawBytes": 28088,
|
||||
"gzipBytes": 6955,
|
||||
"gzipBytes": 6952,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "c8bf46999b6b15e83a03786879ed075813d25f6532ff22d3362eaefbcc0d226b",
|
||||
"sha256": "e9bfe783eae1d4aa0cefb16d58fc8aca3171461e990723f0281e9acf45bbc4d8",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 797,
|
||||
"gzipBytes": 795,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";import{g as e,l as o,t,dm as s,A as a,dn as i,dp as l,dq as n,E as r,c}from"./houseplan-card-CuVuAiJj.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__="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";import{g as e,l as o,t,dm as s,A as a,dn as i,dp as l,dq as n,E as r,c}from"./houseplan-card-D8zflggZ.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}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";import{l as t,aK as s,A as e,t as o,c as a,ca as l,cb as i,cc as h,cd as c,aH as n,ce as r,cj as p,cf as d,cg as _,ch as u,ci as g,db as m,aG as b,aI as $,dc as v}from"./houseplan-card-CuVuAiJj.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-BJ59BurK.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";import{l as t,aK as s,A as e,t as o,c as a,ca as l,cb as i,cc as h,cd as c,aH as n,ce as r,cj as p,cf as d,cg as _,ch as u,ci as g,db as m,aG as b,aI as $,dc as v}from"./houseplan-card-D8zflggZ.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-BLxmEavR.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
.text=${o(h,l)} .ariaLabel=${o(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const o=l(e),a=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===o.fill?{...a||h,a:0}:a;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:o.showBorders,showNames:o.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:p,glowEnabled:o.glow,bgColor:o.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:o.tempMin,tempMax:o.tempMax,showLqi:o.showLqi??this.host._config?.show_signal??!0,cardFontScale:o.cardFontScale,labelTemp:o.labelTemp,labelHum:o.labelHum,labelLqi:o.labelLqi,labelLight:o.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...f(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const o=await y(e);if("reject"===o.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===o.kind)return void(this.host._backdropGuard=o.state);const a=await w(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return D(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),o=this.host._spaceDialog;return o&&o.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...o,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const o=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),a=this.host._spaceDialog,l=a?.saved?.find(s=>s.name===t);if(o&&a&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==a.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return a`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return a`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return a`<div class="savedplans">
|
||||
${s.map(s=>{return a`
|
||||
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
|
||||
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";try{await import("./houseplan-assets/houseplan-card-CuVuAiJj.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__="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";try{await import("./houseplan-assets/houseplan-card-D8zflggZ.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale entry: the main chunk is unavailable",e)}
|
||||
|
||||
Vendored
+56
-56
@@ -1,125 +1,125 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"fingerprint": "781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5",
|
||||
"fingerprint": "eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js",
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 292979,
|
||||
"initialViewGzipBytes": 292971,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/de-DZwnjt2u.js",
|
||||
"houseplan-assets/editor-CHYZKnjE.js",
|
||||
"houseplan-assets/fr-C7WePbhg.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/de-CsRas6jx.js",
|
||||
"houseplan-assets/editor-S0HhJYix.js",
|
||||
"houseplan-assets/fr-DdgK8UIB.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js"
|
||||
],
|
||||
"lazyGzipBytes": 219759,
|
||||
"lazyGzipBytes": 219799,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/editor-CHYZKnjE.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/editor-S0HhJYix.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 163722,
|
||||
"lazyEditorGzipBytes": 163776,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 14234,
|
||||
"lazyOnboardingGzipBytes": 14230,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-DZwnjt2u.js",
|
||||
"houseplan-assets/fr-C7WePbhg.js"
|
||||
"houseplan-assets/de-CsRas6jx.js",
|
||||
"houseplan-assets/fr-DdgK8UIB.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 49082,
|
||||
"lazyLocaleGzipBytes": 49071,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"sha256": "8be84f207f5d68f15f792323ab0c4f3a689132d154d3a68a47b04b6112d7fe93",
|
||||
"path": "houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"sha256": "7ddf179e36cbde0bf7e9022b0c485fbea78ef6b795353258a61a79f44b1deeaa",
|
||||
"rawBytes": 21378,
|
||||
"gzipBytes": 7279,
|
||||
"gzipBytes": 7278,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-DZwnjt2u.js",
|
||||
"sha256": "b5d15c4488fda2e435fb6220ccaaa2696cbee3991540885a18d3bbcbb31cf5e4",
|
||||
"path": "houseplan-assets/de-CsRas6jx.js",
|
||||
"sha256": "e2aa870d33f74396775b0967bd51c772a4f832f4fec49d90db419a58dc1440d2",
|
||||
"rawBytes": 82140,
|
||||
"gzipBytes": 24809,
|
||||
"gzipBytes": 24805,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-CHYZKnjE.js",
|
||||
"sha256": "0eb13886c6e6814cca1ce7d791c92968c9823c50abb31f0895a74c039fe7b9e5",
|
||||
"path": "houseplan-assets/editor-S0HhJYix.js",
|
||||
"sha256": "fdbe9fc3fc2951da28e3c0c670a0032cd8f090bbf233d1a134a3b170c6543eef",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1582,
|
||||
"gzipBytes": 1581,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-C7WePbhg.js",
|
||||
"sha256": "fe7b6e9bd8dbdd7b3e175bdc6e58b8927538f4078f89a306bed1fc78857d520d",
|
||||
"path": "houseplan-assets/fr-DdgK8UIB.js",
|
||||
"sha256": "aad556cbbf53185d79c761d65ad8e12635d78e3a309e417285d09d56656a3c82",
|
||||
"rawBytes": 84267,
|
||||
"gzipBytes": 24273,
|
||||
"gzipBytes": 24266,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-CuVuAiJj.js",
|
||||
"sha256": "dc8ac636f240e73c54f26bfff9ca62d5a6516e37850e2498e913637f85ee7f6a",
|
||||
"path": "houseplan-assets/houseplan-card-D8zflggZ.js",
|
||||
"sha256": "857327b87b7b74ea580699c5023efbf35c59bafada3f65a4f1ca3ed1414fa9ec",
|
||||
"rawBytes": 1039585,
|
||||
"gzipBytes": 292182,
|
||||
"gzipBytes": 292176,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-DZwnjt2u.js",
|
||||
"houseplan-assets/editor-CHYZKnjE.js",
|
||||
"houseplan-assets/fr-C7WePbhg.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js"
|
||||
"houseplan-assets/de-CsRas6jx.js",
|
||||
"houseplan-assets/editor-S0HhJYix.js",
|
||||
"houseplan-assets/fr-DdgK8UIB.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-o7FB8qC-.js",
|
||||
"sha256": "66d51bf9c6363689f5ddf47a87b30e12ddfc970ff726596e5f1324b3d1f2bbab",
|
||||
"rawBytes": 589941,
|
||||
"gzipBytes": 154861,
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-DDOnx5O4.js",
|
||||
"sha256": "23baee7febc624f323b1850067aca264554abdd4995a6e90c786d44524233881",
|
||||
"rawBytes": 590156,
|
||||
"gzipBytes": 154917,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-CAJfA2x6.js",
|
||||
"sha256": "16c760331824dbd047763b6a8381ec6589da01f95e0bcfcab7801f0ad08e142e",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-4HdY4AXX.js",
|
||||
"sha256": "03ce43da4034c5dc3e05e0946b39e68aeeece3aef0cff782eb27ca3c8033a3c5",
|
||||
"rawBytes": 28088,
|
||||
"gzipBytes": 6955,
|
||||
"gzipBytes": 6952,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BJ59BurK.js",
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/backdrop-pick-BLxmEavR.js",
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "c8bf46999b6b15e83a03786879ed075813d25f6532ff22d3362eaefbcc0d226b",
|
||||
"sha256": "e9bfe783eae1d4aa0cefb16d58fc8aca3171461e990723f0281e9acf45bbc4d8",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 797,
|
||||
"gzipBytes": 795,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CuVuAiJj.js"
|
||||
"houseplan-assets/houseplan-card-D8zflggZ.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";import{g as e,l as o,t,dm as s,A as a,dn as i,dp as l,dq as n,E as r,c}from"./houseplan-card-CuVuAiJj.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__="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";import{g as e,l as o,t,dm as s,A as a,dn as i,dp as l,dq as n,E as r,c}from"./houseplan-card-D8zflggZ.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}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+3
-3
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";import{l as t,aK as s,A as e,t as o,c as a,ca as l,cb as i,cc as h,cd as c,aH as n,ce as r,cj as p,cf as d,cg as _,ch as u,ci as g,db as m,aG as b,aI as $,dc as v}from"./houseplan-card-CuVuAiJj.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-BJ59BurK.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";import{l as t,aK as s,A as e,t as o,c as a,ca as l,cb as i,cc as h,cd as c,aH as n,ce as r,cj as p,cf as d,cg as _,ch as u,ci as g,db as m,aG as b,aI as $,dc as v}from"./houseplan-card-D8zflggZ.js";import{i as f,c as y,e as w,r as D,a as k,b as S,d as C,t as M}from"./backdrop-pick-BLxmEavR.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
.text=${o(h,l)} .ariaLabel=${o(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const o=l(e),a=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===o.fill?{...a||h,a:0}:a;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:o.showBorders,showNames:o.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:p,glowEnabled:o.glow,bgColor:o.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:o.tempMin,tempMax:o.tempMax,showLqi:o.showLqi??this.host._config?.show_signal??!0,cardFontScale:o.cardFontScale,labelTemp:o.labelTemp,labelHum:o.labelHum,labelLqi:o.labelLqi,labelLight:o.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...f(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:_,tempMax:d,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const o=await y(e);if("reject"===o.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===o.kind)return void(this.host._backdropGuard=o.state);const a=await w(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return D(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),o=this.host._spaceDialog;return o&&o.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...o,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const o=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),a=this.host._spaceDialog,l=a?.saved?.find(s=>s.name===t);if(o&&a&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==a.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return a`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return a`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return a`<div class="savedplans">
|
||||
${s.map(s=>{return a`
|
||||
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="781b6de4892612660b01762cd408049137fa0d00417a43ef5bbdfb1ef37dc9a5";try{await import("./houseplan-assets/houseplan-card-CuVuAiJj.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__="eeba3bd848dcc963129aef216061c60ac878ad129c553317d8bfd01ff5c8c50e";try{await import("./houseplan-assets/houseplan-card-D8zflggZ.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)}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"fixture": "synthetic-only",
|
||||
"chromium": "151.0.7922.34",
|
||||
"oxipng": "oxipng 10.2.0",
|
||||
"sourceFingerprint": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceFingerprint": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"captureScriptSha256": "cadb8e1bcab9f1dcdd7d75b3b90ddcbaaeb2b8c2a098f575a21f39ff70f5c59c",
|
||||
"command": "npm run build && node demo/docs/capture.mjs",
|
||||
"scenarios": {
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "80a70361dc18dd0461568df332062e6482c633af5d280954f8b675701418a76d"
|
||||
},
|
||||
"view-touch": {
|
||||
@@ -26,7 +26,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "4106cc28847047505f46921ff95765d8abdf5b382d9d17d4c5e4ad129dd8f6be"
|
||||
},
|
||||
"space-create": {
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "617b51b3648498787b5039980c9f3eceb75ba56ed63a1a20e616bc05bc304362"
|
||||
},
|
||||
"room-contour-close": {
|
||||
@@ -48,7 +48,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "1dab6cc3b9d1bf7d8c40f0e5137f8c688683c9b7eabc5167da99d41ecfdd5b79"
|
||||
},
|
||||
"plan-context-tray": {
|
||||
@@ -59,7 +59,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "94ef50762753c0ac6ddc84d2521c4232a3f9ecd89843810d2df61c517592bed7"
|
||||
},
|
||||
"device-editor": {
|
||||
@@ -70,7 +70,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "7a601769de38aa19c2e280f6ff4cf3695b854b1d1c6d1f8de4e6b5e8f7eb1559"
|
||||
},
|
||||
"device-display-preview": {
|
||||
@@ -81,7 +81,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "0939875f8631694f4de0ef4fd01032010ede8c7d49fb7c0a857612d4b3afff93"
|
||||
},
|
||||
"background-editor": {
|
||||
@@ -92,7 +92,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "054170fd9ef45762b602b4d5c9c3b9ea9724858be61af137970c246f485c13bb"
|
||||
},
|
||||
"room-card": {
|
||||
@@ -103,7 +103,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "2ae4a58853d98e10d12456b2078ec2f6a0b597722c8310d7b016abd2bc42561e"
|
||||
},
|
||||
"device-info": {
|
||||
@@ -114,7 +114,7 @@
|
||||
},
|
||||
"theme": "dark",
|
||||
"language": "en",
|
||||
"sourceSha256": "1fab672eca26b3aae6f8ae1b4f0c222a36db252a833da6ba41e25b88fb4c9467",
|
||||
"sourceSha256": "4b8e50872070b871bc5b93acc8a6cc47f73223051f3e7430ff8ef6c81224d349",
|
||||
"imageSha256": "cb37f7eefd936f98ef44969b21dfe8e40ee27d1f558abe8d53c0223f6488b8a6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,6 +393,18 @@ const MUTANT_DEFINITIONS = [
|
||||
replace: ' ${this._renderVacuums(devs, view, space.id)}',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'vacuum-calibration-solves-against-the-dock',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
+ '&& node --test test/vacuum-routes.test.mjs',
|
||||
because: 'a matrix solved against the DOCK space and applied on another floor is wrong '
|
||||
+ 'wherever the two plans differ — calibration belongs to the route (#162, AC8)',
|
||||
patches: [{
|
||||
file: 'src/vacuum-route-edit.ts',
|
||||
find: ' return { space: route?.space || dockSpace, routeId: route?.id || \'\' };',
|
||||
replace: ' return { space: dockSpace, routeId: route?.id || \'\' };',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'area-snapshot-cleanup-ignores-authority',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
|
||||
@@ -2512,7 +2512,7 @@ export class HouseplanCard extends LitElement {
|
||||
private _vacAllCameraCache: { devId: string; candidates: VacSourceCandidate[] } | null = null;
|
||||
/** Proposed high-residual auto-calibration. Config remains untouched until Apply. */
|
||||
private _vacCalConfirm: {
|
||||
markerId: string; source: string; mapId: string; matrix: Affine;
|
||||
markerId: string; source: string; mapId: string; routeId?: string; matrix: Affine;
|
||||
rooms: number; error: string;
|
||||
} | null = null;
|
||||
private _kioskDots = false;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { LitElement, html, svg, nothing, TemplateResult, PropertyValues } from 'lit';
|
||||
import { guard } from 'lit/directives/guard.js';
|
||||
import { renderVacuumMapsSection } from './editors/vacuum-maps-section';
|
||||
import { planVacuumFit, writeVacuumMatrix } from './vacuum-route-edit';
|
||||
import { calibrationTarget, planVacuumFit, writeVacuumMatrix } from './vacuum-route-edit';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
import './hp-dialog';
|
||||
import type { HpDialog } from './hp-dialog';
|
||||
@@ -1147,7 +1147,7 @@ export interface HouseplanEditorHostPort {
|
||||
_undoPoint: () => void;
|
||||
_vacAllCameraCache: { devId: string; candidates: VacSourceCandidate[]; } | null;
|
||||
_vacAllCamerasFor: string | null;
|
||||
_vacCalConfirm: { markerId: string; source: string; mapId: string; matrix: Affine; rooms: number; error: string; } | null;
|
||||
_vacCalConfirm: { markerId: string; source: string; mapId: string; routeId?: string; matrix: Affine; rooms: number; error: string; } | null;
|
||||
_vacEnsureMarker: (d: DevItem) => Marker | null;
|
||||
_vacEntity: (d: DevItem) => string | null;
|
||||
_vacMapId: (d: DevItem, tele: { mapId: string }, planHass?: any) => string;
|
||||
@@ -11020,26 +11020,26 @@ public _vacAutoCalibrate(d: DevItem): void {
|
||||
this.host._showToast(this.host._t('vac.autocal_no_rooms'));
|
||||
return;
|
||||
}
|
||||
const planRooms = this._vacPlanRoomAnchors(d.space);
|
||||
const res = autoCalibrate(tele.rooms, planRooms);
|
||||
const mapId = this._vacMapId(d, tele);
|
||||
const target = calibrationTarget(d.id, d.marker?.vacuum ?? null, d.space, src, mapId);
|
||||
const res = autoCalibrate(tele.rooms, this._vacPlanRoomAnchors(target.space));
|
||||
if (!res) {
|
||||
this.host._showToast(this.host._t('vac.autocal_no_match'));
|
||||
return;
|
||||
}
|
||||
const rawSpace = this.host._serverCfg?.spaces?.find((space) => space.id === d.space);
|
||||
const rawSpace = this.host._serverCfg?.spaces?.find((space) => space.id === target.space);
|
||||
const rawCellCm = Number(rawSpace?.cell_cm);
|
||||
const cellCm = Number.isFinite(rawCellCm) && rawCellCm > 0 ? rawCellCm : 5;
|
||||
const residualCm = vacCalibrationResidualCm(res.residual, this.host._gridPitch, cellCm);
|
||||
const mapId = this._vacMapId(d, tele);
|
||||
if (residualCm > VAC_CALIBRATION_WARN_CM) {
|
||||
this.host._vacCalConfirm = {
|
||||
markerId: d.id, source: src, mapId, matrix: res.matrix,
|
||||
markerId: d.id, source: src, mapId, routeId: target.routeId, matrix: res.matrix,
|
||||
rooms: res.matched.length,
|
||||
error: formatLength(residualCm, this.host.hass?.config?.unit_system?.length === 'mi'),
|
||||
};
|
||||
return;
|
||||
}
|
||||
if (!this._vacSaveMatrix(d.id, src, mapId, res.matrix)) return;
|
||||
if (!this._vacSaveMatrix(d.id, src, mapId, res.matrix, target.routeId)) return;
|
||||
this.host._showToast(subst(this.host._t('vac.autocal_done'), { rooms: String(res.matched.length) }));
|
||||
}
|
||||
|
||||
@@ -11054,13 +11054,13 @@ public _vacApplyCalibrationProposal(manual: boolean): void {
|
||||
this.host._markerDialog = null;
|
||||
if (dev.space !== this.host._space && !this.host._commitSpace(dev.space)) return;
|
||||
this.host._vacFit = {
|
||||
markerId: proposal.markerId, source: proposal.source,
|
||||
markerId: proposal.markerId, source: proposal.source, routeId: proposal.routeId,
|
||||
mapId: proposal.mapId, p: fit, drag: null,
|
||||
};
|
||||
return;
|
||||
}
|
||||
if (this._vacSaveMatrix(
|
||||
proposal.markerId, proposal.source, proposal.mapId, proposal.matrix,
|
||||
proposal.markerId, proposal.source, proposal.mapId, proposal.matrix, proposal.routeId,
|
||||
)) this.host._showToast(subst(this.host._t('vac.autocal_done'), { rooms: String(proposal.rooms) }));
|
||||
}
|
||||
|
||||
|
||||
@@ -138,3 +138,22 @@ export function planVacuumFit(
|
||||
const params = (stored && fitFromMatrix(stored)) || initialFit(opts.rooms, viewBox);
|
||||
return { space, routeId: route?.id || '', params };
|
||||
}
|
||||
|
||||
/**
|
||||
* Which space a calibration is solved against, and which route stores it.
|
||||
*
|
||||
* Auto-calibration used to match the robot's rooms against the DOCK's rooms,
|
||||
* whatever map was on screen — for a multi-floor robot that is the wrong floor
|
||||
* half the time (#162, AC8).
|
||||
*/
|
||||
export function calibrationTarget(
|
||||
markerId: string,
|
||||
vacuum: VacuumRouteMarkerCfg | null | undefined,
|
||||
dockSpace: string,
|
||||
source: string,
|
||||
mapId: string,
|
||||
): { space: string; routeId: string } {
|
||||
const route = effectiveRoutes(markerId, vacuum, dockSpace, source)
|
||||
.find((item) => item.source === source && item.map_id === mapId);
|
||||
return { space: route?.space || dockSpace, routeId: route?.id || '' };
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '../test-build/vacuum-routes.js';
|
||||
import {
|
||||
newRouteId, addRoute, removeRoute, changeRouteSpace, saveRouteCalibration, convertLegacyRoutes,
|
||||
writeVacuumMatrix, planVacuumFit,
|
||||
writeVacuumMatrix, planVacuumFit, calibrationTarget,
|
||||
} from '../test-build/vacuum-route-edit.js';
|
||||
|
||||
const fixture = (name) => JSON.parse(readFileSync(
|
||||
@@ -302,3 +302,61 @@ test('док предупреждает только о движущемся р
|
||||
assert.equal(routeWarningKey({ kind: 'none' }, true), null);
|
||||
assert.equal(routeWarningKey(null, true), null);
|
||||
});
|
||||
|
||||
test('калибровка решается против пространства маршрута, а не дока (AC8)', () => {
|
||||
const vacuum = { map_routes: twoFloors };
|
||||
assert.deepEqual(calibrationTarget('mk', vacuum, 'floor1', 'camera.robot', 'm2'),
|
||||
{ space: 'floor2', routeId: 'r2' });
|
||||
assert.deepEqual(calibrationTarget('mk', vacuum, 'floor1', 'camera.robot', 'm1'),
|
||||
{ space: 'floor1', routeId: 'r1' });
|
||||
// несопоставленная карта калибруется в пространстве дока, как и раньше
|
||||
assert.deepEqual(calibrationTarget('mk', vacuum, 'floor1', 'camera.robot', 'm9'),
|
||||
{ space: 'floor1', routeId: '' });
|
||||
assert.deepEqual(calibrationTarget('mk', null, 'floor1', 'camera.robot', 'm1'),
|
||||
{ space: 'floor1', routeId: '' });
|
||||
});
|
||||
|
||||
test('ручная подгонка открывается на этаже маршрута и берёт его матрицу', () => {
|
||||
const vb = { floor1: [0, 0, 1000, 1000], floor2: [0, 0, 2000, 2000] };
|
||||
const plan = planVacuumFit('mk', { map_routes: twoFloors }, {
|
||||
source: 'camera.robot', mapId: 'm2', dockSpace: 'floor1', rooms: [],
|
||||
viewBoxOf: (id) => vb[id] || null,
|
||||
});
|
||||
assert.equal(plan.space, 'floor2');
|
||||
assert.equal(plan.routeId, 'r2');
|
||||
const legacy = planVacuumFit('mk', { source: 'camera.robot', calibration: { m1: M1 } }, {
|
||||
source: 'camera.robot', mapId: 'm1', dockSpace: 'floor1', rooms: [],
|
||||
viewBoxOf: (id) => vb[id] || null,
|
||||
});
|
||||
assert.equal(legacy.space, 'floor1', 'легаси-калибровка живёт в пространстве дока');
|
||||
assert.equal(planVacuumFit('mk', null, {
|
||||
source: 'camera.robot', mapId: 'm1', dockSpace: 'нет', rooms: [], viewBoxOf: () => null,
|
||||
}), null, 'без геометрии пространства подгонка не открывается');
|
||||
});
|
||||
|
||||
test('матрица пишется в маршрут, а без маршрутов — в легаси-словарь', () => {
|
||||
const routed = writeVacuumMatrix({ map_routes: twoFloors },
|
||||
{ source: 'camera.robot', mapId: 'm2', matrix: [3, 0, 0, 0, 3, 0] });
|
||||
assert.deepEqual(routed.map_routes[1].calibration, [3, 0, 0, 0, 3, 0]);
|
||||
assert.deepEqual(routed.map_routes[0].calibration, M1, 'соседний маршрут не тронут');
|
||||
const legacy = writeVacuumMatrix({ source: 'camera.robot' },
|
||||
{ source: 'camera.robot', mapId: 'm1', matrix: [1 / 3, 0, 0, 0, 1 / 3, 0] });
|
||||
assert.deepEqual(legacy.calibration.m1, [0.333333, 0, 0, 0, 0.333333, 0]);
|
||||
// карта без маршрута не теряет только что решённую калибровку
|
||||
const unmapped = writeVacuumMatrix({ map_routes: twoFloors },
|
||||
{ source: 'camera.robot', mapId: 'm9', matrix: [4, 0, 0, 0, 4, 0] });
|
||||
assert.deepEqual(unmapped.calibration.m9, [4, 0, 0, 0, 4, 0]);
|
||||
assert.equal(unmapped.map_routes.length, 2);
|
||||
});
|
||||
|
||||
test('два робота не смешивают маршруты, прогоны и предупреждения (AC12)', () => {
|
||||
const first = [{ id: 'a1', source: 'camera.one', map_id: 'm1', space: 'floor1', calibration: M1 }];
|
||||
const second = [{ id: 'b1', source: 'camera.two', map_id: 'm1', space: 'floor2', calibration: M2 }];
|
||||
const observed = { 'camera.one': 'm1', 'camera.two': 'm1' };
|
||||
const spaceIds = spaces('floor1', 'floor2');
|
||||
assert.equal(resolveRoute({ routes: first, observed, spaceIds }).route.id, 'a1');
|
||||
assert.equal(resolveRoute({ routes: second, observed, spaceIds }).route.id, 'b1');
|
||||
assert.deepEqual(adoptLegacyRun({ map_id: 'm1' }, first, 'camera.one'),
|
||||
{ kind: 'adopted', route: first[0] });
|
||||
assert.equal(adoptLegacyRun({ map_id: 'm1' }, first, 'camera.two').kind, 'orphan_run');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user