iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 15.1 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["53031"],{71347:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(71695),i(9359),i(56475),i(70104),i(19423),i(47021),i(57243)),d=i(50778),o=i(36522),l=i(47194),s=i(45729),r=i(84346),c=e([r,s]);[r,s]=c.then?(await c)():c;let u,p=e=>e;(0,a.Z)([(0,d.Mo)("ha-entities-display-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"entitiesIds",value(){return[]}},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"expanded",value(){return!1}},{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!1}},{kind:"method",key:"render",value:function(){var e,t,i,a;const d=this.entitiesIds.map((e=>this.hass.states[e])).filter(Boolean).map((e=>({value:e.entity_id,label:(0,l.C)(e),icon:(0,s.gD)(this.hass,e)}))),o={order:null!==(e=null===(t=this.value)||void 0===t?void 0:t.order)&&void 0!==e?e:[],hidden:null!==(i=null===(a=this.value)||void 0===a?void 0:a.hidden)&&void 0!==i?i:[]};return(0,n.dy)(u||(u=p` <ha-items-display-editor .hass="${0}" .items="${0}" .value="${0}" -changed="${0}"></ha-items-display-editor> `),this.hass,d,o,this._itemDisplayChanged)}},{kind:"method",key:"_itemDisplayChanged",value:function(e){var t,i;e.stopPropagation();const a=e.detail.value,n=Object.assign(Object.assign({},this.value),a);0===(null===(t=n.hidden)||void 0===t?void 0:t.length)&&delete n.hidden,0===(null===(i=n.order)||void 0===i?void 0:i.length)&&delete n.order,(0,o.B)(this,"value-changed",{value:n})}}]}}),n.oi);t()}catch(u){t(u)}}))},5828:function(e,t,i){i.r(t),i.d(t,{HaIconButtonPrev:()=>r});var a=i(61701),n=(i(71695),i(47021),i(57243)),d=i(50778),o=i(5111);i(23334);let l,s=e=>e;let r=(0,a.Z)([(0,d.Mo)("ha-icon-button-prev")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_icon",value(){return"rtl"===o.E.document.dir?"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z":"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"}},{kind:"method",key:"render",value:function(){var e;return(0,n.dy)(l||(l=s` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.back"))||"Back",this._icon)}}]}}),n.oi)},83166:function(e,t,i){var a=i(61701),n=i(72621),d=(i(71695),i(47021),i(1105)),o=i(33990),l=i(57243),s=i(50778),r=i(5111);let c,u,p,f,h=e=>e;(0,a.Z)([(0,s.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"invalid",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:"icon",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,s.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return(0,l.dy)(c||(c=h` <span class="mdc-text-field__icon mdc-text-field__icon--${0}" tabindex="${0}"> <slot name="${0}Icon"></slot> </span> `),i,t?1:-1,i)}},{kind:"field",static:!0,key:"styles",value(){return[o.W,(0,l.iv)(u||(u=h`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`)),"rtl"===r.E.document.dir?(0,l.iv)(p||(p=h`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`)):(0,l.iv)(f||(f=h``))]}}]}}),d.P)},69919:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{EX:()=>f,Fj:()=>k,M$:()=>C,SO:()=>h,Sk:()=>g,TN:()=>S,UJ:()=>m,Ym:()=>w,hF:()=>v});i(19083),i(61893),i(9359),i(56475),i(70104),i(40251);var n=i(73358),d=i(73850),o=i(59847),l=i(75278),s=i(50602),r=i(1416),c=i(76131),u=i(72473),p=e([s]);s=(p.then?(await p)():p)[0];let f=function(e){return e[e.INSTALL=1]="INSTALL",e[e.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",e[e.PROGRESS=4]="PROGRESS",e[e.BACKUP=8]="BACKUP",e[e.RELEASE_NOTES=16]="RELEASE_NOTES",e}({});const h=e=>(0,l.e)(e,f.PROGRESS)&&null!==e.attributes.update_percentage,v=(e,t=!1)=>(e.state===n.uo||t&&Boolean(e.attributes.skipped_version))&&(0,l.e)(e,f.INSTALL),g=e=>!!e.attributes.in_progress,m=(e,t)=>e.callWS({type:"update/release_notes",entity_id:t}),x="ioBroker Core",b="ioBroker Supervisor",_="ioBroker Operating System",y=(e,t)=>Object.values(e).filter((e=>"update"===(0,o.N)(e))).sort(((e,i)=>e.attributes.title===x?-3:i.attributes.title===x?3:e.attributes.title===_?-2:i.attributes.title===_?2:e.attributes.title===b?-1:i.attributes.title===b?1:(0,r.fe)(e.attributes.title||e.attributes.friendly_name||"",i.attributes.title||i.attributes.friendly_name||"",t))),k=(e,t=!1)=>y(e).filter((e=>v(e,t))),C=async(e,t)=>{const i=y(t.states,t.locale.language).map((e=>e.entity_id));if(!i.length)return void(0,c.showAlertDialog)(e,{title:t.localize("ui.panel.config.updates.no_update_entities.title"),text:t.localize("ui.panel.config.updates.no_update_entities.description"),warning:!0});(0,u.C)(e,{message:t.localize("ui.panel.config.updates.checking_updates")});let a=0;const n=await t.connection.subscribeEvents((i=>{"update"===(0,d.M)(i.data.entity_id)&&(a++,(0,u.C)(e,{message:t.localize("ui.panel.config.updates.updates_refreshed",{count:a})}))}),"state_changed");await t.callService("homeassistant","update_entity",{entity_id:i}),await new Promise((e=>{setTimeout(e,15e3)})),n(),0===a&&(0,u.C)(e,{message:t.localize("ui.panel.config.updates.no_new_updates")})},w=(e,t)=>{const i=e.state,a=e.attributes;if("off"===i){return a.latest_version&&a.skipped_version===a.latest_version?a.latest_version:t.formatEntityState(e)}if("on"===i&&g(e)){return(0,l.e)(e,f.PROGRESS)&&null!==a.update_percentage?t.localize("ui.card.update.installing_with_progress",{progress:(0,s.uf)(a.update_percentage,t.locale,{maximumFractionDigits:a.display_precision,minimumFractionDigits:a.display_precision})}):t.localize("ui.card.update.installing")}return t.formatEntityState(e)},S=(e,t)=>{var i;if("hassio"!==(null===(i=t[e.entity_id])||void 0===i?void 0:i.domain))return"generic";const a=e.attributes.title||"";return a===x?"home_assistant":[x,b,_].includes(a)?"generic":"addon"};a()}catch(f){a(f)}}))},78756:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiAreasDashboardStrategyEditor:()=>b});var n=i(61701),d=(i(71695),i(9359),i(70104),i(19423),i(22139),i(47021),i(57243)),o=i(50778),l=i(36522),s=i(40487),r=i(71347),c=(i(23334),i(5828),i(65981),i(45538)),u=e([s,r,c]);[s,r,c]=u.then?(await u)():u;let p,f,h,v,g,m,x=e=>e,b=(0,n.Z)([(0,o.Mo)("hui-areas-dashboard-strategy-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._config=e}},{kind:"field",decorators:[(0,o.SB)()],key:"_area",value:void 0},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return d.Ld;if(this._area){const e=(0,c.yE)(this._area,this.hass),t=this.hass.areas[this._area];return(0,d.dy)(p||(p=x` <div class="toolbar"> <ha-icon-button-prev ="${0}"></ha-icon-button-prev> <p>${0}</p> </div> ${0} `),this._back,t.name,c.kt.map((t=>{var i;const a=e[t]||[],n=null===(i=this._config.areas_options)||void 0===i||null===(i=i[this._area])||void 0===i||null===(i=i.groups_options)||void 0===i?void 0:i[t];return(0,d.dy)(f||(f=x` <ha-expansion-panel header="${0}" expanded outlined> <ha-icon slot="leading-icon" .icon="${0}"></ha-icon> ${0} </ha-expansion-panel> `),c.Ge[t],c.d$[t],a.length?(0,d.dy)(h||(h=x` <ha-entities-display-editor .hass="${0}" .value="${0}" .label="${0}" -changed="${0}" .group="${0}" .area="${0}" .entitiesIds="${0}"></ha-entities-display-editor> `),this.hass,n,t,this._entitiesDisplayChanged,t,this._area,a):(0,d.dy)(v||(v=x` <p> No entities in this section, it will not be displayed. </p> `)))})))}const e=this._config.areas_display;return(0,d.dy)(g||(g=x` <ha-areas-display-editor .hass="${0}" .value="${0}" .label="${0}" -changed="${0}" expanded show-navigation-button -display-navigate-clicked="${0}"></ha-areas-display-editor> `),this.hass,e,this.hass.localize("ui.panel.lovelace.editor.strategy.areas.areas_display"),this._areasDisplayChanged,this._handleAreaNavigate)}},{kind:"method",key:"_back",value:function(){this._area&&(this._area=void 0)}},{kind:"method",key:"_handleAreaNavigate",value:function(e){this._area=e.detail.value}},{kind:"method",key:"_areasDisplayChanged",value:function(e){const t=e.detail.value,i=Object.assign(Object.assign({},this._config),{},{areas_display:t});(0,l.B)(this,"config-changed",{config:i})}},{kind:"method",key:"_entitiesDisplayChanged",value:function(e){var t,i;const a=e.detail.value,{group:n,area:d}=e.currentTarget,o=Object.assign(Object.assign({},this._config),{},{areas_options:Object.assign(Object.assign({},this._config.areas_options),{},{[d]:Object.assign(Object.assign({},null===(t=this._config.areas_options)||void 0===t?void 0:t[d]),{},{groups_options:Object.assign(Object.assign({},null===(i=this._config.areas_options)||void 0===i||null===(i=i[d])||void 0===i?void 0:i.groups_options),{},{[n]:a})})})});(0,l.B)(this,"config-changed",{config:o})}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,d.iv)(m||(m=x`.toolbar{display:flex;align-items:center}ha-expansion-panel{margin-bottom:8px}`))]}}]}}),d.oi);a()}catch(p){a(p)}}))},30511:function(e,t,i){i.r(t),i.d(t,{mdiHomeAssistant:()=>a});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"}}]);
//# sourceMappingURL=53031.6a1c1e715874dc61.js.map