mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
fix: type the five any that slipped past the gate
Пять мест, найденных при разборе #388: они проехали мимо гейта #342, пока диапазоны были узкими, и он их больше не покажет. Кэш климата (houseplan-card.ts) сравнивается только по ссылке, значение не читается ни разу — поэтому hass стал `unknown`: он и запрещает случайно воспользоваться содержимым, и не врёт про форму объекта, которую HA нам не обещает. Правила и маркеры типизированы по-настоящему, их типы известны. Реестр HA (houseplan-editor-runtime.ts) описан минимальной структурной формой: код читает ровно два поля и оба защищённо, так что форма честнее `any` — она говорит, на что код опирается. Ключ i18n `device_inbox.reason_excluded_integration` не нуждался в приведении вовсе: он есть в словаре. Шаблонный ключ приведён к `I18nKey`, как уже сделано в этом файле строкой 8013 — это утверждение о пространстве ключей, а не отключение проверок; `as any` заодно снимал контроль и со второго аргумента. Поведение не меняется: аннотации типов стираются, эмит тот же. Бандл пересобран, потому что в него вшит отпечаток исходников. Issue: #390 User-Visible: no
This commit is contained in:
@@ -1,125 +1,125 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"fingerprint": "aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef",
|
||||
"fingerprint": "a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js",
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 281796,
|
||||
"initialViewGzipBytes": 281785,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/de-CV45z-ti.js",
|
||||
"houseplan-assets/editor-DFZF1CWt.js",
|
||||
"houseplan-assets/fr-Ck0o4CMs.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/de-CeeGlSdH.js",
|
||||
"houseplan-assets/editor-CWRRIfyY.js",
|
||||
"houseplan-assets/fr-BIGiyq-a.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js"
|
||||
],
|
||||
"lazyGzipBytes": 197638,
|
||||
"lazyGzipBytes": 197610,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/editor-DFZF1CWt.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/editor-CWRRIfyY.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 143905,
|
||||
"lazyEditorGzipBytes": 143896,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 13792,
|
||||
"lazyOnboardingGzipBytes": 13791,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-CV45z-ti.js",
|
||||
"houseplan-assets/fr-Ck0o4CMs.js"
|
||||
"houseplan-assets/de-CeeGlSdH.js",
|
||||
"houseplan-assets/fr-BIGiyq-a.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 47013,
|
||||
"lazyLocaleGzipBytes": 46993,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"sha256": "15bf3fd17239abfd64b336b191de40d1d4cc2cb812dc9e0f9f2c87caa845f03d",
|
||||
"path": "houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"sha256": "d0c0fc8d1a54632e83bf0832717f9cad9aef21e03740f39a68e254b9fa2de006",
|
||||
"rawBytes": 20636,
|
||||
"gzipBytes": 7072,
|
||||
"gzipBytes": 7070,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-CV45z-ti.js",
|
||||
"sha256": "911c01b0d7e0a885f703403982923e4167acb8abc4da98a922cb9e6742240db0",
|
||||
"path": "houseplan-assets/de-CeeGlSdH.js",
|
||||
"sha256": "833468501744eb020baadd4664c352cde634c2324280ad32ed4c3c4353d44857",
|
||||
"rawBytes": 78310,
|
||||
"gzipBytes": 23728,
|
||||
"gzipBytes": 23718,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-DFZF1CWt.js",
|
||||
"sha256": "0f09c8de0f2538760376d145222d6c0dbcebb43163fec11259fa2d861ba51158",
|
||||
"path": "houseplan-assets/editor-CWRRIfyY.js",
|
||||
"sha256": "0abaa66a50efc8648f0eddc9e91b9cbd52213f70741e5193fbee331b28e2b3a7",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1584,
|
||||
"gzipBytes": 1581,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-Ck0o4CMs.js",
|
||||
"sha256": "bd7b7f20e4af5c371fc8165e6226fd2122c4734ce4cacb783765d40de2f59381",
|
||||
"path": "houseplan-assets/fr-BIGiyq-a.js",
|
||||
"sha256": "a553eff93f33804b66b2e1be445960d38c4222f03627e78b0514299989ba9a51",
|
||||
"rawBytes": 80482,
|
||||
"gzipBytes": 23285,
|
||||
"gzipBytes": 23275,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-CaTFHDy3.js",
|
||||
"sha256": "5407c26bc8bd764f7d97e197cac43dc88dc1d4b44681f60532dbfbc0df98639f",
|
||||
"path": "houseplan-assets/houseplan-card-DdUxnMX-.js",
|
||||
"sha256": "eea3b14c28ac1f495e685d7b708ac3ee9c585efdc2cefc1454d962454cbfa91b",
|
||||
"rawBytes": 996305,
|
||||
"gzipBytes": 280999,
|
||||
"gzipBytes": 280990,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-CV45z-ti.js",
|
||||
"houseplan-assets/editor-DFZF1CWt.js",
|
||||
"houseplan-assets/fr-Ck0o4CMs.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js"
|
||||
"houseplan-assets/de-CeeGlSdH.js",
|
||||
"houseplan-assets/editor-CWRRIfyY.js",
|
||||
"houseplan-assets/fr-BIGiyq-a.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js",
|
||||
"sha256": "a7f87e8bf473a5549841410f09e3105990e85d9fff948bb29824e6255a812212",
|
||||
"rawBytes": 524026,
|
||||
"gzipBytes": 135249,
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js",
|
||||
"sha256": "cc614c3f22050e61668b34887dd6bfe2be7f84619b4b57202674f45c5790b42f",
|
||||
"rawBytes": 524015,
|
||||
"gzipBytes": 135245,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js",
|
||||
"sha256": "1bb9b33c9395fa9f2c85cb534e4e92354a0563efc45522e078ffe9da6fdc0c14",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js",
|
||||
"sha256": "4cf023f49c8315f3ca2866086169677326c450ad96aac0a36f299f811df7f5bc",
|
||||
"rawBytes": 27120,
|
||||
"gzipBytes": 6720,
|
||||
"gzipBytes": 6721,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "c45de5b9d825097729b03b8ee0063ca7424236137b63a44bdec36aada307b0a0",
|
||||
"sha256": "b526f327c3c51c30c72fc2fdef92c48f82a9f6334839ee24d07120895d46386f",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 797,
|
||||
"gzipBytes": 795,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.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__="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";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-CaTFHDy3.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__="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";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-DdUxnMX-.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__="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";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-CaTFHDy3.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-B6HYqsoo.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";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__="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";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-DdUxnMX-.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-DAhkK64J.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";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__="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";try{await import("./houseplan-assets/houseplan-card-CaTFHDy3.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__="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";try{await import("./houseplan-assets/houseplan-card-DdUxnMX-.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": "aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef",
|
||||
"fingerprint": "a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js",
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 281796,
|
||||
"initialViewGzipBytes": 281785,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/de-CV45z-ti.js",
|
||||
"houseplan-assets/editor-DFZF1CWt.js",
|
||||
"houseplan-assets/fr-Ck0o4CMs.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/de-CeeGlSdH.js",
|
||||
"houseplan-assets/editor-CWRRIfyY.js",
|
||||
"houseplan-assets/fr-BIGiyq-a.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js"
|
||||
],
|
||||
"lazyGzipBytes": 197638,
|
||||
"lazyGzipBytes": 197610,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/editor-DFZF1CWt.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/editor-CWRRIfyY.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 143905,
|
||||
"lazyEditorGzipBytes": 143896,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 13792,
|
||||
"lazyOnboardingGzipBytes": 13791,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-CV45z-ti.js",
|
||||
"houseplan-assets/fr-Ck0o4CMs.js"
|
||||
"houseplan-assets/de-CeeGlSdH.js",
|
||||
"houseplan-assets/fr-BIGiyq-a.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 47013,
|
||||
"lazyLocaleGzipBytes": 46993,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"sha256": "15bf3fd17239abfd64b336b191de40d1d4cc2cb812dc9e0f9f2c87caa845f03d",
|
||||
"path": "houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"sha256": "d0c0fc8d1a54632e83bf0832717f9cad9aef21e03740f39a68e254b9fa2de006",
|
||||
"rawBytes": 20636,
|
||||
"gzipBytes": 7072,
|
||||
"gzipBytes": 7070,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-CV45z-ti.js",
|
||||
"sha256": "911c01b0d7e0a885f703403982923e4167acb8abc4da98a922cb9e6742240db0",
|
||||
"path": "houseplan-assets/de-CeeGlSdH.js",
|
||||
"sha256": "833468501744eb020baadd4664c352cde634c2324280ad32ed4c3c4353d44857",
|
||||
"rawBytes": 78310,
|
||||
"gzipBytes": 23728,
|
||||
"gzipBytes": 23718,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-DFZF1CWt.js",
|
||||
"sha256": "0f09c8de0f2538760376d145222d6c0dbcebb43163fec11259fa2d861ba51158",
|
||||
"path": "houseplan-assets/editor-CWRRIfyY.js",
|
||||
"sha256": "0abaa66a50efc8648f0eddc9e91b9cbd52213f70741e5193fbee331b28e2b3a7",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1584,
|
||||
"gzipBytes": 1581,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-Ck0o4CMs.js",
|
||||
"sha256": "bd7b7f20e4af5c371fc8165e6226fd2122c4734ce4cacb783765d40de2f59381",
|
||||
"path": "houseplan-assets/fr-BIGiyq-a.js",
|
||||
"sha256": "a553eff93f33804b66b2e1be445960d38c4222f03627e78b0514299989ba9a51",
|
||||
"rawBytes": 80482,
|
||||
"gzipBytes": 23285,
|
||||
"gzipBytes": 23275,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-CaTFHDy3.js",
|
||||
"sha256": "5407c26bc8bd764f7d97e197cac43dc88dc1d4b44681f60532dbfbc0df98639f",
|
||||
"path": "houseplan-assets/houseplan-card-DdUxnMX-.js",
|
||||
"sha256": "eea3b14c28ac1f495e685d7b708ac3ee9c585efdc2cefc1454d962454cbfa91b",
|
||||
"rawBytes": 996305,
|
||||
"gzipBytes": 280999,
|
||||
"gzipBytes": 280990,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-CV45z-ti.js",
|
||||
"houseplan-assets/editor-DFZF1CWt.js",
|
||||
"houseplan-assets/fr-Ck0o4CMs.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js"
|
||||
"houseplan-assets/de-CeeGlSdH.js",
|
||||
"houseplan-assets/editor-CWRRIfyY.js",
|
||||
"houseplan-assets/fr-BIGiyq-a.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-DrWOqPVN.js",
|
||||
"sha256": "a7f87e8bf473a5549841410f09e3105990e85d9fff948bb29824e6255a812212",
|
||||
"rawBytes": 524026,
|
||||
"gzipBytes": 135249,
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-DmHZCYVI.js",
|
||||
"sha256": "cc614c3f22050e61668b34887dd6bfe2be7f84619b4b57202674f45c5790b42f",
|
||||
"rawBytes": 524015,
|
||||
"gzipBytes": 135245,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-wolz_s2E.js",
|
||||
"sha256": "1bb9b33c9395fa9f2c85cb534e4e92354a0563efc45522e078ffe9da6fdc0c14",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-zkpLLWyG.js",
|
||||
"sha256": "4cf023f49c8315f3ca2866086169677326c450ad96aac0a36f299f811df7f5bc",
|
||||
"rawBytes": 27120,
|
||||
"gzipBytes": 6720,
|
||||
"gzipBytes": 6721,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-B6HYqsoo.js",
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/backdrop-pick-DAhkK64J.js",
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "c45de5b9d825097729b03b8ee0063ca7424236137b63a44bdec36aada307b0a0",
|
||||
"sha256": "b526f327c3c51c30c72fc2fdef92c48f82a9f6334839ee24d07120895d46386f",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 797,
|
||||
"gzipBytes": 795,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-CaTFHDy3.js"
|
||||
"houseplan-assets/houseplan-card-DdUxnMX-.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__="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";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-CaTFHDy3.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__="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";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-DdUxnMX-.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__="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";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-CaTFHDy3.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-B6HYqsoo.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";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__="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";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-DdUxnMX-.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-DAhkK64J.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";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":""}">
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="aa9514085162d317577432073166a2385a0d511669f776f5268540be9317efef";try{await import("./houseplan-assets/houseplan-card-CaTFHDy3.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__="a75fd51476e6981375898466243f1f67acd5af627334883a490aeed45b89813f";try{await import("./houseplan-assets/houseplan-card-DdUxnMX-.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)}
|
||||
|
||||
@@ -12076,8 +12076,16 @@ export class HouseplanCard extends LitElement {
|
||||
return key ? this._climate().get(key)?.hum ?? null : null;
|
||||
}
|
||||
|
||||
// Ключи сравниваются только по ссылке (`===`), значение не читается ни разу.
|
||||
// Поэтому `unknown` для hass точнее любого структурного типа: он и запрещает
|
||||
// случайно воспользоваться содержимым, и не врёт про форму объекта, которую
|
||||
// HA нам не обещает. Правила и маркеры при этом типизированы по-настоящему.
|
||||
private _climateCache: {
|
||||
h: any; r: any; mk: any; ex: string[] | undefined; m: Map<string, AreaClimate>;
|
||||
h: unknown;
|
||||
r: CompiledIconRule[] | undefined;
|
||||
mk: Marker[] | undefined;
|
||||
ex: string[] | undefined;
|
||||
m: Map<string, AreaClimate>;
|
||||
} | null = null;
|
||||
|
||||
/**
|
||||
|
||||
@@ -11824,12 +11824,19 @@ public _discoveryFilterState(dialog: DeviceInboxDialogState): {
|
||||
* identifier domains), for the exclusion search. */
|
||||
private _registryIntegrations(): string[] {
|
||||
const found = new Set<string>();
|
||||
const full = this.host._fullRegistryHass;
|
||||
for (const reg of Object.values<any>(full?.entities || {})) {
|
||||
// Реестр HA нетипизирован на своей стороне, но здесь читаются ровно два
|
||||
// поля и оба защищённо, поэтому хватает минимальной структурной формы —
|
||||
// она честнее `any`: описывает то, на что код действительно опирается.
|
||||
const full = this.host._fullRegistryHass as {
|
||||
entities?: Record<string, { platform?: unknown } | undefined>;
|
||||
devices?: Record<string, { identifiers?: unknown[] } | undefined>;
|
||||
} | null | undefined;
|
||||
for (const reg of Object.values(full?.entities || {})) {
|
||||
if (reg?.platform) found.add(String(reg.platform));
|
||||
}
|
||||
for (const device of Object.values<any>(full?.devices || {})) {
|
||||
const domain = Array.isArray(device?.identifiers?.[0]) ? device.identifiers[0][0] : null;
|
||||
for (const device of Object.values(full?.devices || {})) {
|
||||
const first = device?.identifiers?.[0];
|
||||
const domain = Array.isArray(first) ? first[0] : null;
|
||||
if (domain) found.add(String(domain));
|
||||
}
|
||||
return [...found].sort();
|
||||
@@ -12060,9 +12067,9 @@ public _renderDeviceInbox(): TemplateResult {
|
||||
</div>
|
||||
<div class="device-inbox-reason">
|
||||
${row.reason === 'excluded_integration' && row.integration
|
||||
? this.host._t('device_inbox.reason_excluded_integration' as any,
|
||||
? this.host._t('device_inbox.reason_excluded_integration',
|
||||
{ integration: row.integration })
|
||||
: this.host._t(`device_inbox.reason_${row.reason}` as any)}
|
||||
: this.host._t(`device_inbox.reason_${row.reason}` as I18nKey)}
|
||||
${status ? html`<span class="device-inbox-status">${status}</span>` : nothing}
|
||||
</div>
|
||||
<code>${row.binding}</code>
|
||||
|
||||
Reference in New Issue
Block a user