UNPKG

iobroker.lovelace

Version:

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

10 lines 15 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[24617],{32656:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(62953);var i=a(40445),o=a(5124),s=a(67576),l=a(63672),r=a(1087),n=a(57237),d=a(26300),h=(a(3449),a(606)),p=a(91485),u=e([d,h,p]);[d,h,p]=u.then?(await u)():u;let c,b,m,v,y,g,$,C,f,M,x,L=e=>e;const _="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";class Z extends o.WF{reportValidity(){const e=this._inputs;return!e||[...e].every(e=>e.reportValidity())}render(){return(0,o.qy)(c||(c=L` ${0} <div class="time-input-wrap-wrap"> <div class="time-input-wrap"> ${0} <ha-input id="hour" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" name="hours" @change="${0}" @focusin="${0}" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="2" max="${0}" min="0" .disabled="${0}"> </ha-input> <div class="time-separator">:</div> <ha-input id="min" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="minutes" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="2" max="59" min="0" .disabled="${0}"> </ha-input> ${0} ${0} ${0} ${0} ${0} </div> </div> ${0} `),this.label?(0,o.qy)(b||(b=L`<label>${0}${0}</label>`),this.label,this.required?" *":""):o.s6,this.enableDay?(0,o.qy)(m||(m=L` <ha-input id="day" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" name="days" @change="${0}" @focusin="${0}" without-spin-buttons .required="${0}" .autoValidate="${0}" min="0" .disabled="${0}"> </ha-input> <div class="time-separator">:</div> `),this.days.toFixed(),this.placeholderLabels?"":this.dayLabel,this.placeholderLabels?this.dayLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):o.s6,this.hours.toFixed(),this.placeholderLabels?"":this.hourLabel,this.placeholderLabels?this.hourLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,(0,l.J)(this._hourMax),this.disabled,this._formatValue(this.minutes),this.placeholderLabels?"":this.minLabel,this.placeholderLabels?this.minLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableSecond?(0,o.qy)(v||(v=L`<div class="time-separator">:</div>`)):o.s6,this.enableSecond?(0,o.qy)(y||(y=L`<ha-input id="sec" type="number" inputmode="decimal" step="any" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="seconds" without-spin-buttons .required="${0}" .autoValidate="${0}" max="59" min="0" .disabled="${0}"> </ha-input> ${0}`),this._formatValue(this.seconds),this.placeholderLabels?"":this.secLabel,this.placeholderLabels?this.secLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableMillisecond?(0,o.qy)(g||(g=L`<div class="time-separator">:</div>`)):o.s6):o.s6,this.enableMillisecond?(0,o.qy)($||($=L`<ha-input id="millisec" type="number" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="milliseconds" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="3" max="999" min="0" .disabled="${0}"> </ha-input>`),this._formatValue(this.milliseconds,3),this.placeholderLabels?"":this.millisecLabel,this.placeholderLabels?this.millisecLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):o.s6,24===this.format?o.s6:(0,o.qy)(C||(C=L`<ha-select .required="${0}" .value="${0}" .disabled="${0}" .name="${0}" @selected="${0}" @wa-after-hide="${0}" @wa-hide="${0}" .options="${0}"> </ha-select>`),this.required,this.amPm,this.disabled,"amPm",this._valueChanged,n.d,n.d,["AM","PM"]),!this.clearable||this.required||this.disabled?o.s6:(0,o.qy)(f||(f=L`<ha-icon-button label="clear" @click="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,_),this.helper?(0,o.qy)(M||(M=L`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):o.s6)}_clearValue(){(0,r.r)(this,"value-changed")}_valueChanged(e){const t=e.currentTarget;this[t.name||""]="amPm"===t.name?e.detail.value:Number(t.value);const a={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(a.days=this.days),12===this.format&&(a.amPm=this.amPm),(0,r.r)(this,"value-changed",{value:a})}_onFocus(e){e.currentTarget.select()}_formatValue(e,t=2){const a=e.toString();return a.includes(".")?a:a.padStart(t,"0")}get _hourMax(){if(!this.noHoursLimit)return 12===this.format?12:23}constructor(...e){super(...e),this.autoValidate=!1,this.required=!1,this.format=12,this.disabled=!1,this.days=0,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0,this.dayLabel="",this.hourLabel="",this.minLabel="",this.secLabel="",this.millisecLabel="",this.enableSecond=!1,this.enableMillisecond=!1,this.enableDay=!1,this.noHoursLimit=!1,this.amPm="AM",this.placeholderLabels=!1}}Z.shadowRootOptions=Object.assign(Object.assign({},o.WF.shadowRootOptions),{},{delegatesFocus:!0}),Z.styles=(0,o.AH)(x||(x=L`:host([clearable]){position:relative}.time-input-wrap-wrap{display:flex}.time-input-wrap{display:flex;flex:var(--time-input-flex,unset);border-radius:var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--ha-border-radius-square) var(--ha-border-radius-square);overflow:hidden;position:relative;direction:ltr;padding-right:3px}ha-input{height:56px;padding:0;width:60px;flex-grow:1}ha-input:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-input:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-input::part(wa-base){padding:var(--ha-space-1)}ha-input:first-child::part(wa-base){padding-inline-start:var(--ha-space-4)}ha-input:last-child::part(wa-base){padding-inline-end:var(--ha-space-4)}ha-input::part(wa-hint){height:0}ha-input::part(wa-input){text-align:center}.time-separator,ha-icon-button{background-color:var(--ha-color-form-background);color:var(--ha-color-text-secondary);border-bottom:1px solid var(--ha-color-border-neutral-loud);box-sizing:border-box;height:56px;margin-inline-start:calc(var(--ha-space-1) * -1)}.time-separator{width:12px;margin-inline-end:calc(var(--ha-space-1) * -1);display:flex;align-items:center;justify-content:center}:host([clearable]) .mdc-select__anchor{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:relative;--ha-icon-button-size:36px;border-start-end-radius:var(--ha-border-radius-sm);--mdc-icon-size:20px;direction:var(--direction);display:flex;align-items:center}ha-select{margin-inline:calc(var(--ha-space-1) * -1)}label{-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);-webkit-font-smoothing:var(--ha-font-smoothing);font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, var(--ha-font-family-body)) );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));line-height:var( --mdc-typography-body2-line-height, var(--ha-line-height-condensed) );font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));letter-spacing:var( --mdc-typography-body2-letter-spacing, .0178571429em );text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px;padding-inline-start:4px;padding-inline-end:initial}ha-input-helper-text{padding-top:8px;line-height:var(--ha-line-height-condensed)}`)),(0,i.Cg)([(0,s.MZ)()],Z.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)()],Z.prototype,"helper",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"auto-validate",type:Boolean})],Z.prototype,"autoValidate",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],Z.prototype,"required",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],Z.prototype,"format",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],Z.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],Z.prototype,"days",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],Z.prototype,"hours",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],Z.prototype,"minutes",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],Z.prototype,"seconds",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],Z.prototype,"milliseconds",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"day-label"})],Z.prototype,"dayLabel",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"hour-label"})],Z.prototype,"hourLabel",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"min-label"})],Z.prototype,"minLabel",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"sec-label"})],Z.prototype,"secLabel",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"ms-label"})],Z.prototype,"millisecLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"enable-second",type:Boolean})],Z.prototype,"enableSecond",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"enable-millisecond",type:Boolean})],Z.prototype,"enableMillisecond",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"enable-day",type:Boolean})],Z.prototype,"enableDay",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"no-hours-limit",type:Boolean})],Z.prototype,"noHoursLimit",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],Z.prototype,"amPm",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],Z.prototype,"clearable",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"placeholder-labels",type:Boolean})],Z.prototype,"placeholderLabels",void 0),(0,i.Cg)([(0,s.YG)("ha-input")],Z.prototype,"_inputs",void 0),Z=(0,i.Cg)([(0,s.EM)("ha-base-time-input")],Z),t()}catch(c){t(c)}})},19463:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(3362),a(62953);var i=a(40445),o=a(5124),s=a(67576),l=a(380),r=a(72487),n=a(1087),d=a(46927),h=(a(67094),a(91485)),p=e([h,r,l]);[h,r,l]=p.then?(await p)():p;let u,c,b=e=>e;const m="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([a.e(80827),a.e(17481),a.e(24077)]).then(a.bind(a,64080)),y=(e,t)=>{(0,n.r)(e,"show-dialog",{dialogTag:"ha-dialog-date-picker",dialogImport:v,dialogParams:t})};class g extends o.WF{reportValidity(){var e,t;return null===(e=null===(t=this._input)||void 0===t?void 0:t.reportValidity())||void 0===e||e}render(){var e,t;return(0,o.qy)(u||(u=b`<ha-input .label="${0}" .hint="${0}" .disabled="${0}" readonly="readonly" @click="${0}" @keydown="${0}" .value="${0}" .required="${0}"> <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-input>`),null!==(e=this.label)&&void 0!==e?e:"",null!==(t=this.helper)&&void 0!==t?t:"",this.disabled,this._openDialog,this._keyDown,this.value?(0,r.zB)(new Date(`${this.value.split("T")[0]}T00:00:00`),Object.assign(Object.assign({},this.locale),{},{time_zone:d.Wj.local}),{}):"",this.required,m)}_openDialog(){this.disabled||y(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,l.P)(this.locale)})}_keyDown(e){if(["Space","Enter"].includes(e.code))return e.preventDefault(),e.stopPropagation(),void this._openDialog();this.canClear&&["Backspace","Delete"].includes(e.key)&&this._valueChanged(void 0)}_valueChanged(e){this.value!==e&&(this.value=e,(0,n.r)(this,"change"),(0,n.r)(this,"value-changed",{value:e}))}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.canClear=!1}}g.styles=(0,o.AH)(c||(c=b`:host{min-width:0px}ha-svg-icon{color:var(--secondary-text-color)}`)),(0,i.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"locale",void 0),(0,i.Cg)([(0,s.MZ)()],g.prototype,"value",void 0),(0,i.Cg)([(0,s.MZ)()],g.prototype,"min",void 0),(0,i.Cg)([(0,s.MZ)()],g.prototype,"max",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"required",void 0),(0,i.Cg)([(0,s.MZ)()],g.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)()],g.prototype,"helper",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"can-clear",type:Boolean})],g.prototype,"canClear",void 0),(0,i.Cg)([(0,s.P)("ha-input",!0)],g.prototype,"_input",void 0),g=(0,i.Cg)([(0,s.EM)("ha-date-input")],g),t()}catch(u){t(u)}})},50286:function(e,t,a){a.a(e,async function(e,t){try{a(62953);var i=a(40445),o=a(5124),s=a(67576),l=a(69543),r=a(1087),n=a(32656),d=e([n]);n=(d.then?(await d)():d)[0];let h,p=e=>e;class u extends o.WF{reportValidity(){var e,t;return null===(e=null===(t=this._input)||void 0===t?void 0:t.reportValidity())||void 0===e||e}render(){const e=(0,l.J)(this.locale);let t=NaN,a=NaN,i=NaN,s=0;if(this.value){var r;const o=(null===(r=this.value)||void 0===r?void 0:r.split(":"))||[];a=o[1]?Number(o[1]):0,i=o[2]?Number(o[2]):0,t=o[0]?Number(o[0]):0,s=t,s&&e&&s>12&&s<24&&(t=s-12),e&&0===s&&(t=12)}return(0,o.qy)(h||(h=p` <ha-base-time-input .label="${0}" .hours="${0}" .minutes="${0}" .seconds="${0}" .format="${0}" .amPm="${0}" .disabled="${0}" @value-changed="${0}" .enableSecond="${0}" .required="${0}" .clearable="${0}" .helper="${0}" .placeholderLabels="${0}" .autoValidate="${0}" day-label="dd" hour-label="hh" min-label="mm" sec-label="ss" ms-label="ms"></ha-base-time-input> `),this.label,t,a,i,e?12:24,e&&s>=12?"PM":"AM",this.disabled,this._timeChanged,this.enableSecond,this.required,this.clearable&&void 0!==this.value,this.helper,this.placeholderLabels,this.autoValidate)}_timeChanged(e){e.stopPropagation();const t=e.detail.value,a=(0,l.J)(this.locale);let i,o=0;if(!(void 0===t||isNaN(t.hours)&&isNaN(t.minutes)&&isNaN(t.seconds))){let e=t.hours||0;t&&a&&(o=e>=12&&e<24?e-12:0===e?12:0,"PM"===t.amPm&&e<12&&(e+=12),"AM"===t.amPm&&12===e&&(e=0)),i=`${e.toString().padStart(2,"0")}:${t.minutes?t.minutes.toString().padStart(2,"0"):"00"}:${t.seconds?t.seconds.toString().padStart(2,"0"):"00"}`}o&&this.updateComplete.then(()=>{const e=this._input;e&&(e.hours=o)}),i!==this.value&&(this.value=i,(0,r.r)(this,"change"),(0,r.r)(this,"value-changed",{value:i}))}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.autoValidate=!1,this.enableSecond=!1,this.placeholderLabels=!1}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"locale",void 0),(0,i.Cg)([(0,s.MZ)()],u.prototype,"value",void 0),(0,i.Cg)([(0,s.MZ)()],u.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)()],u.prototype,"helper",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"required",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"auto-validate",type:Boolean})],u.prototype,"autoValidate",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"enable-second"})],u.prototype,"enableSecond",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],u.prototype,"clearable",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"placeholder-labels",type:Boolean})],u.prototype,"placeholderLabels",void 0),(0,i.Cg)([(0,s.P)("ha-base-time-input")],u.prototype,"_input",void 0),u=(0,i.Cg)([(0,s.EM)("ha-time-input")],u),t()}catch(h){t(h)}})}}]);