iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 15.3 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["55119"],{49976:function(e,t,i){i.d(t,{U:()=>a});const a=e=>e.stopPropagation()},36185:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(19083),i(71695),i(19423),i(40251),i(47021),i(57243)),d=i(50778),r=i(19631),l=i(46467),o=i(36522),s=i(20382),c=(i(37583),i(83166),e([l,r]));[l,r]=c.then?(await c)():c;let u,h,f=e=>e;const p="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",v=()=>Promise.all([i.e("97983"),i.e("3134"),i.e("58640"),i.e("60351"),i.e("46360")]).then(i.bind(i,88944)),g=(e,t)=>{(0,o.B)(e,"show-dialog",{dialogTag:"ha-dialog-date-picker",dialogImport:v,dialogParams:t})};(0,a.Z)([(0,d.Mo)("ha-date-input")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"locale",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"min",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"max",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!1}},{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)({attribute:"can-clear",type:Boolean})],key:"canClear",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(u||(u=f`<ha-textfield .label="${0}" .helper="${0}" .disabled="${0}" iconTrailing helperPersistent readonly="readonly" ="${0}" ="${0}" .value="${0}" .required="${0}"> <ha-svg-icon slot="trailingIcon" .path="${0}"></ha-svg-icon> </ha-textfield>`),this.label,this.helper,this.disabled,this._openDialog,this._keyDown,this.value?(0,l.WB)(new Date(`${this.value.split("T")[0]}T00:00:00`),Object.assign(Object.assign({},this.locale),{},{time_zone:s.c_.local}),{}):"",this.required,p)}},{kind:"method",key:"_openDialog",value:function(){this.disabled||g(this,{min:this.min||"1970-01-01",max:this.max,value:this.value,canClear:this.canClear,onChange:e=>this._valueChanged(e),locale:this.locale.language,firstWeekday:(0,r.Bt)(this.locale)})}},{kind:"method",key:"_keyDown",value:function(e){this.canClear&&["Backspace","Delete"].includes(e.key)&&this._valueChanged(void 0)}},{kind:"method",key:"_valueChanged",value:function(e){this.value!==e&&(this.value=e,(0,o.B)(this,"change"),(0,o.B)(this,"value-changed",{value:e}))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(h||(h=f`ha-svg-icon{color:var(--secondary-text-color)}ha-textfield{display:block}`))}}]}}),n.oi);t()}catch(u){t(u)}}))},83166:function(e,t,i){var a=i(61701),n=i(72621),d=(i(71695),i(47021),i(1105)),r=i(33990),l=i(57243),o=i(50778),s=i(5111);let c,u,h,f,p=e=>e;(0,a.Z)([(0,o.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,o.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=p` <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[r.W,(0,l.iv)(u||(u=p`.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"===s.E.document.dir?(0,l.iv)(h||(h=p`.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=p``))]}}]}}),d.P)},49653:function(e,t,i){var a=i(61701),n=(i(71695),i(11740),i(47021),i(57243)),d=i(50778),r=i(16922),l=i(36522);i(97828);let o,s=e=>e;(0,a.Z)([(0,d.Mo)("ha-time-input")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"locale",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!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,attribute:"enable-second"})],key:"enableSecond",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:void 0},{kind:"method",key:"render",value:function(){var e;const t=(0,r.y)(this.locale),i=(null===(e=this.value)||void 0===e?void 0:e.split(":"))||[];let a=i[0];const d=Number(i[0]);return d&&t&&d>12&&d<24&&(a=String(d-12).padStart(2,"0")),t&&0===d&&(a="12"),(0,n.dy)(o||(o=s` <ha-base-time-input .label="${0}" .hours="${0}" .minutes="${0}" .seconds="${0}" .format="${0}" .amPm="${0}" .disabled="${0}" -changed="${0}" .enableSecond="${0}" .required="${0}" .clearable="${0}" .helper="${0}"></ha-base-time-input> `),this.label,Number(a),Number(i[1]),Number(i[2]),t?12:24,t&&d>=12?"PM":"AM",this.disabled,this._timeChanged,this.enableSecond,this.required,this.clearable&&void 0!==this.value,this.helper)}},{kind:"method",key:"_timeChanged",value:function(e){e.stopPropagation();const t=e.detail.value,i=(0,r.y)(this.locale);let a;if(!(void 0===t||isNaN(t.hours)&&isNaN(t.minutes)&&isNaN(t.seconds))){let e=t.hours||0;t&&i&&("PM"===t.amPm&&e<12&&(e+=12),"AM"===t.amPm&&12===e&&(e=0)),a=`${e.toString().padStart(2,"0")}:${t.minutes?t.minutes.toString().padStart(2,"0"):"00"}:${t.seconds?t.seconds.toString().padStart(2,"0"):"00"}`}a!==this.value&&(this.value=a,(0,l.B)(this,"change"),(0,l.B)(this,"value-changed",{value:a}))}}]}}),n.oi)},25542:function(e,t,i){i.d(t,{FF:()=>l,Gi:()=>o,Qp:()=>n,g2:()=>a,s2:()=>d,vY:()=>r});i(19423);const a=e=>`${e.attributes.year||"1970"}-${String(e.attributes.month||"01").padStart(2,"0")}-${String(e.attributes.day||"01").padStart(2,"0")}T${String(e.attributes.hour||"00").padStart(2,"0")}:${String(e.attributes.minute||"00").padStart(2,"0")}:${String(e.attributes.second||"00").padStart(2,"0")}`,n=(e,t,i=void 0,a=void 0)=>{const n={entity_id:t,time:i,date:a};e.callService("input_datetime","set_datetime",n)},d=e=>e.callWS({type:"input_datetime/list"}),r=(e,t)=>e.callWS(Object.assign({type:"input_datetime/create"},t)),l=(e,t,i)=>e.callWS(Object.assign({type:"input_datetime/update",input_datetime_id:t},i)),o=(e,t)=>e.callWS({type:"input_datetime/delete",input_datetime_id:t})},67223:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(61701),d=(i(52247),i(71695),i(47021),i(57243)),r=i(50778),l=i(47194),o=i(36185),s=(i(49653),i(96194)),c=i(25542),u=i(93331),h=i(8069),f=i(62577),p=e([o,h]);[o,h]=p.then?(await p)():p;let v,g,m,x,b,k=e=>e;(0,n.Z)([(0,r.Mo)("hui-input-datetime-entity-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){if(!e)throw new Error("Invalid configuration");this._config=e}},{kind:"method",key:"shouldUpdate",value:function(e){return(0,u.G2)(this,e)}},{kind:"method",key:"render",value:function(){if(!this._config||!this.hass)return d.Ld;const e=this.hass.states[this._config.entity];if(!e)return(0,d.dy)(v||(v=k` <hui-warning> ${0} </hui-warning> `),(0,f.i)(this.hass,this._config.entity));const t=this._config.name||(0,l.C)(e);return(0,d.dy)(g||(g=k` <hui-generic-entity-row .hass="${0}" .config="${0}" .hideName="${0}"> <div class="${0}"> ${0} ${0} </div> </hui-generic-entity-row> `),this.hass,this._config,e.attributes.has_date&&e.attributes.has_time,e.attributes.has_date&&e.attributes.has_time?"both":"",e.attributes.has_date?(0,d.dy)(m||(m=k` <ha-date-input .label="${0}" .locale="${0}" .disabled="${0}" .value="${0}" -changed="${0}"> </ha-date-input> `),e.attributes.has_time?t:void 0,this.hass.locale,(0,s.rk)(e.state),(0,c.g2)(e),this._dateChanged):"",e.attributes.has_time?(0,d.dy)(x||(x=k` <ha-time-input .value="${0}" .locale="${0}" .disabled="${0}" -changed="${0}" ="${0}"></ha-time-input> `),e.state===s.lz?"":e.attributes.has_date?e.state.split(" ")[1]:e.state,this.hass.locale,(0,s.rk)(e.state),this._timeChanged,this._stopEventPropagation):"")}},{kind:"method",key:"_stopEventPropagation",value:function(e){e.stopPropagation()}},{kind:"method",key:"_timeChanged",value:function(e){const t=this.hass.states[this._config.entity];(0,c.Qp)(this.hass,t.entity_id,e.detail.value,t.attributes.has_date?t.state.split(" ")[0]:void 0)}},{kind:"method",key:"_dateChanged",value:function(e){const t=this.hass.states[this._config.entity];(0,c.Qp)(this.hass,t.entity_id,t.attributes.has_time?t.state.split(" ")[1]:void 0,e.detail.value)}},{kind:"field",static:!0,key:"styles",value(){return(0,d.iv)(b||(b=k`ha-date-input+ha-time-input{margin-left:4px;margin-inline-start:4px;margin-inline-end:initial;direction:var(--direction)}div.both{display:flex;justify-content:flex-end;width:100%}`))}}]}}),d.oi);a()}catch(v){a(v)}}))},86256:function(e,t,i){var a=i(88045),n=i(72616),d=i(95011),r=RangeError;e.exports=function(e){var t=n(d(this)),i="",l=a(e);if(l<0||l===1/0)throw new r("Wrong number of repetitions");for(;l>0;(l>>>=1)&&(t+=t))1&l&&(i+=t);return i}},35638:function(e,t,i){var a=i(72878);e.exports=a(1..valueOf)},49278:function(e,t,i){var a=i(40810),n=i(72878),d=i(88045),r=i(35638),l=i(86256),o=i(29660),s=RangeError,c=String,u=Math.floor,h=n(l),f=n("".slice),p=n(1..toFixed),v=function(e,t,i){return 0===t?i:t%2==1?v(e,t-1,i*e):v(e*e,t/2,i)},g=function(e,t,i){for(var a=-1,n=i;++a<6;)n+=t*e[a],e[a]=n%1e7,n=u(n/1e7)},m=function(e,t){for(var i=6,a=0;--i>=0;)a+=e[i],e[i]=u(a/t),a=a%t*1e7},x=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var a=c(e[t]);i=""===i?a:i+h("0",7-a.length)+a}return i};a({target:"Number",proto:!0,forced:o((function(){return"0.000"!==p(8e-5,3)||"1"!==p(.9,0)||"1.25"!==p(1.255,2)||"1000000000000000128"!==p(0xde0b6b3a7640080,0)}))||!o((function(){p({})}))},{toFixed:function(e){var t,i,a,n,l=r(this),o=d(e),u=[0,0,0,0,0,0],p="",b="0";if(o<0||o>20)throw new s("Incorrect fraction digits");if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return c(l);if(l<0&&(p="-",l=-l),l>1e-21)if(i=(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(l*v(2,69,1))-69)<0?l*v(2,-t,1):l/v(2,t,1),i*=4503599627370496,(t=52-t)>0){for(g(u,0,i),a=o;a>=7;)g(u,1e7,0),a-=7;for(g(u,v(10,a,1),0),a=t-1;a>=23;)m(u,1<<23),a-=23;m(u,1<<a),g(u,1,1),m(u,2),b=x(u)}else g(u,0,i),g(u,1<<-t,0),b=x(u)+h("0",o);return b=o>0?p+((n=b.length)<=o?"0."+h("0",o-n)+b:f(b,0,n-o)+"."+f(b,n-o)):p+b}})}}]);
//# sourceMappingURL=55119.592e6147b050ed95.js.map