iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 25.5 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["78823"],{27192:function(e,i,t){t.a(e,(async function(e,i){try{var a=t(61701),s=(t(63721),t(19083),t(71695),t(92745),t(9359),t(56475),t(1331),t(31526),t(70104),t(52924),t(19423),t(40251),t(92519),t(42179),t(89256),t(24931),t(88463),t(57449),t(19814),t(61006),t(47021),t(57243)),n=t(50778),l=t(27486),d=t(95262),o=t(36522),r=t(73850),c=t(97969),h=t(75278),v=t(57816),u=t(41063),p=t(73192),f=(t(83456),t(23334),t(66671),t(46179)),y=(t(30509),t(64889),t(86709)),g=e([f,y]);[f,y]=g.then?(await g)():g;let k,_,b,m,$,x,w,j,C,O,B,F,S,z,L=e=>e;const M="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",E=(e,i)=>"object"==typeof i?!!Array.isArray(i)&&i.some((i=>e.includes(i))):e.includes(i),A=e=>e.selector&&!e.required&&!("boolean"in e.selector&&e.default);(0,a.Z)([(0,n.Mo)("ha-service-control")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),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:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:"show-advanced",type:Boolean})],key:"showAdvanced",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:"hide-picker",type:Boolean,reflect:!0})],key:"hidePicker",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:"hide-description",type:Boolean})],key:"hideDescription",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_value",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_checkedKeys",value(){return new Set}},{kind:"field",decorators:[(0,n.SB)()],key:"_manifest",value:void 0},{kind:"field",decorators:[(0,n.IO)("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"method",key:"willUpdate",value:function(e){var i,t,a,s,n,l,d,c;if(this.hasUpdated||(this.hass.loadBackendTranslation("services"),this.hass.loadBackendTranslation("selector")),!e.has("value"))return;const h=e.get("value");(null==h?void 0:h.action)!==(null===(i=this.value)||void 0===i?void 0:i.action)&&(this._checkedKeys=new Set);const v=this._getServiceInfo(null===(t=this.value)||void 0===t?void 0:t.action,this.hass.services);var u;null!==(a=this.value)&&void 0!==a&&a.action?null!=h&&h.action&&(0,r.M)(this.value.action)===(0,r.M)(h.action)||this._fetchManifest((0,r.M)(null===(u=this.value)||void 0===u?void 0:u.action)):this._manifest=void 0;if(v&&"target"in v&&(null!==(s=this.value)&&void 0!==s&&null!==(s=s.data)&&void 0!==s&&s.entity_id||null!==(n=this.value)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&n.area_id||null!==(l=this.value)&&void 0!==l&&null!==(l=l.data)&&void 0!==l&&l.device_id)){var p,f,y;const e=Object.assign({},this.value.target);!this.value.data.entity_id||null!==(p=this.value.target)&&void 0!==p&&p.entity_id||(e.entity_id=this.value.data.entity_id),!this.value.data.area_id||null!==(f=this.value.target)&&void 0!==f&&f.area_id||(e.area_id=this.value.data.area_id),!this.value.data.device_id||null!==(y=this.value.target)&&void 0!==y&&y.device_id||(e.device_id=this.value.data.device_id),this._value=Object.assign(Object.assign({},this.value),{},{target:e,data:Object.assign({},this.value.data)}),delete this._value.data.entity_id,delete this._value.data.device_id,delete this._value.data.area_id}else this._value=this.value;if((null==h?void 0:h.action)!==(null===(d=this.value)||void 0===d?void 0:d.action)){let e=!1;if(this._value&&v){const i=this.value&&!("data"in this.value);this._value.data||(this._value.data={}),v.flatFields.forEach((t=>{t.selector&&t.required&&void 0===t.default&&"boolean"in t.selector&&void 0===this._value.data[t.key]&&(e=!0,this._value.data[t.key]=!1),i&&t.selector&&void 0!==t.default&&void 0===this._value.data[t.key]&&(e=!0,this._value.data[t.key]=t.default)}))}e&&(0,o.B)(this,"value-changed",{value:Object.assign({},this._value)})}if(null!==(c=this._value)&&void 0!==c&&c.data){const e=this._yamlEditor;e&&e.value!==this._value.data&&e.setValue(this._value.data)}}},{kind:"field",key:"_getServiceInfo",value(){return(0,l.Z)(((e,i)=>{if(!e||!i)return;const t=(0,r.M)(e),a=(0,c.p)(e);if(!(t in i))return;if(!(a in i[t]))return;const s=Object.entries(i[t][a].fields).map((([e,i])=>Object.assign(Object.assign({key:e},i),{},{selector:i.selector}))),n=[],l=[];return s.forEach((e=>{e.fields?Object.entries(e.fields).forEach((([e,i])=>{n.push(Object.assign(Object.assign({},i),{},{key:e})),i.selector&&l.push(e)})):(n.push(e),e.selector&&l.push(e.key))})),Object.assign(Object.assign({},i[t][a]),{},{fields:s,flatFields:n,hasSelector:l})}))}},{kind:"field",key:"_getTargetedEntities",value(){return(0,l.Z)(((e,i)=>{var t,a,s,n,l,o,r,c,h,v,p,f,y,g,k;const _=e?{target:e}:{target:{}},b=(null===(t=(0,d.r)((null==i||null===(a=i.target)||void 0===a?void 0:a.entity_id)||(null==i||null===(s=i.data)||void 0===s?void 0:s.entity_id)))||void 0===t?void 0:t.slice())||[],m=(null===(n=(0,d.r)((null==i||null===(l=i.target)||void 0===l?void 0:l.device_id)||(null==i||null===(o=i.data)||void 0===o?void 0:o.device_id)))||void 0===n?void 0:n.slice())||[],$=(null===(r=(0,d.r)((null==i||null===(c=i.target)||void 0===c?void 0:c.area_id)||(null==i||null===(h=i.data)||void 0===h?void 0:h.area_id)))||void 0===r?void 0:r.slice())||[],x=null===(v=(0,d.r)((null==i||null===(p=i.target)||void 0===p?void 0:p.floor_id)||(null==i||null===(f=i.data)||void 0===f?void 0:f.floor_id)))||void 0===v?void 0:v.slice(),w=null===(y=(0,d.r)((null==i||null===(g=i.target)||void 0===g?void 0:g.label_id)||(null==i||null===(k=i.data)||void 0===k?void 0:k.label_id)))||void 0===y?void 0:y.slice();return w&&w.forEach((e=>{const i=(0,u.o1)(this.hass,e,this.hass.areas,this.hass.devices,this.hass.entities,_);m.push(...i.devices),b.push(...i.entities),$.push(...i.areas)})),x&&x.forEach((e=>{const i=(0,u.qR)(this.hass,e,this.hass.areas,_);$.push(...i.areas)})),$.length&&$.forEach((e=>{const i=(0,u.xO)(this.hass,e,this.hass.devices,this.hass.entities,_);b.push(...i.entities),m.push(...i.devices)})),m.length&&m.forEach((e=>{b.push(...(0,u.aV)(this.hass,e,this.hass.entities,_).entities)})),b}))}},{kind:"method",key:"_filterField",value:function(e,i){return!!i.length&&!!i.some((i=>{var t;const a=this.hass.states[i];return!!a&&(!(null===(t=e.supported_features)||void 0===t||!t.some((e=>(0,h.e)(a,e))))||!(!e.attribute||!Object.entries(e.attribute).some((([e,i])=>e in a.attributes&&E(i,a.attributes[e])))))}))}},{kind:"field",key:"_targetSelector",value(){return(0,l.Z)((e=>e?{target:Object.assign({},e)}:{target:{}}))}},{kind:"method",key:"render",value:function(){var e,i,t,a,n,l,d,o;const h=this._getServiceInfo(null===(e=this._value)||void 0===e?void 0:e.action,this.hass.services),v=(null==h?void 0:h.fields.length)&&!h.hasSelector.length||h&&Object.keys((null===(i=this._value)||void 0===i?void 0:i.data)||{}).some((e=>!h.hasSelector.includes(e))),u=v&&(null==h?void 0:h.fields.find((e=>"entity_id"===e.key))),f=Boolean(!v&&(null==h?void 0:h.flatFields.some((e=>A(e))))),y=this._getTargetedEntities(null==h?void 0:h.target,this._value),g=null!==(t=this._value)&&void 0!==t&&t.action?(0,r.M)(this._value.action):void 0,B=null!==(a=this._value)&&void 0!==a&&a.action?(0,c.p)(this._value.action):void 0,F=B&&this.hass.localize(`component.${g}.services.${B}.description`)||(null==h?void 0:h.description);return(0,s.dy)(k||(k=L`${0} ${0} ${0} ${0} `),this.hidePicker?s.Ld:(0,s.dy)(_||(_=L`<ha-service-picker .hass="${0}" .value="${0}" .disabled="${0}" -changed="${0}"></ha-service-picker>`),this.hass,null===(n=this._value)||void 0===n?void 0:n.action,this.disabled,this._serviceChanged),this.hideDescription?s.Ld:(0,s.dy)(b||(b=L` <div class="description"> ${0} ${0} </div> `),F?(0,s.dy)(m||(m=L`<p>${0}</p>`),F):"",this._manifest?(0,s.dy)($||($=L` <a href="${0}" title="${0}" target="_blank" rel="noreferrer"> <ha-icon-button .path="${0}" class="help-icon"></ha-icon-button> </a>`),this._manifest.is_built_in?(0,p.R)(this.hass,`/integrations/${this._manifest.domain}`):this._manifest.documentation,this.hass.localize("ui.components.service-control.integration_doc"),M):s.Ld),h&&"target"in h?(0,s.dy)(x||(x=L`<ha-settings-row .narrow="${0}"> ${0} <span slot="heading">${0}</span> <span slot="description">${0}</span><ha-selector .hass="${0}" .selector="${0}" .disabled="${0}" -changed="${0}" .value="${0}"></ha-selector></ha-settings-row>`),this.narrow,f?(0,s.dy)(w||(w=L`<div slot="prefix" class="checkbox-spacer"></div>`)):"",this.hass.localize("ui.components.service-control.target"),this.hass.localize("ui.components.service-control.target_secondary"),this.hass,this._targetSelector(h.target),this.disabled,this._targetChanged,null===(l=this._value)||void 0===l?void 0:l.target):u?(0,s.dy)(j||(j=L`<ha-entity-picker .hass="${0}" .disabled="${0}" .value="${0}" .label="${0}" -changed="${0}" allow-custom-entity></ha-entity-picker>`),this.hass,this.disabled,null===(d=this._value)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.entity_id,this.hass.localize(`component.${g}.services.${B}.fields.entity_id.description`)||u.description,this._entityPicked):"",v?(0,s.dy)(C||(C=L`<ha-yaml-editor .hass="${0}" .label="${0}" .name="${0}" .readOnly="${0}" .defaultValue="${0}" -changed="${0}"></ha-yaml-editor>`),this.hass,this.hass.localize("ui.components.service-control.action_data"),"data",this.disabled,null===(o=this._value)||void 0===o?void 0:o.data,this._dataChanged):null==h?void 0:h.fields.map((e=>{if(!e.fields)return this._renderField(e,f,g,B,y);const i=Object.entries(e.fields).map((([e,i])=>Object.assign({key:e},i)));return i.length&&this._hasFilteredFields(i,y)?(0,s.dy)(O||(O=L`<ha-expansion-panel left-chevron .expanded="${0}" .header="${0}" .secondary="${0}"> <ha-service-section-icon slot="icons" .hass="${0}" .service="${0}" .section="${0}"></ha-service-section-icon> ${0} </ha-expansion-panel>`),!e.collapsed,this.hass.localize(`component.${g}.services.${B}.sections.${e.key}.name`)||e.name||e.key,this._getSectionDescription(e,g,B),this.hass,this._value.action,e.key,Object.entries(e.fields).map((([e,i])=>this._renderField(Object.assign({key:e},i),f,g,B,y)))):s.Ld})))}},{kind:"method",key:"_getSectionDescription",value:function(e,i,t){return this.hass.localize(`component.${i}.services.${t}.sections.${e.key}.description`)}},{kind:"method",key:"_hasFilteredFields",value:function(e,i){return e.some((e=>!e.filter||this._filterField(e.filter,i)))}},{kind:"field",key:"_renderField",value(){return(e,i,t,a,n)=>{var l,d,o,r,c;if(e.filter&&!this._filterField(e.filter,n))return s.Ld;const h=null!==(l=null==e?void 0:e.selector)&&void 0!==l?l:{text:void 0},v=A(e);return e.selector&&(!e.advanced||this.showAdvanced||null!==(d=this._value)&&void 0!==d&&d.data&&void 0!==this._value.data[e.key])?(0,s.dy)(B||(B=L`<ha-settings-row .narrow="${0}"> ${0} <span slot="heading">${0}</span> <span slot="description">${0}</span> <ha-selector .disabled="${0}" .hass="${0}" .selector="${0}" .key="${0}" -changed="${0}" .value="${0}" .placeholder="${0}" .localizeValue="${0}"></ha-selector> </ha-settings-row>`),this.narrow,v?(0,s.dy)(S||(S=L`<ha-checkbox .key="${0}" .checked="${0}" .disabled="${0}" ="${0}" slot="prefix"></ha-checkbox>`),e.key,this._checkedKeys.has(e.key)||(null===(o=this._value)||void 0===o?void 0:o.data)&&void 0!==this._value.data[e.key],this.disabled,this._checkboxChanged):i?(0,s.dy)(F||(F=L`<div slot="prefix" class="checkbox-spacer"></div>`)):"",this.hass.localize(`component.${t}.services.${a}.fields.${e.key}.name`)||e.name||e.key,this.hass.localize(`component.${t}.services.${a}.fields.${e.key}.description`)||(null==e?void 0:e.description),this.disabled||v&&!this._checkedKeys.has(e.key)&&(!(null!==(r=this._value)&&void 0!==r&&r.data)||void 0===this._value.data[e.key]),this.hass,h,e.key,this._serviceDataChanged,null!==(c=this._value)&&void 0!==c&&c.data?this._value.data[e.key]:void 0,e.default,this._localizeValueCallback):""}}},{kind:"field",key:"_localizeValueCallback",value(){return e=>{var i;return null!==(i=this._value)&&void 0!==i&&i.action?this.hass.localize(`component.${(0,r.M)(this._value.action)}.selector.${e}`):""}}},{kind:"method",key:"_checkboxChanged",value:function(e){const i=e.currentTarget.checked,t=e.currentTarget.key;let a;if(i){var s,n;this._checkedKeys.add(t);const e=null===(s=this._getServiceInfo(null===(n=this._value)||void 0===n?void 0:n.action,this.hass.services))||void 0===s?void 0:s.flatFields.find((e=>e.key===t));let i=null==e?void 0:e.default;var l,d;if(null==i&&null!=e&&e.selector&&"constant"in e.selector)i=null===(l=e.selector.constant)||void 0===l?void 0:l.value;if(null==i&&null!=e&&e.selector&&"boolean"in e.selector&&(i=!1),null!=i)a=Object.assign(Object.assign({},null===(d=this._value)||void 0===d?void 0:d.data),{},{[t]:i})}else{var r;this._checkedKeys.delete(t),a=Object.assign({},null===(r=this._value)||void 0===r?void 0:r.data),delete a[t]}a&&(0,o.B)(this,"value-changed",{value:Object.assign(Object.assign({},this._value),{},{data:a})}),this.requestUpdate("_checkedKeys")}},{kind:"method",key:"_serviceChanged",value:function(e){var i;if(e.stopPropagation(),e.detail.value===(null===(i=this._value)||void 0===i?void 0:i.action))return;const t=e.detail.value||"";let a;if(t){var s;const e=this._getServiceInfo(t,this.hass.services),i=null===(s=this._value)||void 0===s?void 0:s.target;if(i&&null!=e&&e.target){var n,l,r,c,h,v;const t={target:Object.assign({},e.target)};let s=(null===(n=(0,d.r)(i.entity_id||(null===(l=this._value.data)||void 0===l?void 0:l.entity_id)))||void 0===n?void 0:n.slice())||[],o=(null===(r=(0,d.r)(i.device_id||(null===(c=this._value.data)||void 0===c?void 0:c.device_id)))||void 0===r?void 0:r.slice())||[],p=(null===(h=(0,d.r)(i.area_id||(null===(v=this._value.data)||void 0===v?void 0:v.area_id)))||void 0===h?void 0:h.slice())||[];p.length&&(p=p.filter((e=>(0,u.vI)(this.hass,this.hass.entities,this.hass.devices,e,t)))),o.length&&(o=o.filter((e=>(0,u.qJ)(this.hass,Object.values(this.hass.entities),this.hass.devices[e],t)))),s.length&&(s=s.filter((e=>(0,u.QQ)(this.hass.states[e],t)))),a=Object.assign(Object.assign(Object.assign({},s.length?{entity_id:s}:{}),o.length?{device_id:o}:{}),p.length?{area_id:p}:{})}}const p={action:t,target:a};(0,o.B)(this,"value-changed",{value:p})}},{kind:"method",key:"_entityPicked",value:function(e){var i,t;e.stopPropagation();const a=e.detail.value;if((null===(i=this._value)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.entity_id)===a)return;let s;var n;!a&&null!==(t=this._value)&&void 0!==t&&t.data?(s=Object.assign({},this._value),delete s.data.entity_id):s=Object.assign(Object.assign({},this._value),{},{data:Object.assign(Object.assign({},null===(n=this._value)||void 0===n?void 0:n.data),{},{entity_id:e.detail.value})});(0,o.B)(this,"value-changed",{value:s})}},{kind:"method",key:"_targetChanged",value:function(e){var i;e.stopPropagation();const t=e.detail.value;if((null===(i=this._value)||void 0===i?void 0:i.target)===t)return;let a;t?a=Object.assign(Object.assign({},this._value),{},{target:e.detail.value}):(a=Object.assign({},this._value),delete a.target),(0,o.B)(this,"value-changed",{value:a})}},{kind:"method",key:"_serviceDataChanged",value:function(e){var i,t,a;e.stopPropagation();const s=e.currentTarget.key,n=e.detail.value;if(!((null===(i=this._value)||void 0===i||null===(i=i.data)||void 0===i?void 0:i[s])!==n&&(null!==(t=this._value)&&void 0!==t&&t.data&&s in this._value.data||""!==n&&void 0!==n)))return;const l=Object.assign(Object.assign({},null===(a=this._value)||void 0===a?void 0:a.data),{},{[s]:n});""!==n&&void 0!==n||delete l[s],(0,o.B)(this,"value-changed",{value:Object.assign(Object.assign({},this._value),{},{data:l})})}},{kind:"method",key:"_dataChanged",value:function(e){e.stopPropagation(),e.detail.isValid&&(0,o.B)(this,"value-changed",{value:Object.assign(Object.assign({},this._value),{},{data:e.detail.value})})}},{kind:"method",key:"_fetchManifest",value:async function(e){this._manifest=void 0;try{this._manifest=await(0,v.t4)(this.hass,e)}catch(i){}}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(z||(z=L`ha-settings-row{padding:var(--service-control-padding,0 16px)}ha-settings-row{--paper-time-input-justify-content:flex-end;--settings-row-content-width:100%;--settings-row-prefix-display:contents;border-top:var(--service-control-items-border-top,1px solid var(--divider-color))}ha-entity-picker,ha-service-picker,ha-yaml-editor{display:block;margin:var(--service-control-padding,0 16px)}ha-yaml-editor{padding:16px 0}p{margin:var(--service-control-padding,0 16px);padding:16px 0}:host([hidePicker]) p{padding-top:0}.checkbox-spacer{width:32px}ha-checkbox{margin-left:-16px;margin-inline-start:-16px;margin-inline-end:initial}.help-icon{color:var(--secondary-text-color)}.description{justify-content:space-between;display:flex;align-items:center;padding-right:2px;padding-inline-end:2px;padding-inline-start:initial}.description p{direction:ltr}ha-expansion-panel{--ha-card-border-radius:0;--expansion-panel-summary-padding:0 16px;--expansion-panel-content-padding:0}`))}}]}}),s.oi);i()}catch(k){i(k)}}))},19467:function(e,i,t){t.a(e,(async function(e,i){try{var a=t(61701),s=(t(71695),t(47021),t(57243)),n=t(50778),l=t(94571),d=t(73850),o=t(45729),r=(t(65981),t(37583),e([o]));o=(r.then?(await r)():r)[0];let c,h,v,u,p=e=>e;(0,a.Z)([(0,n.Mo)("ha-service-icon")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"service",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){if(this.icon)return(0,s.dy)(c||(c=p`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.service)return s.Ld;if(!this.hass)return this._renderFallback();const e=(0,o.t3)(this.hass,this.service).then((e=>e?(0,s.dy)(h||(h=p`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback()));return(0,s.dy)(v||(v=p`${0}`),(0,l.C)(e))}},{kind:"method",key:"_renderFallback",value:function(){const e=(0,d.M)(this.service);return(0,s.dy)(u||(u=p` <ha-svg-icon .path="${0}"></ha-svg-icon> `),o.Ls[e]||o.ny)}}]}}),s.oi);i()}catch(c){i(c)}}))},46179:function(e,i,t){t.a(e,(async function(e,i){try{var a=t(61701),s=(t(19083),t(71695),t(92745),t(61893),t(9359),t(68107),t(56475),t(31526),t(61006),t(47021),t(57243)),n=t(50778),l=t(27486),d=t(36522),o=t(57816),r=t(94279),c=(t(7285),t(19467)),h=t(45729),v=e([r,c,h]);[r,c,h]=v.then?(await v)():v;let u,p,f=e=>e;(0,a.Z)([(0,n.Mo)("ha-service-picker")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_filter",value:void 0},{kind:"method",key:"willUpdate",value:function(){this.hasUpdated||(this.hass.loadBackendTranslation("services"),(0,h.v6)(this.hass))}},{kind:"field",key:"_rowRenderer",value(){return e=>(0,s.dy)(u||(u=f`<ha-list-item twoline graphic="icon"> <ha-service-icon slot="graphic" .hass="${0}" .service="${0}"></ha-service-icon> <span>${0}</span> <span slot="secondary">${0}</span> </ha-list-item>`),this.hass,e.service,e.name,e.name===e.service?"":e.service)}},{kind:"method",key:"render",value:function(){return(0,s.dy)(p||(p=f` <ha-combo-box .hass="${0}" .label="${0}" .filteredItems="${0}" .value="${0}" .disabled="${0}" .renderer="${0}" item-value-path="service" item-label-path="name" allow-custom-value -changed="${0}" -changed="${0}"></ha-combo-box> `),this.hass,this.hass.localize("ui.components.service-picker.action"),this._filteredServices(this.hass.localize,this.hass.services,this._filter),this.value,this.disabled,this._rowRenderer,this._filterChanged,this._valueChanged)}},{kind:"field",key:"_services",value(){return(0,l.Z)(((e,i)=>{if(!i)return[];const t=[];return Object.keys(i).sort().forEach((a=>{const s=Object.keys(i[a]).sort();for(const n of s)t.push({service:`${a}.${n}`,name:`${(0,o.Lh)(e,a)}: ${this.hass.localize(`component.${a}.services.${n}.name`)||i[a][n].name||n}`})})),t}))}},{kind:"field",key:"_filteredServices",value(){return(0,l.Z)(((e,i,t)=>{if(!i)return[];const a=this._services(e,i);if(!t)return a;const s=t.split(" ");return a.filter((e=>{const i=e.name.toLowerCase(),t=e.service.toLowerCase();return s.every((e=>i.includes(e)||t.includes(e)))}))}))}},{kind:"method",key:"_filterChanged",value:function(e){this._filter=e.detail.value.toLowerCase()}},{kind:"method",key:"_valueChanged",value:function(e){this.value=e.detail.value,(0,d.B)(this,"change"),(0,d.B)(this,"value-changed",{value:this.value})}}]}}),s.oi);i()}catch(u){i(u)}}))},86709:function(e,i,t){t.a(e,(async function(e,i){try{var a=t(61701),s=(t(71695),t(47021),t(57243)),n=t(50778),l=t(94571),d=(t(65981),t(37583),t(45729)),o=e([d]);d=(o.then?(await o)():o)[0];let r,c,h,v=e=>e;(0,a.Z)([(0,n.Mo)("ha-service-section-icon")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"service",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"section",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){if(this.icon)return(0,s.dy)(r||(r=v`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.service||!this.section)return s.Ld;if(!this.hass)return this._renderFallback();const e=(0,d.$V)(this.hass,this.service,this.section).then((e=>e?(0,s.dy)(c||(c=v`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback()));return(0,s.dy)(h||(h=v`${0}`),(0,l.C)(e))}},{kind:"method",key:"_renderFallback",value:function(){return s.Ld}}]}}),s.oi);i()}catch(r){i(r)}}))},30509:function(e,i,t){var a=t(61701),s=(t(71695),t(47021),t(57243)),n=t(50778);let l,d,o=e=>e;(0,a.Z)([(0,n.Mo)("ha-settings-row")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"slim",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"three-line"})],key:"threeLine",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"wrap-heading",reflect:!0})],key:"wrapHeading",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,s.dy)(l||(l=o` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `),!this.threeLine,this.threeLine)}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(d||(d=o`:host{display:flex;padding:0 16px;align-content:normal;align-self:auto;align-items:center}.body{padding-top:8px;padding-bottom:8px;padding-left:0;padding-inline-start:0;padding-right:16px;padding-inline-end:16px;overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:var(--paper-item-body-three-line-min-height,88px)}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:4px;font-family:var(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, Roboto, sans-serif)
);-webkit-font-smoothing:antialiased;font-size:var(--mdc-typography-body2-font-size, .875rem);font-weight:var(--mdc-typography-body2-font-weight,400);line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(var(--paper-item-body-two-line-min-height,72px) - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;padding:16px 0}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:8px}::slotted(ha-switch){padding:16px 0}.secondary{white-space:normal}.prefix-wrap{display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`))}}]}}),s.oi)},73192:function(e,i,t){t.d(i,{R:()=>a});const a=(e,i)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`}}]);
//# sourceMappingURL=78823.74159878d90cf1d2.js.map