UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 18.5 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["28751"],{92091:function(e,t,i){function o(e){return!!e&&(e instanceof Date&&!isNaN(e.valueOf()))}i.d(t,{Z:()=>o})},46467:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{D_:()=>$,NC:()=>f,Nh:()=>p,U8:()=>w,WB:()=>v,mn:()=>c,p6:()=>s,ud:()=>b,yQ:()=>_});i(63434),i(9359),i(1331),i(96829);var a=i(16485),n=i(27486),r=i(20382),d=i(11104),l=e([a,d]);[a,d]=l.then?(await l)():l;(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)})));const s=(e,t,i)=>u(t,i.time_zone).format(e),u=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),c=(e,t,i)=>h(t,i.time_zone).format(e),h=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),v=(e,t,i)=>{var o,a,n,d;const l=m(t,i.time_zone);if(t.date_format===r.t6.language||t.date_format===r.t6.system)return l.format(e);const s=l.formatToParts(e),u=null===(o=s.find((e=>"literal"===e.type)))||void 0===o?void 0:o.value,c=null===(a=s.find((e=>"day"===e.type)))||void 0===a?void 0:a.value,h=null===(n=s.find((e=>"month"===e.type)))||void 0===n?void 0:n.value,v=null===(d=s.find((e=>"year"===e.type)))||void 0===d?void 0:d.value,b=s.at(s.length-1);let y="literal"===(null==b?void 0:b.type)?null==b?void 0:b.value:"";"bg"===t.language&&t.date_format===r.t6.YMD&&(y="");return{[r.t6.DMY]:`${c}${u}${h}${u}${v}${y}`,[r.t6.MDY]:`${h}${u}${c}${u}${v}${y}`,[r.t6.YMD]:`${v}${u}${h}${u}${c}${y}`}[t.date_format]},m=(0,n.Z)(((e,t)=>{const i=e.date_format===r.t6.system?void 0:e.language;return e.date_format===r.t6.language||(e.date_format,r.t6.system),new Intl.DateTimeFormat(i,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)})})),b=(e,t,i)=>y(t,i.time_zone).format(e),y=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,d.f)(e.time_zone,t)}))),f=(e,t,i)=>k(t,i.time_zone).format(e),k=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),p=(e,t,i)=>g(t,i.time_zone).format(e),g=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,d.f)(e.time_zone,t)}))),_=(e,t,i)=>C(t,i.time_zone).format(e),C=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),$=(e,t,i)=>x(t,i.time_zone).format(e),x=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,d.f)(e.time_zone,t)}))),w=(e,t,i)=>M(t,i.time_zone).format(e),M=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,d.f)(e.time_zone,t)})));o()}catch(s){o(s)}}))},33570:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{Vu:()=>c,Zs:()=>b,mr:()=>s,xO:()=>v});var a=i(16485),n=i(27486),r=i(11104),d=i(16922),l=e([a,r]);[a,r]=l.then?(await l)():l;const s=(e,t,i)=>u(t,i.time_zone).format(e),u=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,r.f)(e.time_zone,t)}))),c=(e,t,i)=>h(t,i.time_zone).format(e),h=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,r.f)(e.time_zone,t)}))),v=(e,t,i)=>m(t,i.time_zone).format(e),m=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,r.f)(e.time_zone,t)}))),b=(e,t,i)=>y(t,i.time_zone).format(e),y=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,r.f)(e.time_zone,t)})));o()}catch(s){o(s)}}))},16922:function(e,t,i){i.d(t,{y:()=>n});i(19083),i(61006);var o=i(27486),a=i(20382);const n=(0,o.Z)((e=>{if(e.time_format===a.zt.language||e.time_format===a.zt.system){const t=e.time_format===a.zt.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===a.zt.am_pm}))},87733:function(e,t,i){i.d(t,{f:()=>o});const o=e=>e.charAt(0).toUpperCase()+e.slice(1)},45061:function(e,t,i){i.d(t,{K:()=>o});const o=e=>{switch(e.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},87974:function(e,t,i){i.d(t,{L:()=>a});var o=i(45061);const a=(e,t)=>"°"===e?"":t&&"%"===e?(0,o.K)(t):" "},80332:function(e,t,i){i.a(e,(async function(e,t){try{var o=i(61701),a=(i(19083),i(71695),i(9359),i(56475),i(70104),i(61006),i(47021),i(57243)),n=i(50778),r=i(25904),d=i(94279),l=e([d,r]);[d,r]=l.then?(await l)():l;let s,u=e=>e;(0,o.Z)([(0,n.Mo)("ha-entity-attribute-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"entityId",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"hide-attributes"})],key:"hideAttributes",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autofocus",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"allow-custom-value"})],key:"allowCustomValue",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_opened",value(){return!1}},{kind:"field",decorators:[(0,n.IO)("ha-combo-box",!0)],key:"_comboBox",value:void 0},{kind:"method",key:"shouldUpdate",value:function(e){return!(!e.has("_opened")&&this._opened)}},{kind:"method",key:"updated",value:function(e){if(e.has("_opened")&&this._opened){const e=this.entityId?this.hass.states[this.entityId]:void 0;this._comboBox.items=e?Object.keys(e.attributes).filter((e=>{var t;return!(null!==(t=this.hideAttributes)&&void 0!==t&&t.includes(e))})).map((t=>({value:t,label:(0,r.computeAttributeNameDisplay)(this.hass.localize,e,this.hass.entities,t)}))):[]}}},{kind:"method",key:"render",value:function(){var e;return this.hass?(0,a.dy)(s||(s=u` <ha-combo-box .hass="${0}" .value="${0}" .autofocus="${0}" .label="${0}" .disabled="${0}" .required="${0}" .helper="${0}" .allowCustomValue="${0}" item-value-path="value" item-label-path="label" @opened-changed="${0}" @value-changed="${0}"> </ha-combo-box> `),this.hass,this.value?(0,r.computeAttributeNameDisplay)(this.hass.localize,this.hass.states[this.entityId],this.hass.entities,this.value):"",this.autofocus,null!==(e=this.label)&&void 0!==e?e:this.hass.localize("ui.components.entity.entity-attribute-picker.attribute"),this.disabled||!this.entityId,this.required,this.helper,this.allowCustomValue,this._openedChanged,this._valueChanged):a.Ld}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_valueChanged",value:function(e){this.value=e.detail.value}}]}}),a.oi);t()}catch(s){t(s)}}))},94279:function(e,t,i){i.a(e,(async function(e,t){try{var o=i(61701),a=i(72621),n=(i(71695),i(9359),i(31526),i(40251),i(47021),i(2394)),r=i(28737),d=i(43631),l=i(57243),s=i(50778),u=i(20552),c=i(36522),h=(i(23334),i(7285),i(83166),e([r]));r=(h.then?(await h)():h)[0];let v,m,b,y,f,k,p=e=>e;const g="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",_="M7,10L12,15L17,10H7Z",C="M7,15L12,10L17,15H7Z";(0,d.hC)("vaadin-combo-box-item",(0,l.iv)(v||(v=p`:host{padding:0!important}:host([focused]:not([disabled])){background-color:rgba(var(--rgb-primary-text-color,0,0,0),.12)}:host([selected]:not([disabled])){background-color:transparent;color:var(--mdc-theme-primary);--mdc-ripple-color:var(--mdc-theme-primary);--mdc-theme-text-primary-on-background:var(--mdc-theme-primary)}:host([selected]:not([disabled])):before{background-color:var(--mdc-theme-primary);opacity:.12;content:"";position:absolute;top:0;left:0;width:100%;height:100%}:host([selected][focused]:not([disabled])):before{opacity:.24}:host(:hover:not([disabled])){background-color:transparent}[part=content]{width:100%}[part=checkmark]{display:none}`)));(0,o.Z)([(0,s.Mo)("ha-combo-box")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"validationMessage",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"invalid",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"items",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"filteredItems",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"dataProvider",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"allow-custom-value",type:Boolean})],key:"allowCustomValue",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:"item-value-path"})],key:"itemValuePath",value(){return"value"}},{kind:"field",decorators:[(0,s.Cb)({attribute:"item-label-path"})],key:"itemLabelPath",value(){return"label"}},{kind:"field",decorators:[(0,s.Cb)({attribute:"item-id-path"})],key:"itemIdPath",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"renderer",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"opened",value(){return!1}},{kind:"field",decorators:[(0,s.IO)("vaadin-combo-box-light",!0)],key:"_comboBox",value:void 0},{kind:"field",decorators:[(0,s.IO)("ha-textfield",!0)],key:"_inputElement",value:void 0},{kind:"field",key:"_overlayMutationObserver",value:void 0},{kind:"field",key:"_bodyMutationObserver",value:void 0},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,null===(e=this._comboBox)||void 0===e||e.open()}},{kind:"method",key:"focus",value:async function(){var e,t;await this.updateComplete,await(null===(e=this._inputElement)||void 0===e?void 0:e.updateComplete),null===(t=this._inputElement)||void 0===t||t.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),this._overlayMutationObserver&&(this._overlayMutationObserver.disconnect(),this._overlayMutationObserver=void 0),this._bodyMutationObserver&&(this._bodyMutationObserver.disconnect(),this._bodyMutationObserver=void 0)}},{kind:"get",key:"selectedItem",value:function(){return this._comboBox.selectedItem}},{kind:"method",key:"setInputValue",value:function(e){this._comboBox.value=e}},{kind:"method",key:"render",value:function(){var e;return(0,l.dy)(m||(m=p` <vaadin-combo-box-light .itemValuePath="${0}" .itemIdPath="${0}" .itemLabelPath="${0}" .items="${0}" .value="${0}" .filteredItems="${0}" .dataProvider="${0}" .allowCustomValue="${0}" .disabled="${0}" .required="${0}" ${0} @opened-changed="${0}" @filter-changed="${0}" @value-changed="${0}" attr-for-value="value"> <ha-textfield label="${0}" placeholder="${0}" ?disabled="${0}" ?required="${0}" validationMessage="${0}" .errorMessage="${0}" class="input" autocapitalize="none" autocomplete="off" autocorrect="off" input-spellcheck="false" .suffix="${0}" .icon="${0}" .invalid="${0}" .helper="${0}" helperPersistent> <slot name="icon" slot="leadingIcon"></slot> </ha-textfield> ${0} <ha-svg-icon role="button" tabindex="-1" aria-label="${0}" aria-expanded="${0}" class="toggle-button" .path="${0}" @click="${0}"></ha-svg-icon> </vaadin-combo-box-light> `),this.itemValuePath,this.itemIdPath,this.itemLabelPath,this.items,this.value||"",this.filteredItems,this.dataProvider,this.allowCustomValue,this.disabled,this.required,(0,n.t)(this.renderer||this._defaultRowRenderer),this._openedChanged,this._filterChanged,this._valueChanged,(0,u.o)(this.label),(0,u.o)(this.placeholder),this.disabled,this.required,(0,u.o)(this.validationMessage),this.errorMessage,(0,l.dy)(b||(b=p`<div style="width:28px" role="none presentation"></div>`)),this.icon,this.invalid,this.helper,this.value?(0,l.dy)(y||(y=p`<ha-svg-icon role="button" tabindex="-1" aria-label="${0}" class="clear-button" .path="${0}" @click="${0}"></ha-svg-icon>`),(0,u.o)(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.clear")),g,this._clearValue):"",(0,u.o)(this.label),this.opened?"true":"false",this.opened?C:_,this._toggleOpen)}},{kind:"field",key:"_defaultRowRenderer",value(){return e=>(0,l.dy)(f||(f=p`<ha-list-item> ${0} </ha-list-item>`),this.itemLabelPath?e[this.itemLabelPath]:e)}},{kind:"method",key:"_clearValue",value:function(e){e.stopPropagation(),(0,c.B)(this,"value-changed",{value:void 0})}},{kind:"method",key:"_toggleOpen",value:function(e){var t,i;this.opened?(null===(t=this._comboBox)||void 0===t||t.close(),e.stopPropagation()):null===(i=this._comboBox)||void 0===i||i.inputElement.focus()}},{kind:"method",key:"_openedChanged",value:function(e){e.stopPropagation();const t=e.detail.value;if(setTimeout((()=>{this.opened=t}),0),(0,c.B)(this,"opened-changed",{value:e.detail.value}),t){const e=document.querySelector("vaadin-combo-box-overlay");e&&this._removeInert(e),this._observeBody()}else{var i;null===(i=this._bodyMutationObserver)||void 0===i||i.disconnect(),this._bodyMutationObserver=void 0}}},{kind:"method",key:"_observeBody",value:function(){"MutationObserver"in window&&!this._bodyMutationObserver&&(this._bodyMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&this._removeInert(e)})),e.removedNodes.forEach((e=>{var t;"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&(null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0)}))}))})),this._bodyMutationObserver.observe(document.body,{childList:!0}))}},{kind:"method",key:"_removeInert",value:function(e){var t;if(e.inert)return e.inert=!1,null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),void(this._overlayMutationObserver=void 0);"MutationObserver"in window&&!this._overlayMutationObserver&&(this._overlayMutationObserver=new MutationObserver((e=>{e.forEach((e=>{if("inert"===e.attributeName){const i=e.target;var t;if(i.inert)null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0,i.inert=!1}}))})),this._overlayMutationObserver.observe(e,{attributes:!0}))}},{kind:"method",key:"_filterChanged",value:function(e){e.stopPropagation(),(0,c.B)(this,"filter-changed",{value:e.detail.value})}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this.allowCustomValue||(this._comboBox._closeOnBlurIsPrevented=!0);const t=e.detail.value;t!==this.value&&(0,c.B)(this,"value-changed",{value:t||void 0})}},{kind:"field",static:!0,key:"styles",value(){return(0,l.iv)(k||(k=p`:host{display:block;width:100%}vaadin-combo-box-light{position:relative;--vaadin-combo-box-overlay-max-height:calc(45vh - 56px)}ha-textfield{width:100%}ha-textfield>ha-icon-button{--mdc-icon-button-size:24px;padding:2px;color:var(--secondary-text-color)}ha-svg-icon{color:var(--input-dropdown-icon-color);position:absolute;cursor:pointer}.toggle-button{right:12px;top:-10px;inset-inline-start:initial;inset-inline-end:12px;direction:var(--direction)}:host([opened]) .toggle-button{color:var(--primary-color)}.clear-button{--mdc-icon-size:20px;top:-7px;right:36px;inset-inline-start:initial;inset-inline-end:36px;direction:var(--direction)}`))}}]}}),l.oi);t()}catch(v){t(v)}}))},47622:function(e,t,i){i.a(e,(async function(e,o){try{i.r(t),i.d(t,{HaSelectorAttribute:()=>v});var a=i(61701),n=i(72621),r=(i(71695),i(47021),i(57243)),d=i(50778),l=i(36522),s=i(80332),u=e([s]);s=(u.then?(await u)():u)[0];let c,h=e=>e,v=(0,a.Z)([(0,d.Mo)("ha-selector-attribute")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value(){return!0}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"context",value:void 0},{kind:"method",key:"render",value:function(){var e,t,i;return(0,r.dy)(c||(c=h` <ha-entity-attribute-picker .hass="${0}" .entityId="${0}" .hideAttributes="${0}" .value="${0}" .label="${0}" .helper="${0}" .disabled="${0}" .required="${0}" allow-custom-value></ha-entity-attribute-picker> `),this.hass,(null===(e=this.selector.attribute)||void 0===e?void 0:e.entity_id)||(null===(t=this.context)||void 0===t?void 0:t.filter_entity),null===(i=this.selector.attribute)||void 0===i?void 0:i.hide_attributes,this.value,this.label,this.helper,this.disabled,this.required)}},{kind:"method",key:"updated",value:function(e){var t;if((0,n.Z)(i,"updated",this,3)([e]),!this.value||null!==(t=this.selector.attribute)&&void 0!==t&&t.entity_id||!e.has("context"))return;const o=e.get("context");if(!this.context||!o||o.filter_entity===this.context.filter_entity)return;let a=!1;if(this.context.filter_entity){const e=this.hass.states[this.context.filter_entity];e&&this.value in e.attributes||(a=!0)}else a=void 0!==this.value;a&&(0,l.B)(this,"value-changed",{value:void 0})}}]}}),r.oi);o()}catch(c){o(c)}}))}}]); //# sourceMappingURL=28751.e45f900e09d34765.js.map