iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
4 lines • 17.6 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[46152],{62384:function(e,t,n){n.d(t,{v:function(){return r}});n(74423),n(62953);const r=(e,t,n,r)=>{const[i,o,a]=e.split(".",3);return Number(i)>t||Number(i)===t&&(void 0===r?Number(o)>=n:Number(o)>n)||void 0!==r&&Number(i)===t&&Number(o)===n&&Number(a)>=r}},46190:function(e,t,n){n.d(t,{FD:function(){return u},Is:function(){return r},JF:function(){return i},gt:function(){return o},jj:function(){return s},oL:function(){return c},yd:function(){return a}});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);const r=["alert","button","climate","cover","configurator","event","input_button","input_select","input_number","input_text","humidifier","lawn_mower","lock","media_player","number","scene","script","select","timer","text","update","vacuum","water_heater"],i=["sensor","binary_sensor","calendar","camera","device_tracker","image","weather"],o=["assist_satellite","conversation","stt","tts"],a=["automation","button","cover","date","datetime","fan","group","humidifier","input_boolean","input_button","input_datetime","input_number","input_select","input_text","light","lock","media_player","number","scene","script","select","switch","text","time","vacuum","valve"],s=["closed","locked","off"],u=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),c=new Set(["camera","image","media_player"])},93905:function(e,t,n){n.d(t,{I:function(){return o}});n(16280),n(44114),n(18111),n(7588),n(69112),n(33110);class r{addFromStorage(e){if(!this._storage[e]){const t=this.storage.getItem(e);t&&(this._storage[e]=JSON.parse(t))}}subscribeChanges(e,t){return this._listeners[e]?this._listeners[e].push(t):this._listeners[e]=[t],()=>{this.unsubscribeChanges(e,t)}}unsubscribeChanges(e,t){if(!(e in this._listeners))return;const n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}hasKey(e){return e in this._storage}getValue(e){return this._storage[e]}setValue(e,t){const n=this._storage[e];this._storage[e]=t;try{void 0===t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify(t))}catch(r){}finally{this._listeners[e]&&this._listeners[e].forEach(e=>e(n,t))}}constructor(e=window.localStorage){this._storage={},this._listeners={},this.storage=e,this.storage===window.localStorage&&window.addEventListener("storage",e=>{e.key&&this.hasKey(e.key)&&(this._storage[e.key]=e.newValue?JSON.parse(e.newValue):e.newValue,this._listeners[e.key]&&this._listeners[e.key].forEach(t=>t(e.oldValue?JSON.parse(e.oldValue):e.oldValue,this._storage[e.key])))})}}const i={};function o(e){return(t,n)=>{if("object"==typeof n)throw new Error("This decorator does not support this compilation type.");const o=e.storage||"localStorage";let a;o&&o in i?a=i[o]:(a=new r(window[o]),i[o]=a);const s=e.key||String(n);a.addFromStorage(s);const u=!1!==e.subscribe?e=>a.subscribeChanges(s,(t,r)=>{e.requestUpdate(n,t)}):void 0,c=()=>a.hasKey(s)?e.deserializer?e.deserializer(a.getValue(s)):a.getValue(s):void 0,l=(t,r)=>{let i;e.state&&(i=c()),a.setValue(s,e.serializer?e.serializer(r):r),e.state&&t.requestUpdate(n,i)},d=t.performUpdate;if(t.performUpdate=function(){this.__initialized=!0,d.call(this)},e.subscribe){const e=t.connectedCallback,n=t.disconnectedCallback;t.connectedCallback=function(){e.call(this);const t=this;t.__unbsubLocalStorage||(t.__unbsubLocalStorage=null==u?void 0:u(this))},t.disconnectedCallback=function(){var e;n.call(this);const t=this;null===(e=t.__unbsubLocalStorage)||void 0===e||e.call(t),t.__unbsubLocalStorage=void 0}}const h=Object.getOwnPropertyDescriptor(t,n);let f;if(void 0===h)f={get(){return c()},set(e){(this.__initialized||void 0===c())&&l(this,e)},configurable:!0,enumerable:!0};else{const e=h.set;f=Object.assign(Object.assign({},h),{},{get(){return c()},set(t){(this.__initialized||void 0===c())&&l(this,t),null==e||e.call(this,t)}})}Object.defineProperty(t,n,f)}}},68348:function(e,t,n){n.d(t,{u:function(){return r}});n(18111),n(13579);const r=e=>{var t,n;if(e.some(e=>"tagName"in e&&("HA-MENU"===e.tagName||"HA-CODE-EDITOR"===e.tagName)))return!1;const r=e[0];if("TEXTAREA"===r.tagName||"HA-SELECT"===(null===(t=r.parentElement)||void 0===t?void 0:t.tagName)||"HA-DROPDOWN"===(null===(n=r.parentElement)||void 0===n?void 0:n.tagName))return!1;if("INPUT"!==r.tagName)return!0;switch(r.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},76830:function(e,t,n){n.d(t,{d:function(){return r}});n(18111),n(20116);const r=(e,t=!0)=>{if(e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)return;const n=e.composedPath().find(e=>"A"===e.tagName);if(!n||n.target||n.hasAttribute("download")||"external"===n.getAttribute("rel"))return;let r=n.href;if(!r||-1!==r.indexOf("mailto:"))return;const i=window.location,o=i.origin||i.protocol+"//"+i.host;return r.startsWith(o)&&(r=r.slice(o.length),"#"!==r)?(t&&e.preventDefault(),r):void 0}},28455:function(e,t,n){n.d(t,{EX:function(){return i},jI:function(){return o},ln:function(){return r}});const r=(e,t,n,r,i)=>{const a=t[e.entity_id];return a?o(a,t,n,r,i):{entity:null,device:null,area:null,floor:null}},i=(e,t,n)=>{const r=t[e];if(!r)return;const i=r.device_id,o=i?n[i]:void 0;return r.area_id||(null==o?void 0:o.area_id)||void 0},o=(e,t,n,r,i)=>{const o=t[e.entity_id],a=null==e?void 0:e.device_id,s=a?n[a]:void 0,u=(null==e?void 0:e.area_id)||(null==s?void 0:s.area_id),c=u?r[u]:void 0,l=null==c?void 0:c.floor_id;return{entity:o,device:s||null,area:c||null,floor:(l?i[l]:void 0)||null}}},1974:function(e,t,n){n.d(t,{l:function(){return r}});const r=e=>{const t=e.path.indexOf("/",1);return-1===t?{prefix:e.prefix+e.path,path:""}:{prefix:e.prefix+e.path.substring(0,t),path:e.path.substring(t)}}},7553:function(e,t,n){n.d(t,{h:function(){return i}});n(16280),n(3362),n(62953);class r extends Error{constructor(e,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="TimeoutError",this.timeout=e,this.message=`Timed out in ${e} ms.`}}const i=(e,t)=>{const n=new Promise((t,n)=>{setTimeout(()=>{n(new r(e))},e)});return Promise.race([t,n])}},64481:function(e,t,n){n.d(t,{D:function(){return i},J:function(){return a}});n(16280),n(3362),n(55815),n(64979),n(79739);let r=!1;try{r="true"===window.localStorage.getItem("disableViewTransition")}catch(s){}const i=e=>{r=e},o=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},a=e=>{if(!document.startViewTransition||r)return e(!1),Promise.resolve();let t=!1;try{const n=document.startViewTransition(()=>{t=!0,e(!0)});return n.ready.catch(o),n.finished.catch(o)}catch(n){return console.warn("View transition failed, falling back to direct execution.",n),t?Promise.reject(n):(e(!1),Promise.resolve())}}},65829:function(e,t,n){n.a(e,async function(e,r){try{n.r(t),n.d(t,{HaSpinner:function(){return d}});var i=n(40445),o=n(55262),a=n(5124),s=n(67576),u=e([o]);o=(u.then?(await u)():u)[0];let c,l=e=>e;class d extends o.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[o.A.styles,(0,a.AH)(c||(c=l`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}(0,i.Cg)([(0,s.MZ)()],d.prototype,"size",void 0),d=(0,i.Cg)([(0,s.EM)("ha-spinner")],d),r()}catch(c){r(c)}})},87225:function(e,t,n){n.d(t,{GS:function(){return o},I8:function(){return s},YQ:function(){return d},bn:function(){return c},fg:function(){return u},oW:function(){return a},ob:function(){return l}});n(74423);var r=n(71727),i=n(68246);const o=[{groups:{dynamicGroups:{},time_location:{icon:"M15,12H16.5V16.25L19.36,17.94L18.61,19.16L15,17V12M23,16A7,7 0 0,1 16,23C13,23 10.4,21.08 9.42,18.4L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2H19.5A0.5,0.5 0 0,1 20,2.5V10.25C21.81,11.5 23,13.62 23,16M9,16C9,12.83 11.11,10.15 14,9.29V6.11L8,4V15.89L9,16.24C9,16.16 9,16.08 9,16M16,11A5,5 0 0,0 11,16A5,5 0 0,0 16,21A5,5 0 0,0 21,16A5,5 0 0,0 16,11Z",members:{sun:{},time:{},zone:{}}},helpers:{},template:{},trigger:{},other:{}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.generic.label",generic:!0,groups:{device:{},entity:{icon:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",members:{state:{},numeric_state:{}}}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.custom_integrations.label",groups:{customDynamicGroups:{}}}],a={and:{},or:{},not:{}},s=["and","or","not"],u=["ha-automation-condition-and","ha-automation-condition-not","ha-automation-condition-or"],c=(e,t)=>e.connection.subscribeMessage(t,{type:"condition_platforms/subscribe"}),l=e=>e.includes(".")?(0,r.m)(e):e,d=e=>e.includes(".")?(0,i.Y)(e):"_"},88360:function(e,t,n){n.d(t,{j:function(){return i}});var r=n(1087);const i=(e,t)=>{(0,r.r)(e,"haptic",t)}},99774:function(e,t,n){n.d(t,{Dq:function(){return u},EN:function(){return c},FW:function(){return _},JF:function(){return o},Oi:function(){return r},Q:function(){return m},W5:function(){return y},Wp:function(){return d},hL:function(){return h},kO:function(){return l},pk:function(){return v},qx:function(){return a},sn:function(){return p},vI:function(){return f}});n(74423),n(18111),n(20116),n(69112),n(62953);const r="notfound",i="profile",o="lovelace",a=["_my_redirect",r,"app"],s="home",u=e=>{var t;return Boolean(null===(t=e.panels.lovelace)||void 0===t?void 0:t.config)},c=e=>{var t,n;const r=(null===(t=e.userData)||void 0===t?void 0:t.default_panel)||(null===(n=e.systemData)||void 0===n?void 0:n.default_panel)||(()=>{const e=window.localStorage.getItem("defaultPanel");return e?JSON.parse(e):null})()||s;return r!==o||u(e)?r:s},l=e=>{var t,n;const i=c(e);return null!==(t=null!==(n=i?e.panels[i]:void 0)&&void 0!==n?n:e.panels[s])&&void 0!==t?t:e.panels[r]},d=e=>[i,r].includes(e.url_path)?`panel.${e.url_path}`:`panel.${e.title}`,h=(e,t)=>{const n=d(t);return e.localize(n)||t.title||void 0},f=(e,t)=>{if(!e.panels)return;const n=Object.values(e.panels).find(e=>e.url_path===t);return n?h(e,n):void 0},p=(e,t,n)=>{for(const r of Object.values(n)){const n=r.find(e=>t.startsWith(e.path));if(n){if(n.translationKey){const t=e.localize(n.translationKey);if(t)return t}if(n.name)return n.name}}},m=e=>e.icon||"profile"!==e.component_name?e.icon||void 0:"mdi:account",g={calendar:"M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",energy:"M11 15H6L13 1V9H18L11 23V15Z",history:"M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M9 17H7V10H9V17M13 17H11V7H13V17M17 17H15V13H17V17Z",logbook:"M5,9.5L7.5,14H2.5L5,9.5M3,4H7V8H3V4M5,20A2,2 0 0,0 7,18A2,2 0 0,0 5,16A2,2 0 0,0 3,18A2,2 0 0,0 5,20M9,5V7H21V5H9M9,19H21V17H9V19M9,13H21V11H9V13Z",map:"M20,2H4A2,2 0 0,0 2,4V16A2,2 0 0,0 4,18H8L12,22L16,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M12,4.3C13.5,4.3 14.7,5.5 14.7,7C14.7,8.5 13.5,9.7 12,9.7C10.5,9.7 9.3,8.5 9.3,7C9.3,5.5 10.5,4.3 12,4.3M18,15H6V14.1C6,12.1 10,11 12,11C14,11 18,12.1 18,14.1V15Z",profile:"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z","media-browser":"M4,6H2V20A2,2 0 0,0 4,22H18V20H4V6M20,2H8A2,2 0 0,0 6,4V16A2,2 0 0,0 8,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M12,14.5V5.5L18,10L12,14.5Z",todo:"M19 3H14.82C14.4 1.84 13.3 1 12 1S9.6 1.84 9.18 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M7 8H9V12H8V9H7V8M10 17V18H7V17.08L9 15H7V14H9.25C9.66 14 10 14.34 10 14.75C10 14.95 9.92 15.14 9.79 15.27L8.12 17H10M11 4C11 3.45 11.45 3 12 3S13 3.45 13 4 12.55 5 12 5 11 4.55 11 4M17 17H12V15H17V17M17 11H12V9H17V11Z"},_=e=>g[e.url_path],v=59509==n.j?[i,"config",r]:null,y=(e,t,n)=>e.callWS(Object.assign({type:"frontend/update_panel",url_path:t},n))},71606:function(e,t,n){n.d(t,{f:function(){return i},o:function(){return r}});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);const r=new Set(["automation","script","scene","group"]),i=(e,t,n)=>e.callWS({type:"search/related",item_type:t,item_id:n})},46927:function(e,t,n){n.d(t,{$W:function(){return l},Hg:function(){return o},Wj:function(){return a},Yk:function(){return d},jG:function(){return i},mo:function(){return c},ow:function(){return s},zt:function(){return u}});n(3362);var r=n(48250),i=function(e){return e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.quote_decimal="quote_decimal",e.space_comma="space_comma",e.none="none",e}({}),o=function(e){return e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24",e}({}),a=function(e){return e.local="local",e.server="server",e}({}),s=function(e){return e.language="language",e.system="system",e.DMY="DMY",e.MDY="MDY",e.YMD="YMD",e}({}),u=function(e){return e.language="language",e.monday="monday",e.tuesday="tuesday",e.wednesday="wednesday",e.thursday="thursday",e.friday="friday",e.saturday="saturday",e.sunday="sunday",e}({});const c=(e,t)=>(0,r.oT)(e.connection,"language",t),l=(e,t)=>(0,r.Bp)(e.connection,"language",t),d=async(e,t,n,r,i)=>(await e.callWS({type:"frontend/get_translations",language:t,category:n,integration:r,config_flow:i})).resources},324:function(e,t,n){n.d(t,{a:function(){return c}});n(18111),n(7588),n(3362),n(27495),n(62953);var r=n(40445),i=n(5124),o=n(67576),a=n(22786),s=n(91926),u=n(1974);class c extends i.mN{createRenderRoot(){return this}update(e){super.update(e);const t=this.routerOptions||{routes:{}};if(t&&t.initialLoad&&!this._initialLoadDone)return;if(!e.has("route"))return void(this.lastChild&&!this._currentLoadProm&&this.updatePageEl(this.lastChild,e));const n=this.route,r=t.defaultPage;if(n&&""===n.path&&void 0!==r){const e=window.location.search;(0,s.oo)(`${n.prefix}/${r}${e}`,{replace:!0})}let i=n?((e,t)=>{if(""===e)return t;const n=e.indexOf("/",1);return-1===n?e.substr(1):e.substr(1,n-1)})(n.path,r||""):"not_found",o=t.routes[i];for(;"string"==typeof o;)i=o,o=t.routes[i];if(t.beforeRender){const e=t.beforeRender(i);if(void 0!==e){for(i=e,o=t.routes[i];"string"==typeof o;)i=o,o=t.routes[i];n&&(0,s.oo)(`${n.prefix}/${e}${location.search}`,{replace:!0})}}if(this._currentPage===i)return void(this.lastChild&&this.route&&this.updatePageEl(this.lastChild,e));if(!o)return this._currentPage="",void(this.lastChild&&this.removeChild(this.lastChild));this._currentPage=i;const a=o.load?o.load():Promise.resolve();if(this._showLoadingScreenTimeout&&(clearTimeout(this._showLoadingScreenTimeout),this._showLoadingScreenTimeout=void 0),a.catch(e=>{console.error("Error loading page",i,e),this._currentPage===i&&(this.lastChild&&this.removeChild(this.lastChild),this._showLoadingScreenTimeout&&(clearTimeout(this._showLoadingScreenTimeout),this._showLoadingScreenTimeout=void 0),this.appendChild(this.createErrorScreen(`Error while loading page ${i}.`)))}),!t.showLoading)return void this._createPanel(t,i,o);let u=!1;this._showLoadingScreenTimeout=window.setTimeout(()=>{u||this._currentPage!==i||(this.lastChild&&this.removeChild(this.lastChild),this.appendChild(this.createLoadingScreen()))},400),this._currentLoadProm=a.then(()=>{this._currentLoadProm=void 0,this._currentPage===i&&(u=!0,this._createPanel(t,i,o))},()=>{this._currentLoadProm=void 0})}firstUpdated(e){super.firstUpdated(e);const t=this.routerOptions;t&&(t.preloadAll&&Object.values(t.routes).forEach(e=>"object"==typeof e&&e.load&&e.load()),t.initialLoad&&(setTimeout(()=>{this._initialLoadDone||this.appendChild(this.createLoadingScreen())},400),t.initialLoad().then(()=>{this._initialLoadDone=!0,this.requestUpdate("route")})))}createLoadingScreen(){return n.e(72057).then(n.bind(n,23296)),document.createElement("hass-loading-screen")}createErrorScreen(e){n.e(31975).then(n.bind(n,28794));const t=document.createElement("hass-error-screen");return t.error=e,t}async rebuild(){const e=this.route;void 0!==e&&(this.route=void 0,await this.updateComplete,void 0===this.route&&(this.route=e))}get pageRendered(){return this.updateComplete.then(()=>this._currentLoadProm)}createElement(e){return document.createElement(e)}updatePageEl(e,t){}get routeTail(){return this._computeTail(this.route)}_createPanel(e,t,n){this.lastChild&&this.removeChild(this.lastChild);const r=this._cache[t]||this.createElement(n.tag);this.updatePageEl(r),this.appendChild(r),(e.cacheAll||n.cache)&&(this._cache[t]=r)}constructor(...e){super(...e),this._currentPage="",this._cache={},this._initialLoadDone=!1,this._computeTail=(0,a.A)(u.l)}}(0,r.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"route",void 0)},37619:function(e,t,n){n.d(t,{X:function(){return o},s:function(){return i}});n(69112),n(33110);let r=!1;const i=e=>{r=e},o=(e,t)=>{const n=e.sendMessagePromise(t);return r&&console.log(`⬆️ Sent #${t.id}`,t),r&&n.then(e=>console.log(`⬇️ Received #${t.id}`,e&&"object"==typeof e?JSON.parse(JSON.stringify(e)):e),e=>console.error(`❌ Error #${t.id}`,e)),n}}}]);